This strategy is based on MACD, RSI, Stochastic and Exponential moving average. Combination of all these indicators assures good returns with minimum whipsaws. In the chart, uptrends are represented by blue color and downtrends are represented by red color.
Please visit Trading Tuitions Academy to learn AFL coding and create your own Trading systems.
|Preferred Timeframe||Daily, Hourly|
|Indicators Used||MACD, Stochastic, RSI, EMA|
|Buy Condition||RSI period 3 greater than 50, Difference between MACD and|
MACD signal line is greater than 0 and also greater than that of
previous candle, Stochastic %D line is less than 80 and greater
than that of previous candle, Closing price greater than EMA
|Sell Condition||RSI period 3 less than 50, Difference between MACD and|
MACD signal line is less than 0 and also less than that of
previous candle, Stochastic %D line is greater than 20 and less
than that of previous candle, Closing price less than EMA
|Targets||No fixed target, Stop and reverse when AFL gives opposite signal|
|Brokerage||50 per order|
Click here to download the AFL code for this system. The AFL can directly be imported into Amibroker and no modifications are required.
|Backtest Period||09-06-2000 to 26-02-2016|
|Net Profit %||2585.05%|
|Annual Return %||22.58%|
|Number of Trades||110|
|Winning Trade %||28.18%|
|Average holding Period||30.73 periods|
|Max consecutive losses||12|
|Max system % drawdown||-56.04%|
|Max Trade % drawdown||-62.51%|
Download the detailed backtest report here.
Please note that you can expect even better results if you allow compounding of your returns.
Additional Amibroker settings for backtesting
Goto Symbol–>Information, and specify the lot size and margin requirement. The below screenshot shows lot size of 30 and margin requirement of 10% for Bank 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