Trend following is certainly a sure-shot way to mint money during rising or falling markets. At sideways trend it can be painful due to consecutive whipsaws but there is no way to avoid that. The only thing we can try is to minimize whipsaws using combination of indicators. The intraday trend following strategy that we are going to discuss uses combination of MACD and Bollinger Bands to indicate trading opportunities. MACD is used to identify the direction of market (uptrend or downtrend) while Bollinger bands are used to catch only strong trends and avoid unnecessary whipsaws. This is a pure intraday strategy as none of the positions are carried forward. The strategy has a decent success rate in 5 minutes timeframe. Also, the CAGR of 40%~ in 4 years backtesting period is commendable.
Please visit Trading Tuitions Academy to learn AFL coding and create your own Trading systems.
Intraday Trend Following Strategy – AFL Overview
|Preferred Time-frame||5 Minutes|
|Indicators Used||MACD (12,26,9), Bollinger Bands (20,3)|
|Position Size||150 Quantities|
|Brokerage||100 per order|
Intraday Trend Following Strategy– AFL Code
Click here to download the AFL code for this system.
Intraday Trend Following Strategy – Backtest Report
|Scrip Name||NSE Nifty|
|Backtest Period||08-Feb-2012 to 21-Nov-2016|
|Net Profit %||437.51%|
|Annual Return %||40.80%|
|Number of Trades||106|
|Winning Trade %||67.92%|
|Average holding Period||24.20 periods|
|Max consecutive losses||4|
|Max system % drawdown||-13.03%|
|Max Trade % drawdown||-8.13%|
Download the detailed backtest report here.
This intraday trend following strategy has been profitable on all the years from 2012 to 2016
Additional Amibroker settings for backtesting
Goto Symbol–>Information, and specify the lot size and margin requirement. The below screenshot shows lot size of 75 and margin requirement of 10% for NSE Nifty:
All the AFL’s posted in this section are for learning purpose. Trading Tuitions does not necessarily own these AFL’s and we don’t have any intellectual property rights on them. We might copy useful AFL’s from public forums and post it in this section in a presentable format. The intent is not to copy anybody’s work but to share knowledge. If you find any misleading or non-reproducible content then please inform us at firstname.lastname@example.org