MA_PT

OBV High / LOW (On-Balance Volume )

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.

Catatan Rilis: Minor fix : Change OBV plot color from white to yellow to fix white theme problem
Skrip open-source

Sejalan dengan semangat TradingView, penulis skrip ini telah mempublikasikannya secara open-source, sehingga para trader dapat memahami dan memverifikasinya. Salut untuk sang penulis! Anda dapat menggunakannya secara gratis, tetapi penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk dapat menggunakannya didalam sebuah chart.

Inggin menggunakan skrip ini pada chart?

Komentar

@MA_PT

One needs to know what they're looking for with this script. For me, this script can do what scripts with 100s of lines of code couldn't.

Thank you - God bless you, brother!
+1 Jawab
MA_PT kpiyush114
@kpiyush114, Thank you for the feedback, I will start adding "how to use" moving forward for better understanding.
Regarding the lines of code, sometimes is all about finding the right tool instead of reinventing the "wheel". :D
Jawab
@MA_PT,

Can't agree more!
Jawab
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?
Jawab
MA_PT Rumster30
@Rumster30, 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.
Jawab
@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!
Jawab
MA_PT Rumster30
@Rumster30, 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?
Jawab
@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?
Jawab
@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!!
Jawab
MA_PT Rumster30
@Rumster30, 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.
+1 Jawab