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
| Slot | Available | Role |
|---|---|---|
| Entry Point | No | — |
| Entry Rule | Yes | Filters entries by the OBV direction. |
| Exit Point | No | — |
| Exit Rule | Yes | Triggers 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:
| Rule | Long signal is 1 when | Short signal is 1 when |
|---|---|---|
| OBV rises | OBV rose on the previous bar | OBV fell on the previous bar |
| OBV falls | OBV fell on the previous bar | OBV rose on the previous bar |
| OBV changes its direction upward | OBV formed a valley (down then up) | OBV formed a peak (up then down) |
| OBV changes its direction downward | OBV 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.