They say the trend is your friend, but how do you find your friends in the forex jungle? This post shows you how to use the ADX indicator to identify forex markets and timeframes that trend well.
The ADX algorithm explained below can be downloaded from the Free Strategies section.
Trend following remains one of the most popular and reliable approaches in forex trading.
We’ve all had the experience of witnessing an incredible trend, and wishing we had been a part of it. Such trends often begin after a shift in market fundamentals, and are subsequently maintained by herd mentality.
Catching one of these big trends can really make a big difference to your bottom line.
Developing a profitable trend strategy is only part of the challenge. You also need to know which markets to trade it on.
With at least eight major currencies and dozens of resultant currency pairs, this can be a challenge.
Fortunately, we can use one of Wilder’s finest creations, the Average Directional Index (ADX) indicator, to find the best forex markets for trend following.
Measuring Trend Strength With the ADX Indicator
The ADX is tedious to calculate, but easy to apply. StockCharts has provided an excellent article detailing its calculation.
Most charting platforms come equipped with the ADX. The chart below shows the GBPUSD with the ADX attached.
The ADX comes with two other lines – the Plus Directional Indicator (+DI) and Minus Directional Indicator (-DI).
The +DI and -DI lines define the trend direction. If +DI is above -DI, the market is in an uptrend. Conversely, if +DI is below -DI, the market is in a downtrend.
The ADX is derived from the +DI and -DI, and measures the strength (not direction) of the trend.
According to Wilder, ADX values above 25 indicate a strong trend, while values below 20 indicate there is no trend.
In the chart above, the +DI crossed above the -DI, after which a strong uptrend developed. This caused the ADX to rise above 25.
Finding Trending Markets with the ADX
So now we know the ADX is a great tool for detecting market trends. How do we use it to analyze historical data?
We’ll program a simple algorithm that goes over the historical data and counts the number of bars where the ADX indicated a trend.
Wilder used 25 to indicate a strong trend, but I’ll be picky and use a minimum ADX value of 30 instead.
I programmed the ADX algorithm in EA Wizard (the predecessor to AlgoWizard) a few years ago. The pseudocode is as follows:
- If the ADX value is 30 or more, we will consider this bar to be in a trend, and actions 2 and 3 below will be executed.
- Here we tally the number of bars (ADX_Count) where the ADX was at least 30. The parameter ADX_Count will have to be initialized as 0 before the algorithm is run.
- We will log the number of counted bars in the MT4 Journal.
What lookback period should we use for the ADX? Wilder used a default value of 14.
That seems quite short though. We are mostly concerned with longer-term trends since those are the most profitable.
Let’s up the ante and test three different lookback periods – 20, 40, and 80. This will help us focus on short, mid, and long-term trends, respectively.
Markets and Timeframes
You can run the ADX algorithm on any market that interests you. Here I’ll focus on six liquid currency pairs over the last 10 years:
The 1-hour and 4-hour timeframes will be used.
Running the ADX Algorithm on MT4’s Backtester
Nowadays, I try to minimize my strategy development on MT4 because of its inefficient backtest engine. For this case, however, we’re not placing any actual trades, so the backtest runs pretty fast.
The backtesting procedure is similar to any other algorithm, except that we’ll refer to the Journal tab to get the total bar count.
Forex Market Trend Results
To determine how often a market trends, I’ll take the ADX bar count and divide it by the total number of bars over the 10-year period. For the 1-hour timeframe, there are approximately 62400 bars (24 bars per day * 260 trading days per year * 10 years), and 15600 bars for the 4-hour timeframe.
This gives me the percentage of time the market is trending, and will be used to rank the ‘trendiness’ of different markets and timeframes. Results are shown below.
The Market Average column shows the average percentage for each market, across the three ADX lookback periods.
Lookback Average row shows the average percentage for each lookback period, across the six markets.
The longer the ADX lookback period, the less often it registers a trend. This is expected because long-term trends are relatively uncommon.
Selecting Your Market
Let’s use the 1-hour timeframe as an example. From the Market Average column, we see that EURJPY and GBPJPY trend the most often.
However, GBPJPY has more mid and long-term trends, as shown by the higher percentage values from the 40 and 80-period ADX. These are the trends that bring the most profits.
I previously measured the trending tendencies of the same six markets using reversal trend strategies, and the results from both methods show strong confluence.
GBPJPY therefore deserves your consideration if you favour a trend following approach. This market is often feared by retail traders because of its tremendous volatility, which often causes self-sabotage among traders. If you trade algorithmically, you already have a much lower risk of breaking your trading rules in real time.
You may have noticed that even the least trending market, EURGBP, only trends 1.5% less than the EURJPY. This still translates to two trading months worth of bars, which can mean a good amount of trend following.
Moreover, I believe the ADX gauges trend strength by measuring the balance of power between bulls and bears. This is done in a relative sense, without taking the amount of absolute price movement (in pips) into consideration. Markets like the EURJPY and GBPJPY have far greater pip movement than the EURGBP, which I demonstrated when measuring historical volatility using the ATR indicator.
Selecting Your Timeframe
In general, trends are more common on the 4-hour timeframe. The percentage of time where the ADX registered a trend was higher across all three lookback periods, and across all six markets.
Higher timeframes usually contain less noise and are more conducive for trend following. Noise is random price movement that distorts the underlying trend. It is caused by the countless financial transactions that occur for different agendas.
The Kaufman Efficiency Ratio is one good way to measure noise.
Trend trading on a higher timeframe is akin to taking a bird’s-eye view of the market, giving you a cleaner picture of the underlying trend. The downside is that you’ll have lower trading frequency and fewer trades in your backtest.
I often hear people saying the market trends 30% of the time. They’re probably referring to shorter-term trends on the higher timeframes.
The ADX indicator provides a convenient method to quantify a market’s historical tendency to trend.
In general, the JPY currency pairs, especially GBPJPY and EURJPY, are good candidates for trend following strategies.
In addition, higher timeframes filter out random noise and thus exhibit longer, smoother trends. In theory, the daily timeframe should be even more profitable for trend traders, compared to the 1 and 4-hour timeframes illustrated above. Unfortunately, even with data dating back to the early 2000s, it’s difficult to get a large sample of trades in your backtest.
Feel free to download the ADX algorithm above for your own research purposes. The ADX lookback period and threshold are customizable.
Thank you for the great contents. I feel sad when I see your Youtube Channel have little subscribers, but the self-proclaimed masters are highly subscribed. Your works are gold!
Hard work doesn’t sell. Playing to people’s fantasies is the best way to make money in the trading world. That’s why you see gurus boasting about their 90% win rates, and how they made 10K in 5 minutes.