On Balance Volume

The OBV cumulates the volume of up bars and subtracts the volume of down bars to track the buying and selling pressure.

Role in the strategy

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

The On Balance Volume 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 OBV 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
OBV risesOBV rose on the previous barOBV fell on the previous bar
OBV fallsOBV fell on the previous barOBV rose on the previous bar
OBV changes its direction upwardOBV formed a valley (down then up)OBV formed a peak (up then down)
OBV changes its direction downwardOBV formed a peak (up then down)OBV formed a valley (down then up)

Parameters

None.

Calculation

tech.OBV in engine/indicator-engine/tech.ts computes the cumulative line: volume is added on up bars, subtracted on down bars, and unchanged on flat bars. 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.