Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.
Calculation
If today’s close is greater than yesterday’s close then:
OBV(i) = OBV(i-1)+VOLUME(i)
Capture price channel breakouts with the Price Channel Expert Advisor. Precise entries and exits. Explore now.
If today’s close is less than yesterday’s close then:
OBV(i) = OBV(i-1)-VOLUME(i)
If today’s close is equal to yesterday’s close then:
OBV(i) = OBV(i-1)
where:
- OBV(i) — is the indicator value of the current period;
- OBV(i-1) — is the indicator value of the previous period;
- VOLUME(i) — is the volume of the current bar.

Full description of OBV is available in the Technical analysis: On Balance Volume
Build better strategies with RobotFX professional tools – check them out.
7997