Pages:
Author

Topic: Let's Backtest Some Indicators - page 3. (Read 7776 times)

legendary
Activity: 1064
Merit: 1001
June 23, 2014, 02:32:10 PM
#2
Absolutely brilliant! Waiting for more! Thanks!
newbie
Activity: 32
Merit: 0
June 23, 2014, 02:16:59 PM
#1
I will be posting a series of backtests for various indicators on BTC historical data.   I posted on the Aroon last week, but thought I would begin a larger thread to see if anyone is interested in this research project.   This time I am backtesting the ADX indicator

The ADX is one of the more complicated indicators in a trader's arsenal.   The reason why the ADX is complex is because it is a compilation of many indicators created by J. Welles Wilder in his book New Concepts in Technical Trading.  The book is worth the read because his ideas have been so influential on previous and contemporary traders.  (I also heard from a little bird that it is easy to find a pdf of the book from a basic google search.)

I am going to give a basic overview of the indicator then backtest it on historical BTC data.   The ADX is designed to indicate changes in momentum and the direction and strength of a trend.   The indicator does this by first calculating the Directional Movement Index (DMI).

The DMI generally consists of the difference between two different values the DM+(blue or green) and the DM-(red).  The DM+ and DM- consist of the net difference between the most recent highs and lows.  Changes in momentum are generally detected when the DM+ crosses the DM- and vice versa.    Additionally, the direction of the trend is determined by whether or not the DM+ or DM- has a higher value.

The creation of the ADX is based on the DMI and various smoothing techniques.  This involves taking the difference between the absolute value of the DM+ and DM- and dividing it by the sum of the DM+ and DM-.  The calculation is somewhat complex and can be found in more detail at stockcharts.com

http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:average_directional_index_adx

The traditional interpretation of the indicator involves using the ADX line (green or blue) to indicate a trend.  When the ADX is below 20, then the markets are moving sideways.  If it is above 20, then the markets are trending.  Trading signals are determined when there is a crossover of the DM+ and DM-.   Here is an example:

http://i.imgur.com/QC1vLGn.png

Now that we have the basics of the ADX down let's do some historical research. I am going to do two backtests using the default parameters for the ADX and a basic non-optimized position sizing strategy that trades approx $1,000 (or less) on each trade.  The position sizing strategy helps to focus on the performance of the indicator itself.  Since this is only research on an indicator and not a fully developed system, then our focus consists on how it works on various individual trades which I give below.

I will create two separate strategies.  The first will be to trade when the DM+ crosses above the DM- and sell with the reverse.  Also, we will use the ADX line above 20 as a filter.  Call this ADX Research.   

The second will merely use the DMI without the ADX filter (DMI Research).  As usual, I will use NinjaTrader for the backtest and analysis.  I will post images of the results and provide links for the code below.

Here is a summary of  the results of the ADX results:

http://i.imgur.com/0kLTgHV.png

Here is a summary of each trade

http://i.imgur.com/LwmtVkg.png

Here is short simulation of the strategy on Youtube to give you a picture of each trade.

https://www.youtube.com/watch?v=OCWIXg-xxGg&feature=youtu.be

Here is a summary of the DMI results

http://i.imgur.com/Zkif51J.png

Here is a summary of each trade

http://i.imgur.com/m3gH4sR.png

Here is a short simulation on Youtube to give you a picture of each trade.

https://www.youtube.com/watch?v=9dR97Uq6Gww&feature=youtu.be

Here are some things to notice:

1. The ADX system does succeed at filtering out many whipsaw trades when the market is flat.  However, this increase in % profitable also comes with the cost of less total profit and a lower profit fact.

2. The total drawdown of each system is the same.  Importantly, the ADX filter does not decrease drawdown risk.  The ADX filter does not perform better on a return to risk basis.

3. One reason that the DMI indicator does well is because BTC prices trend and have low volatility when moving sideways.  If these features were to change, then the DMI indicator would do less well.   I am merely pointing out one of the many limitations that occur through backtesting.

You can download the code for on my blog
http://www.signalstrengthfinance.com/better-know-an-indicator-adx/

You can also find a free daily updating link to upload historical BTC data into NinjaTrader here

http://www.signalstrengthfinance.com/bitconnector-bitcoin-trading-on-ninjatrader/

Trade Well and Prosper
Pages:
Jump to: