McGinely Dynamic indicator devised by John R.McGinley has been stated as the most reliable indicator at Investopedia. This indicator is more responsive to raw data as compared to simple moving average or exponential moving average. McGinely dynamic is supposed to avoid whipsaws when compared with any moving averages. It looks like a moving average line yet it is a smoothing mechanism for prices that turns out to track far better than any moving average. It minimizes price separation, price whipsaws and hugs prices much more closely. In this post we will evaluate McGinley Dynamic Trading System and go through its backtest report.
Below is the mathematical formula for McGinely Dynamic indicator:
MD = MD-1 + (Price– MD-1) / (N * (Price/ MD-1 ) 4
MD-1 Indicator value for the previous candle or bar
Price: Price of the security
N: Smoothing factor
Please visit Trading Tuitions Academy to learn AFL coding and create your own Trading systems.
McGinley Dynamic Trading System: AFL Overview
|Preferred Timeframe||McGinely Dynamic|
|Indicators Used||25 period McGinely Dynamic indicator|
|Position Size||150 (fixed)|
|Brokerage||100 per order|
This indicator is originally coded by Karthik Marar, we have added backtest conditions and buy/sell signals.
Download AFL code from here.
Below is the screenshot of McGinley Dynamic Trading System for NSE Nifty
McGinley Dynamic Trading System: Backtest Report
This strategy has achieved a decent CAGR in last 12 years. Th drawdown is on a little higher side similar to any trend following strategy.
| NSE Nifty
|Scrip Name||NSE Nifty|
|Backtest Period||01-Jan-2004 to 19-Oct-2016|
|Net Profit %||771.55%|
|Annual Return %||18.42%|
|Number of Trades||128|
|Winning Trade %||36.72%|
|Average holding Period||23.43 periods|
|Max consecutive losses||9|
|Max system % drawdown||-17.90%|
|Max Trade % drawdown||-70.97%|
Download the detailed backtest report here.
Equity Curve and Profit Table
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 email@example.com