Accumulation Distribution

AD measures the cumulative flow of money into and out of a financial instrument.

Role in the strategy

SlotAvailableRole
Entry PointNo—
Entry RuleYesFilters entries by the AD direction.
Exit PointNo—
Exit RuleYesTriggers exits by the AD direction.

The Accumulation Distribution produces conditions, not order prices. As an entry rule it is ANDed with the entry point and the other entry rules; as an exit rule it is ORed with the other exit rules. See Indicators for the slot semantics.

Logic rules

The AD has no level parameter; its rules use the direction of the line against the fixed 0 / 0 level pair:

RuleLong signal is 1 whenShort signal is 1 when
AD risesAD rose on the previous barAD fell on the previous bar
AD fallsAD fell on the previous barAD rose on the previous bar
AD changes its direction upwardAD formed a valley (down then up)AD formed a peak (up then down)
AD changes its direction downwardAD formed a peak (up then down)AD formed a valley (down then up)

Parameters

None.

Calculation

tech.AD in engine/indicator-engine/tech.ts computes the cumulative line: each bar adds or subtracts volume weighted by where the close sits inside the bar's range ((2 × Close − High − Low) / (High − Low)). The line is drawn in a separate chart pane. The indicator needs volume data.

Backtesting

  • The rule is evaluated on the previous (closed) bar with the standard dead zone (SIGMA = 0.000001).
  • The indicator contributes only long/short signal arrays — it never changes the entry or exit order price.
  • An entry happens only when the entry point allows the direction and every entry rule passes; an exit happens when the exit point is reached and any exit rule passes.