TradingView
MA_PT
30 мая 2021 г., 20:41

OBV High / LOW (On-Balance Volume ) 

Tesla, Inc.NASDAQ

Описание

This is a simple application of OBV indicator (On-Balance Volume ), to visually determine when a given stock current obv is near the highest or lowest based on the number of lookback bars.

Indicator examples:

### OBV value is near an all-time high ##
  • breakthrough, stock value could set new all-time highs.
  • rejection, stock value could come down or consolidate.


Example



Inputs

  • OBV High Lookback -> numbers of bars to look back for the obv high.
  • OBV LowLookback -> numbers of bars to look back for the obv low.
  • OBV EMA Length -> Ema length


Notes:
  • This script also comes with an ema indicator based on obv for smoothing the obv signal since it gets noise at lower timeframes (by default comes disabled)



OBV information
https://www.investopedia.com/terms/o/onbalancevolume.asp


Comments:
This is my first script any ideas, suggestions, or detected errors (language/script) don´t hesitate to send a message.


Best regards, Mauro.

Информация о релизе

Minor fix : Change OBV plot color from white to yellow to fix white theme problem
Комментарии
Yangxin28
Thank you for your selfless sharing!
MA_PT
@Yangxin28, Thank you for your comment and support
Rumster30
This is awesome is exactly what I'm looking for! One thing I noticed though - when I add the indicator, It's added into a different pane than the OBV standard indicator is, and all that is shown is the upper blue and lower red line. So I'm not able to see the actual OBV line in the same pane - am I doing something wrong?
MA_PT
@significantSta59594, If I'm understanding your question correctly. The script comes with the "built-in" OBV (by default is the white line ), therefore you don't need to add the built-in obv to the new pane.
Hopes this helps with your question.

Note: Tradingview only allows currently the option "overlay" (false/true ) meaning it either creates a new pane or overlays the stock pane, but you can still move scripts around by dragging scripts in the object tree tab.
Rumster30
@MA_PT, This worked out perfectly actually - just changed the color of OBV to black (duh) - it was white so I couldn't see it - thanks for your time and help! DOn't want to be a pest - is it possible to make another one that draws a line based on the previous all-time high/low? Just to see how the current obv is breaking through the all time-high? How did you learn how to do this? This is fantastic work!
MA_PT
@significantSta59594, I usually use a dark theme didn't realize that wouldn't work plotting a white line on a white theme (my bad).
Regarding the second question, not sure if I'm understanding correctly but you're looking to plot lines on all-time (high/low) in the price (bar chart) or the obv chart?
Rumster30
@MA_PT, thanks so much for the quick reply. So it would be an all time high/low on the obv. So those blue and red lines that are created by prior highs (with a back-looking time limit -e.g - 50 bars or 100 bars). Instead there would be no time limit. Does that make sense?
Rumster30
@MA_PT, ANother great thing would be to have historical lines of support/resistance plotted on the OBV. If the price hits an all-time high and the OBV hits a historical point of resistance/support, that's a sign of a reversal is coming. Having both of those things on the same indicator would be KILLER! Wish I knew how to do this like you!! Fantastic work!!
MA_PT
@significantSta59594, That's quite an interesting idea, was not considering at the beginning look so far bar, but looking at some charts indeed there seems to be some pullback on historical all-time high (>1 year).
One example that I looked, was AAPL (Daily), it hit a price high and pulled back (around September 2020) when It hit a historical OBV high as far back as March 2015.
I´m thinking about upgrading this script to account for Historical highs and the Number of "touches" followed by a pullback.
Rumster30
@MA_PT, AWESOME!!!!
Ещё