The Williams Accumulation Distribution (WilliamsAccumDistr) is a technical analysis indicator used to determine the buying and selling pressure in the market. It helps in identifying divergences which can signal potential reversal points in the price of a stock or other financial instrument.
WilliamsAccumDistr(price)
i1 = WilliamsAccumDistr(close)
bullish = 0
bearish = 0
IF(i1 > 0) THEN
bullish = bullish + 1
bearish = bearish - 1
ELSIF(i1 < 0) THEN
bullish = bullish - 1
bearish = bearish + 1
ENDIF
RETURN bullish, bearish
This example calculates the Williams Accumulation Distribution value based on the close prices. Depending on the indicator's value, it increments or decrements counters for bullish and bearish signals, which could be used to make trading decisions.
The Williams Accumulation Distribution indicator is particularly useful for spotting divergences. A bullish divergence occurs when the price records lower lows while the indicator forms higher lows, suggesting a potential upward reversal. Conversely, a bearish divergence happens when the price makes higher highs while the indicator makes lower highs, indicating a potential downward reversal. These divergences can be key signals for traders regarding potential changes in market trends.