Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

Autocorrelation and Stochastic Mean Reversion Trading

42 sec read

Here is a simple mean reversion trading system using Autocorrelation and Stochastic osciallator crossover. In the last article we seen about autocorrelation that negative correlation attracts mean reversion trading and positive correlation attracts trend trading. so the whole idea of the trading system is not to take all the stochastic crossover signals. But only the long only positive crossover signals when the autocorrelation is negative.

Nifty Autocorrelation Mean Reversion Strategy

 
Trading Strategy Rules
1)Enter Long trade at the next day open only if the auto-correlation is negative and there is a positive stochastic crossover.
2)Exit Long trade at the next day open if either the auto-correlation turns positive or if there is a negative stochastic crossover

Autorcorrrelation and Stochastic Mean Reversion Trading – Amibroker AFL coding
https://gist.github.com/marketcalls/3ac1f596152061edf7d0

Strategy tested with Nifty Futures Daily timeframe with 100 shares (4 lots x25 shares of Nifty) for Long only trades. Commission+Taxes+Slippages are assumed to be Rs150 per trade. Tested with historical data right from the year 2005. And the holding time of the trading strategy range from 2 days to 10 days max.

Equity Curve
1_ Portfolio Equity

Check out the complete backtest report since 2005 for Nifty futures

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

What is QuantZilla?

Quantzilla is 75+ hours of code mentoring program designed for noncoders who want to learn the coding program right from designing indicators, scanners, trading...
Rajandran R
58 sec read

Things to Consider While Building a Bracket Order Execution…

Building a Bracket Order Strategy is the most demanded request we got from most of the algomojo traders. This article explains the list of...
Rajandran R
12 min read

PlaceOrder – Multi Broker Exectuion Code Snippets for Amibroker

This tutorial explains how to build a button trading right from scratch and with a click of a button how you can send orders...
Rajandran R
7 min read

16 Replies to “Autocorrelation and Stochastic Mean Reversion Trading”

  1. Hello Rajandran,

    Thanks for the blog post. :).. One point i wanted to run by you:

    I see that you like to dissect the trading set up and optimize each entity.

    Example:

    The current blog spot i.e. Autocorrelation and Stochastic Mean Reversion Trading or ATR Long only System.

    You have optimized them to catch the specific aspect, in this case going long only and though we can take signals for shorting, you advise not to because we are increasing the risk factor for fraction of the profit generated by the long.

    Kindly clarify my doubt, say in a month like December when there was a down trend in Nifty, even though we have a specific system to catch longs, but the market was not conductive and there is not a possibility of of not taking trades or possible whipsaws.

    It would be really beneficial if you can give us a system that specializes in short only, for higher time frames for volatile scrips like BN etc…

    I don’t mean to impose and want to emphasize that i am grateful and confident that so are many more who have benefited from your out of the box thinking.

    Thanks

    Sai

    1. Hi Sai,

      To be frank i havent searched for a pure short only system yet. And one thing i want to point you here. Iam not optimizing each and every entity here. If i do so mostly probably we will end up with curve fitting. My optimization variable will be around 2-3 parameters max at any given trading system. More the Optimization variable more it does only curve fitting.

      Anyways thanks for your ping to look out for pure Short only strategies. Will explore!

    1. Yes the system is designed accordingly since it is a EOD based strategy. You can either choose the days closing or at the next day open for your entry or exit. You can set the trade delay in the AFL code to 0,0,0,0 if you want to enter on the same day close to the market close.

    1. No broker in India will offer MT4 because MT4 is not made for stock exchanges so none of the stock exchange in the world will approve such trading terminals for trading. MT4 is built for Forex and CFD’s.

      1. few international brokers used to provide indian indices and stocks in their mt4 demo accounts in the past ( e.g. fxcentral & oanda etc. ), although may not be much legal, but it was very handy for analysis purpose, but now…… 🙁

        any way thnx 4 ur reply.

  2. Hi Rajandran,

    Attachment is not available in this post. Please let me know where I can see that.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More