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.
[wp_ad_camp_5]
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
Check out the complete backtest report since 2005 for Nifty futures
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
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!
Thanks a lot Rajandran.
Sai
Action needed only at market opening?
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.
Great. Thanks
any one here knows, which broker is offering nifty and bank nifty in mt4 demo account???
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.
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.
also if anybody still offering INR pairs in mt4, then pl. let me know
thnx
Can you please upload AFL itself as am not aware of AFL coding
Profit Loss % is just less than 1. Only 53 % profits.We have to trade with caution.
What are the pros and cons of this strategy?
Hi Rajandran,
Attachment is not available in this post. Please let me know where I can see that.
Hi Rajandran
Please reattach the code or a site to get the code?
regards
KAZIM
Hi Rajandran
Please reattach the code or a site to get the code?
regards
KAZIM
Reply