Williams' A/D is the accumulated sum of positive "accumulational" and negative "distributional" price movements.
For example, if the current closing price is higher than the previous one, W/AD increases by the difference between the current closing price and the true minimum. If the current closing price is lower than the previous one, W/AD decreases by the difference between the current closing price and the true maximum.
The term "accumulation" denotes a market controlled by purchasers and the term "distribution" means that sellers control the market.
Divergences between the indicator and the price are a signals. Like most indicators, W/AD leads the tool price. In other words, when a divergence appears, the price changes its direction according to the indicator.
To calculate the accumulation/distribution indicator, first you have to find a "True Range High" (TRH) and "True Range Low" (TRL):
TRH (i) = MAX (HIGH (i) || CLOSE (i - 1))
TRL (i) = MIN (LOW (i) || CLOSE (i - 1))
Then you must find the current value of accumulation/distribution (CurA/D) by comparing today and yesterday's closing prices.
If the current closing price is higher than the previous one, then:
CurА/D = CLOSE (i) - ТRL (i)
If the current closing price is lower than the previous one, then:
CurА/D = CLOSE (i) - ТRH (i)
If current and previous closing prices coincide then:
CurА/D = 0
Williams' accumulation/distribution indicator is a growing sum of these values for each day:
WА/D (i) = CurА/D + WА/D (i - 1)
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/54
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.Average Directional Movement Index (ADX)
The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.