Menu
  • Option Hydra
  • Training
  • Premium
  • Courses
  • Library

Marketcalls

Simply Intelligent Technical Analysis and Trading Strategies

  • Software
    • Amibroker
    • NinjaTrader 7
    • Ninjatrader 8
    • Option Action
    • Market Analyst
    • Metatrader
    • Python
    • Datafeed
  • Market Profile
    • Orderflow
  • Markets
  • Commodities
  • Forex
  • Economy
    • Banking
  • Webinars
  • Trading Lessons
    • Algo Trading
    • Infographic
    • Video
You are here: Home / Quantconnect / RSI Indicator with Martingale Position Sizing

RSI Indicator with Martingale Position Sizing

June 10, 2014 by Jared Broad Leave a Comment

The following article is a guest post from Jared Broad, CEO and Founder of QuantConnect. QuantConnect is an online browser-based back-testing platform for C# that allows you to test custom strategies over 15 years of historical intraday data. This article will be part of a new bi-monthly post by Jared with strategy examples for algorithmic trading.

Martingale is a bet sizing technique for increasing odds of winning at the expense of increased risk. The classic example is a coin flipping game where the gambler doubles his bet if he loses, in the hopes of making back any losses to break even. He will continue doubling his bet through subsequent losses until the bet breaks even. Once he returns to whole he continues betting with a unit bet. In theory with infinite capital and exactly 50-50 probability martingale can ensure the gambler will always return a profit.

Martingale portfolios typically display near perfect equity curves with dramatic, short term drawdowns.

Martingale portfolios typically display near perfect equity curves with dramatic, short term drawdowns.

 
Martingale position sizing is sometimes used in trading strategies without knowing its true risks. When implemented in reality traders have limited leverage, and the market win-loss probability fluctuates as losses can when the market is range-bound. It is a certainty that with a sufficient sample size eventually catastrophic loss does occur, it’s just a matter of when.

To demonstrate this we built a martingale position management algorithm, and backtest it on 15 years of data in QuantConnect to highlight the crashes.

[youtube http://www.youtube.com/watch?v=HUfd7U8J1KA?html5=0&controls=1&color=white&theme=light&modestbranding=1&showinfo=0&rel=0&suggestedQuality=hd1080&enablejsapi=1&origin=https%3A%2F%2Fwww.quantconnect.com]

To decide entry points we chose a the popular Relative Strength Index (RSI) indicator and shorted when it was over 70, signalling it was overbought. Conversely we entered the market long when it was less than 30, signalling oversold. Our entry and exit conditions were fairly arbitrary because we wanted to explore martingale position sizing more than RSI.

Once the algorithm was vested we monitor for a minimum profit gain, and on achieving the minimum profit-gain we exit the strategy locking in the profit.

In the event the algorithm reaches our maximum loss, we record the trade loss and double-invert the position as per martingale rules. The trade’s loss is now attached to a “loss-chain” parameter which serves as memory of this doubling-sequence. The minimum profit gain must also recoup the loss-chain before resetting to start again.

Our backtest result shows our implementation beating the absolute return of the SPY over a 15 year period, but it has greater volatility resulting in a lower Sharpe Ratio (0.4 vs 1.1 S&P). Interestingly it demonstrates the characteristic crashes of a martingale strategy, but since we have fixed leverage the crashes never rebound to form the perfect straight line.

There are many areas for experimentation to improve the strategy performance, such as using more intelligent entry and exit techniques, anti-martingale position sizing and adjusting our entry and loss targets based on market volatility. But I’ll leave that for you to explore! Originally posted by Jared Broad on QuantConnect.

This post originally appeared on the QuantConnect Blog. QuantConnect is a free online back-testing solution, seeking to democratize finance and make algorithmic trading accessibly to all investors.

Related articles across the web

  • QuantConnect C# Algorithmic Trading Platform in a Browser
  • The Financial Revolution: The Kiwi expat behind QuantConnect
  • How to identify algorithmic trading strategies

    Related Readings and Observations

    • Rotating Inversely Correlated Assets – NIFTY and USDINRRotating Inversely Correlated Assets – NIFTY and USDINR Rotating inversely correlated assets to select the top performer. We achieved a 2x gain on underlying asset performance tracking the USDINR - NIFTY.
    • The Importance of BenchmarkingThe Importance of Benchmarking Selecting the right benchmarking technique and index can be critical for truly understanding your strategy success. In this post we benchmark the Sell in May strategy with the S&P 500 […]
    • The Moving Average Cross Strategy – 3 Common Implementation MistakesThe Moving Average Cross Strategy – 3 Common Implementation Mistakes While Implementing algotrading strategies we see several very common mistakes by the coders even in the most basic strategies. we wanted to start by helping users avoid these common […]
    • The Moving Average Cross Strategy – 3 Common Implementation MistakesThe Moving Average Cross Strategy – 3 Common Implementation Mistakes While Implementing algotrading strategies we see several very common mistakes by the coders even in the most basic strategies. we wanted to start by helping users avoid these common […]
    • QuantConnect C# Algorithmic Trading Platform in a BrowserQuantConnect C# Algorithmic Trading Platform in a Browser QuantConnect provides an online algorithm development environment. Through their portal you can write C# and test algorithms over 15 years of stock data for 16,000 equities and 14 major […]
    • Van Tharp’s – The Position Sizing™ Game 4.0Van Tharp’s – The Position Sizing™ Game 4.0 Van Tharp had designed The Position Sizing™ Game to help you learn the secrets to trading success before you play the markets. This game does not simulate picking stocks in the market. […]

    Filed Under: Quantconnect Tagged With: Martingale, Position Sizing, QuantConnect, RSI

    About Jared Broad

    Jared Broad is the founder and CEO of QuantConnect - a web based algorithm trading platform, combining a powerful cloud with 15 years free financial data. Clone open-sourced trading algorithms from the community and trade them on your own brokerage account. Sign up for free at QuantConnect.com

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Email Newsletter

    Sign up to receive email updates on latest trading strategies , analysis & financial market updates

    We Respect Your Privacy

    Premium Access

    Username:
    Password:
    Remember Me
    Lost your password?

    Tools For Traders

    • Marketcalls Android App
    • MCX Signals
    • Intraday Signals
    • International Commodities
    • OI Tracker
    • Participation OI
    • Your Broker
    • Market Sentiment Analysis

    Amibroker Updates

    Code Snippet: ATM Call and ATM Put calculation from Spot Prices: Amibroker AFL

    December 10, 2019 By Rajandran 2 Comments

    Volatile Phases – Colorful ADX Amibroker AFL Code

    November 16, 2019 By Rajandran 4 Comments

    Amibroker Technical Analysis Workshop – Bangalore

    November 1, 2019 By Rajandran 2 Comments

    How to Send Alerts from Amibroker to Telegram Channel using Telgram API

    June 12, 2019 By Rajandran 15 Comments

    How to Estimate the VWAP based settlement Close like a Pro using Amibroker?

    June 9, 2019 By Rajandran Leave a Comment

    • Facebook
    • Google+
    • LinkedIn
    • RSS
    • Twitter
    • YouTube

    Metatrader Updates

    MetaTrader 5 Demo Servers Now Available for BSE Currency Markets

    March 20, 2018 By Rajandran 8 Comments

    ChartIQ – WebTrader for MT4

    December 4, 2017 By Rajandran 5 Comments

    Metatrader 4 – Web Platform Overview

    October 29, 2015 By Rajandran 9 Comments

    William VIX FIX Indicator for Metatrader 4

    May 16, 2015 By Rajandran 9 Comments

    How to Install Custom MQL4 indicators in Metatrader

    November 14, 2014 By Rajandran 7 Comments


    About | Contact Us | Terms and Conditions | Privacy Policy | Support Policy | Privacy Policy | Refund Policy | Disclaimer


    © Copyright 2018 Marketcalls Financial Services Pvt Ltd · All Rights Reserved · And Our Sitemap · All Logos & Trademark Belongs To Their Respective Owners·

    Data and information is provided for informational purposes only, and is not intended for trading purposes. Neither marketcalls.in website nor any of its promoters shall be liable for any errors or delays in the content, or for any actions taken in reliance thereon.