This library comes with everything you need to add an On Balance Volume (OBV) filter to your strategy.
getOnBalanceVolumeFilter(source, maType, fastMaLength, fastMaLength) Get the fast and slow moving average for on balance volume Parameters: source: hook this up to an 'input.source' input maType: Choose from EMA, SMA, RMA, or WMA fastMaLength: int smoothing length for fast moving average fastMaLength: int smoothing length for fast moving average int smoothing length for slow moving average Returns: Tuple with fast obv moving average and slow obv moving average
Add this to your strategy ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾ ▾
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.