If you’re interested in defining the market condition, the directional movement system should be at the forefront of your mind.
It’s a technical indicator that consists of three lines when plotted on a graph:
- The positive directional indicator (+DI)
- The negative directional indicator (–DI)
- The average directional movement index (ADX)
When +DI is above –DI, a long position is preferred, because the upward directional movement is higher and vice versa. The ADX is used to indicate if the market is trending or ranging.
While the idea is simple, the calculation is more difficult to understand.
In this guide, we’re going to explain the directional movement system indicator step by step. Then, we’re going to build it from scratch using Excel and discuss each step in detail. Below, you can see how the content is structured:
- What is Directional Movement?
- How to Calculate Directional Movement
- The Directional Indicators Explained (+DI and –DI)
- Calculating the Directional Movement Index
- Calculating the Average Directional Movement Index (ADX)
- Calculating the Directional Movement System in Excel (Complete Walkthrough)
- How to Trade with the Directional Movement System
- What is the ADXR?
What Is Directional Movement?
Directional movement is a clever way to quantify the most recent price movement.
It refers to the largest part of today’s range that is outside of yesterday’s range. This is the basic increment.
In other words, the directional movement measures the capacity of buyers and sellers to move prices outside of the previous day’s range.Let’s take a closer look.
How to Calculate Directional Movement?
You must identify the largest part of today’s candle that lies outside of yesterday’s candle and that’s going to be your DM for the day. If the largest part of today’s candle is above yesterday’s candle, the DM is plus. If it’s below yesterday’s candle, the DM is minus. When today’s candle is within the range of yesterday’s candle, the DM is 0.
While this might be confusing at first, calculating the directional movement is a fairly simply procedure.
Let’s investigate the 4 possible scenarios that can happen between two days, so that you can better see how this works out in reality.
Note that you don’t have to do this manually – we’re going to make an Excel formula that does the job. This is just for illustration.
Scenario 1: The movement is clearly UP
The first scenario is when there’s an obvious upside price move.
In this case, you can calculate the directional movement by subtracting yesterday’s high price from today’s high price. This will be a positive directional movement or +DM.
Scenario 2: The movement is clearly DOWN
The second scenario is when the price moves to the downside.
In this case, you can calculate the directional movement by subtracting today’s low price from yesterday’s low price. This is a negative directional movement or –DM.
Note that “minus DM” is used to describe a downward movement, but it’s not a negative number. This is important to keep in mind throughout subsequent calculations.
Scenario 3: Outside day
An outside day pattern occurs when the current day’s candlestick has a higher high and a lower low than the previous candle, and the open and close of today’s candle lies outside the open and/or close of yesterday’s candle.
Obviously, directional movement can’t be both up and down. In this case, both +DM and -DM is calculated and the larger of the two is taken as directional movement for the day.
Scenario 4: Inside day
If there’s an outside day, it’s just natural that there is also an inside day. The inside day forms when the range of today’s candle is completely inside the previous day’s range. Simply put: It’s the opposite of the outside day – as you’d expect.
In this case, no directional movement takes place. In other words, the directional movement is zero.
So, this is how to calculate directional movement. Here’s a quick summary:
The Directional Indicators Explained (+DI and –DI)
Now that you know how to calculate the directional movement – both positive and negative – it’s time to move forward. The next step is to express the directional movement relative to range. This is what Wilder calls ‘the directional indicator’.
In case you’re wondering, the range is the same true range concept that is featured across different areas, for instance, in the construction of the ATR indicator.
In a nutshell, the true range is the largest of the following three price ranges:
- The distance between today’s high and today’s low.
- The distance between today’s high and yesterday’s close, or
- The distance between today’s low and yesterday’s close.
The true range must always be a positive number, so make sure you always consider the absolute values.
We don’t have time to go deeper into this, but macroption does a great job explaining the true range here.
To construct the directional indicator, which is simply an improved version of the directional movement, you need to divide the directional movement by the true range.
- +DI = +DM / TR
- –DI = –DM / TR
This gives the directional indicator for one day.
If the day were an up day, the +DI equation is applicable; which is the positive directional indicator. Conversely, if the day were a down day, the –DI equation is applicable, which is the negative directional indicator.
In both cases, the values are expressed in a percentage, so the final formula can be written as:
The percentage number you get implies what percentage of the True Range for the previous day was up or down.
Directional Indicator for Multiple Days
Now, of course, the directional indicator is expressed over a longer time horizon. The default is 14 days and to obtain the indicator for the first time, you must do the following:
- Summarize the true range values for the past 14 days. –> TR(14)
- Summarize the positive DMs for the past 14 days. –> +DM(14)
- Summarize the negative DMs for the past 14 days. –> –DM(14)
- Follow the previously described equation with the summarized values.
It’s as simple as that.
Once you have the first values, you must use the previous day’s data and an accumulation technique to determine the +DM and –DM for the current and subsequent days.
In other words, there’s no need to keep up with 14 day’s historical data, which is pretty great.
To calculate the new +DM(14):
Recall that DM(14) denotes all positive directional movement summarized for the past 14 days. The above formula simply subtracts the average value from this summary and adds today’s value instead. This has a smoothing effect on the indicator that protects it from erratic movements. If there’s no positive directional movement for today, nothing is added back.
The procedure is the same for the new –DM(14) and also for the new TR(14):
The formula for the directional indicator is the same, you just plug in the new values.
Calculating the Directional Movement Index
At the beginning of this article, we said that the basic increment of directional movement is the largest part of today’s range that is outside yesterday’s range.
While this is true, we’re dealing with 14 days data, so let’s extend this definition to be more useful.
According to Wilder: “The true directional movement is the difference between +DI(14) and –DI(14)”
Think about it:
Whenever the price is increasing significantly (we have a positive directional movement) we’re adding to +DI(14) and subtracting from –DI(14). Conversely, whenever the price is decreasing significantly (we have a negative directional movement) we’re adding to –DI(14) and subtracting from +DI(14).
The more directional the movement, the greater the difference will be between the two indicators. If the price were ranging, then the difference between +DI(14) and –DI(14) would be small, showing that no meaningful directional movement is taking place.
From this logic, you can also see that the sum of the +DI(14) and –DI(14) represents the total amount of the past 14 day’s ranges that moved directionally regardless if it is up or down.
The directional movement index (DX) is calculated by dividing the difference between +DI(14) and –DI(14) by the sum of +DI(14) and –DI(14). The result is multiplied by 100 so that the value is always between 0 and 100.
(Note that –DI is just a designation and not a negative number)
Naturally, the higher the directional movement index (DX), the more directional the price is and vice versa.
Calculating the Average Directional Movement Index (ADX)
The DX has some flows in terms of reacting to extreme price movements.
In order to smooth out the DX, an average value is used. This leads to the Average Directional Movement Index – a popular indicator that many traders use to quantify the strength of a trend.
To get the ADX, you must add together the directional movement indexes for 14 days and divide this total by 14.
This is the first ADX.
From this point, you’re no longer dealing with totals. Instead, you have average values. Therefore, in the subsequent calculations, you must use Wilder’s moving average equation to obtain the indicator.
This is how you calculate the ADX.You see, it’s quite simple, but there’s a lot that goes into having every element in place. In the following explanation, we’re going to show you how to build the directional movement system yourself. By going through the procedure, you’ll understand the theory better, and everything will make sense.
Calculating the Directional Movement System in Excel (Complete Walkthrough)
In his book, Wilder presented a pen and paper calculation of the directional movement system indicator.
We’re going to follow his guidelines, but we’re going to use Excel. In addition, instead of the Chicago Wheat, we’re going to calculate for the EUR/USD currency pair to keep it more relatable.
Here’s what the end result looks like:
As you can see, the calculation of the directional movement system is rather difficult, but don’t worry. By following our explanations, you’ll be able to understand and replicate everything on your own.
You can also enter your email address into the form below and we’ll e-mail you the finished spreadsheet.
Ready? Let’s get started.
Step 0: Prepare the Data You’re Going to Work With
Go to Yahoo finance and open the page for EUR/USD. Select the “Historical Data” tab and set the parameters to 5 years of daily data. Then click “Apply” and download the data.
Once you open the file, you’ll see something like this:
(You might have different numbers for Nov 18 because the day isn’t over at the time of writing this article.)
First of all, notice the alert message at the top. If you save the file in the current CSV format, the chances are that Excel will save the values in cells and drop the formulas. In other words, the numbers will be there, but you won’t remember how you calculated them. We’ve been there, and it’s not very not fun.
To avoid issues, save the file as XLSX.
Once you’re done with that, you can delete the “Open”, “Adj Close” and the “Volume” columns.
In case you’re wondering, the adjusted close is the closing price after adjustments for stock splits and dividends. However, for currency pairs it’s the same as the closing price. The open and volume is simply not needed for calculating the indicator.
(The latter is meaningless anyway, because there’s no central exchange that would record all the trading volume for currencies.)
Now the great thing about Yahoo’s historical data is that it’s free. Unfortunately, there’s a drawback too, sometimes you’ll find that it includes a valid date, but a series of fields containing null. This means that the data for whatever reason is missing, unknown, or not available.
This sucks, because it will break the calculations and you’ll get error messages everywhere below the null values.
The great thing is that it’s relatively easy to fix, because there are only a few null values per data set. In our 5-years’ worth of daily data, we only have three dates that have null values. Here’s one example:
With a CTRL+F “null” search you can check where do you have null values or if you have them in the first place. Then just head over to myfxbook and look up the missing days. It shouldn’t take more than 5 minutes to type in the missing details into your spreadsheet.
As a final touch, you might set the decimals to 4 points everywhere, so that the data sheet looks nice and tidy.
Now, we’re going to be adding in the needed columns one by one.
It’s going to be a lot of work; we’ll be adding 12 columns on top of the 4 columns we already have. These are going to be:
- TR(1): this is the true range for one day
- plus DM(1): positive directional movement for one day
- minus DM(1): negative directional movement for one day
- TR(14): true range for the past 14 days
- plus DM(14): positive directional movement for the past 14 days
- minus DM (14): negative directional movement for the past 14 days
- plus DI(14): positive directional indicator for the past 14 days
- minus DI(14): negative directional indicator for the past 14 days
- DI difference: The difference between plus DI(14) and minus DI(14)
- DI sum: The sum of plus DI(14) and minus DI(14)
- Directional Index: DI difference divided by the DI sum
- Average Directional Index: 14-day average of the directional index
Let’s start to work on it.
Step 1: Add the True Range (1) Column
This column contains the daily true range.
Recall that the true range is calculated as:
- The distance between today’s high and today’s low.
- The distance between today’s high and yesterday’s close, or
- The distance between today’s low and yesterday’s close.
Luckily, you don’t have to calculate it by hand. We can construct a simple Excel formula that calculates the true range using the built-in MAX() and ABS() functions.
The MAX() function is pretty self-explanatory. The ABS() function is used to return the absolute value of a number. While it’s impossible that today’s high minus today’s low is smaller than zero, the other two values can be negatives, so we must make sure we don’t end up with a negative TR.
Note that you must have two days to be able to calculate the TR, so the formula goes into the third cell.
Make sure to copy down the formula into the cells below. (No “$” signs are needed because every reference is relative.)
Step 2: Add the Positive Directional Movement (1) Column
Next, we must add the positive directional movement (+DM) for one day.
Note that if you try to enter “+DM” as column name, Excel gives you an error, because it expects a formula after a “+” sign. To overcome this, you must put a ‘ mark in front of the plus or simply call it positive DM.
Talking about the formula, it looks like this:
Now, if you remember:
- Positive directional movement: High today – high yesterday
- Negative directional movement: Low yesterday – Low today
With the described Excel formula, we calculate both the positive and negative DM.
If the +DM is larger than the –DM, the condition is TRUE. In this case, we check if the +DM is a positive number through a MAX() function. When there’s an inside day, we would have a negative value for the +DM, so the MAX function would return a 0. This is great, because no directional movement takes place during inside days. In any other case, the MAX() function would return the value for the +DM. If the condition is FALSE, we return a 0, because the day has a negative directional movement.
You can copy down the formula without any modifications.
Step 3: Add the Negative Directional Movement (1) Column
This is nearly identical to the previous step, but this time we focus on the –DM.
Step 4: Add the True Range (14) Column
This is the daily true ranges summarized for the past 14 days.
We have already calculated the necessary data, and now we just use the SUM() function to summarize the values in TR(1).
Before you copy this down, recall that there’s a smoothing technique involved.
In other words, we need to modify the formula a bit in the cell underneath and then only copy down the modified formula into the other cells.
Step 5: Add the +DM(14) Column
This is same as the previous step, but instead of summarizing the true ranges, we’re going to summarize the past 14 day’s directional movements. Then, we apply the smoothing technique and copy down the formula.
Step 6: Add the –DM(14) Column
The same as the previous two steps, just with the negative directional movement.
Step 7: Add the +DI(14) Column
This is the positive directional indicator for the past 14 days.
The calculation is easy, you must divide the current +DM(14) with the current TR(14). The result is then converted to a percentage number.
Step 8: Add the –DI(14) Column
This is the negative directional indicator for the past 14 days.
The calculation is similar to what you did previously, but this time you must divide the current –DM(14) by the current TR(14). Again, we need a percentage value, so don’t forget to multiply by 100.
Step 9: Add the DI(14) Difference Column
Here you simply take the difference between the positive and negative directional indicator and return the absolute value.
Step 10: Add the DI(14) Summary Column
This is as simple as it sounds. Just add together the positive and negative directional indicators.
Step 11: Add the Directional Movement Index (DX) Column
As we discussed, the formula for the directional movement index is:
This is the same as dividing the values in the “DI(14) DIFF” column by the values in the “DI(14) SUM” column and multiplying the result by 100.
Step 12: Add the Average Directional Movement Index (ADX) Column
The ADX is simply the 14-day average of DX.
Excel has a built-in AVERAGE() function that you can use to calculate the ADX for the first time.
The subsequent calculations are slightly different because now you have average values. According to Wilder’s moving average equation, you must multiply yesterday’s ADX by 13, add today’s DX and then divide the total by 14.
Copy down this formula and you have finished calculating the directional movement system in Excel.
Step 13: Visualize the indicator (Optional)
As a final step, you might want to plot the directional movement system indicator on to an Excel graph.
This means you will have three lines:
- the ADX
- the +DI
- the –DI
Let’s do the ADX first.
First, you must highlight a suitable data range in the ADX column. For example, we’ll go from May/13/2020 all the way through the last data point. Then just click “Insert” and choose a line chart.
Let’s fix the dates quickly. Go to “Select data” and make sure the horizontal axis label is set to the same range as the ADX, but in the “Date” column.
Now you have the standalone ADX indicator.
Let’s continue with putting the +DI on the chart.
Go back to the data selection window and add a new series. For the Y values, select the same data range again, but for the “+DI(14)” column.
Once you are done, click ‘OK’ and repeat the procedure for the –DI.
That’s it! This is how to make the directional movement system in Excel. The ADX is the blue line, the green is the plus DI and the red is the minus DI.
If you compare your indicator with TradingView, you’ll find that it looks nearly identical.
It’s probably not going to be exact same values, because different brokers can have slightly different prices. Also, it’s possible that other calculations may do the smoothing a bit differently.
Differences can also occur if you don’t have enough data, as it takes about 150 periods to absorb the smoothing techniques. For example, values using only 30 periods of historical data will not match ADX values using 150 periods of historical data.Overall, if your indicator looks similar to those you find on trading platforms, you probably did everything correctly.
How to Trade with the Directional Movement System
In essence, the directional movement system is a trend-following indicator. The directional indicators help identifying the trend while the ADX is used to measure the strength of the trend.
Let’s break it down.
If you remember, the directional indicators are based on directional movement which refers to the capacity of buyers and sellers to move prices outside of the previous day’s range.
When the positive directional indicator (+DI) crosses above the negative directional indicator (–DI), it shows that buyers are stronger than sellers.
This is a LONG signal.
Conversely, when the when –DI crosses above +DI, it shows that sellers are stronger than buyers.
This is a SHORT signal.
Unfortunately, the lines will be criss-crossing when the market is ranging. This is where the ADX is useful; it helps to isolate ranging markets and capture strong trends instead.
This is because the ADX rises when the spread between the two directional lines increases. This shows that the market leaders are getting stronger, whilst the other party is losing ground.
The following table is from Investopedia and it shows the implications of different ADX readings:
You usually don’t want to take signals for trend trading when the ADX is below 25. Also, when the ADX is at the higher end of the spectrum, you should be careful, as there might be a higher likelihood of a reversal.
What is the ADXR?
The ADX rating, or ADXR is the smoothed version of the ADX. It’s sometimes added to the directional movement system as an optional fourth line or instead of the ADX. It also reflects the directional movement, but the fluctuations are minimized.
The calculation of the ADXR is simple. You must add together today’s ADX and the ADX 14 days ago and divide the result by two.
You can see the difference by plotting the ADXR using the spreadsheet we worked on through this guide.
Conclusion
Sometimes what you really need to do in order to understand a technical indicator is to calculate it in Excel.
The directional movement system is a great example.
While constructing the indicator is difficult, the implications are rather simple. The great thing about the Directional Movement System is that
it not only identifies if the market is trending, but it also indicates the strength of the trend.
This makes it a valuable tool for everybody who wants a more objective way of defining and rating trends.