MQL4 - automated forex trading   /  

技术分析

技术分析  技术指标  趋势指标  威廉姆斯累积/派发指标

Analyze with the

威廉姆斯累积/派发指标 (Williams'A/D)

Williams' AD 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.

  • If the price reaches a new maximum, but the accumulation/distribution indicator cannot reach a new maximum, it means that the security is distributing itself. It is a signal for sell.

  • If the price reaches a new minimum, but the accumulation/distribution indicator cannot reach a new minimum, it means that the security is accumulating. It is a signal for buy.


Calculations:

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:

    CurA/D = CLOSE (i) - TRL (i)
  • If the current closing price is lower than the previous one, then:

    CurA/D = CLOSE (i) - TRH (i)
  • If current and previous closing prices coincide then:

    CurA/D = 0

Williams' accumulation/distribution indicator is a growing sum of these values for each day:

WA/D (i) = CurA/D + WA/D (i - 1)


Where:
TRH (i) — the True Range High;
TRL (i) — the True Range Low;
MIN — the minimum value;
MAX — the maximum value;
|| — the logical OR;
LOW (i) — the minimum price of the current bar;
HIGH (i) — the maximum price of the current bar;
CLOSE (i) — the closing price of the current bar;
CLOSE (i - 1) — the closing price of the previous bar;
CurА/D — means current value of accumulation/distribution;
WА/D (i) — the current value of William's Accumulation/Distribution indicator;
WА/D (i - 1) — the value of William's Accumulation/Distribution indicator on the previous bar.


源代码

完整的MQL4关于资金流量指数指标的代码在 威廉姆斯累积/派发指标 (Williams'A/D)


警告: 所有资料属MetaQuotes Software Corp版权所有. 所有资料或部分资料不得复制和转载.