Still on the topic moving averages, indices and oscillators, in this article we will present the ADX index and the DI.

The DI divides into DI + and DI-, which respectively measure the strength of the positive trend and the strength of the negative trend.

Operatively they can be used as the intersection of two averages, ie when the DI + crosses, from top to bottom, the DI-, is a down-trend signal. If instead the DI + crosses the DI- from the bottom upwards, this is an up-trend signal.

Care must be taken that as with simple averages this index is not very reactive.

The ADX index, instead, which is calculated starting from DI + and DI-, shows us the strength of the trend.
This is the real addition compared to the use of moving averages, as it tells us if the current trend (bearish or bullish) is really well defined, or if alternatively we are in a phase of lateralization where instead the prices move in Horizon.

With the use of simple averages, in fact, one could have a cross that would indicate a change in trend, while instead it could be in a horizontal phase at the end of which the trend resumes in the same direction. The ADX is therefore particularly useful to use in conjunction with moving averages.

Operationally, the ADX has the following interpretations:

• 0-25: Absent or weak trend;
• 25-50: Strong trend;
• 50-75: Very strong trend;
• 75-100: Extremely strong trend;

The input parameter of the ADX and DI is the period, and the recommended one is 14.

It is calculated as follows (source wikipedia):

The calculation of + DI and -DI requires the closing, maximum and minimum price of each period (typically daily). The algorithm for calculating the two terms includes:

• UpMove = Today’s maximum – Yesterday’s maximum
• DownMove = Minimum of yesterday – Today’s minimum

If UpMove> DownMove and UpMove> 0, then + DM = UpMove, otherwise + DM = 0;

if instead DownMove> UpMove and DownMove> 0, then -DM = DownMove, otherwise -DM = 0

After setting the number of periods for the calculation (Wilder originally used 14 days), + DI and -DI are:

• + DI = 100 times the exponential moving average of + DM divided by the average true range
• -DI = 100 times the exponential moving average of -DM divided by the average true range

The moving average is calculated on the number of selected periods. ” Average true range ” means an exponential moving average of true ranges .

The algorithm for the calculation of the ADX is:

• ADX = 100 times the exponential moving average of the absolute value of [(+ DI) – (-DI)] divided by [(+ DI) + (-DI)]

In image 1 we can see an example of ADX and DI on the BTC chart:

Image 1 : TradingView – ADX and DI on BTC – Timeframe 1D – November 2017 – April 2018

As we can see on March 4, 2018 there is a cross between DI- (in red) and DI + (in green) that would normally indicate a trend inversion (from the previous down to an up trend). However, the ADX (in black) was below 25k indicating a lateral phase of the market, in fact immediately after the trend has remained down.
With the use of medium suns we would not have noticed that we were in a lateralization phase.

# References:

1. Achille Fornasini, “Mercati finanziari: scelta e gestione di operazioni speculative – I metodi e i sistemi della moderna Analisi Tecnica a supporto delle decisioni operative”, 1th edizione del 1996, ETAS
2. Wikipedia

## Moving Avarages

Until now, to analyze the price trend, we have mainly talked about straight lines and figures that can be seen directly by looking at prices.

Additional instruments are oscillators, indicators and moving averages. These are tools that accept prices as input, but do not need to manually plot on the chart. Most need some input parameters that are used to calibrate their reactivity, also in relation to the timeframe used.

The first and simplest tool we will analyze is precisely the moving averages.

Moving averages can be used to filter price trends from noise (ie try to eliminate oscillations). The faster the moving average (ie the period on which it is calculated is shorter) and the more it tends to follow the trend in prices. By increasing the number of periods, instead, the short-term fluctuations are eliminated and the long-term price trend can be deduced.

A moving average calculated on too many periods of time, may cause you to lose important price changes on the spot.

Moving averages can also be used to generate operational signals of purchases or sales.
The operational signals that can be generated are the following:

• When the moving average is above the price chart, then the trend is rising;
• When the moving average is below the price chart, then the trend is going down;
• When the average is above the price chart is in doubt.

A technique often adopted is to use two averages together, in order to understand the type of trend, a faster or a slower one. At this point the operational signals are given by the crossing of the two averages:

• If the fast average rises above the slower one then it is a bullish signal;
• On the contrary, it is a bearish signal.

A possible use of intersections is with:

• 5 periods for the fast one
• 20 periods for the slow one

NB : generally speaking,  moving averages  are not very reactive to trend’s changes;

NB2: The averages are not able to recognize if you are in a lateral phase of the market, giving false signals, so they are often used with the ADX and DI indicators, which we will talk about later

In image 1 we can see an example of the application of two moving averages (20 in red and 5 periods in green) on the graph of the BTC with 1 day timeframe.

Image 1: TradingView Chart – Timeframe 1day – Example of moving averages over BTC

For example, we can see that in the last period of time the moving average in red is above the green one, which indicates that the trend is bearish. It can also be noted that i have two crossings, one (of the green that goes beyond the red one) in the uptrend phase, the other (of the red one that overcomes the green one) in the downtrend phase.

### References:

1. Gabriele Belletti, “Trading con gli oscillatori. Strategie e tecniche per il trading di precisione”, Hoepli