TradingView
kocurekc
Jul 13, 2020 4:58 AM

OBV - ADX and DI+/- 

SPDR S&P 500 ETF TRUSTArca

描述

This is the ADX and DI+/- indicator applied to OBV!

This really clearly shows up and down, but using VOLUME! Don't ignore it, there is too much information captured in the OBV.

If you just love the ADX/DI format, it is included in a checkbox.


Want some excellent background highlighting, turn in on in a checkbox.



Shout out to some inspirations
csw-dmi
unRekt-KISS-Addie

版本注释

Updated the script to Version 5, thanks to @Pratik_4Clover for the open source work.

版本注释

Updated Image
评论
Franacech
hi how are you? how can i use this? Thank you.
kocurekc
@Franacech, Thanks for the questions, there are several answers below that try to give some details.
sadies
excellent. success on first trade using this indicator. may you be blessed!
kocurekc
@sadies, Congrats, and thank you.
Pratik_4Clover
Since I had a look at this and happen to update it to v5 and solved couple of issues like transp argument; here is the code for anyone still using it. Enjoy!

//@version=5
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// ©Kocurek
//
// Shoutouts to @Siwan- and @Upland for the inspirations.
//
// Live a little, publish your scripts...be a John Elhers
//

indicator(title='obv-adx', shorttitle='ob-ad', format=format.price, precision=4)
len = input.int(22, minval=1, title='DI Length')
lensig = input.int(22, title='ADX Smoothing', minval=1, maxval=50)
showADX1 = input(title='ADX Line or Histogram', defval=false)
showADX2 = input(title='Background Highlighting', defval=false)

//================ADX=========================
up = ta.change(ta.obv)
down = -ta.change(ta.obv)
plusDM = na(up) ? na : up > down and up > 0 ? up : 0
minusDM = na(down) ? na : down > up and down > 0 ? down : 0
trur = ta.rma(ta.stdev(ta.obv, len), len)
plus = fixnan(100 * ta.ema(plusDM, len) / trur)
minus = fixnan(100 * ta.ema(minusDM, len) / trur)
sum = plus + minus
adx = 100 * ta.ema(math.abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

diDiff = plus - minus

//================Ploting True - ADX DMI=========================
plot(showADX1 ? plus : na, color=color.new(color.blue, 0), title='+DI')
plot(showADX1 ? minus : na, color=color.new(color.orange, 0), title='-DI')
plot(showADX1 ? adx : na, color=color.new(color.red, 0), title='ADX')

mygreen = plus >= 22 and minus <= 18 and adx >= 22
myred = minus >= 22 and adx >= 22 and plus <= 18

bgcolor(mygreen ? color.new(#00796b,(showADX2 ? 70 : 100)) : na, title='MyGreen')
bgcolor(myred ? color.new(#880e4f,(showADX2 ? 70 : 100)) : na, title='MyRed')

plotshape(ta.crossover(plus, minus) ? showADX1 ? (plus + minus) * 0.5 : na : na, location=location.absolute, style=shape.circle, color=color.new(color.green, 30), size=size.tiny, offset=0)
plotshape(ta.crossover(minus, plus) ? showADX1 ? (plus + minus) * 0.5 : na : na, location=location.absolute, style=shape.circle, color=color.new(color.red, 30), size=size.tiny, offset=0)

//================Ploting Flase - Histogram=========================
diColor = plus - minus > 0 ? diDiff > diDiff[1] ? #45f248 : #C6FBC7 : diDiff < diDiff[1] ? #ff7878 : #FCCFCF
plot(showADX1 ? na : diDiff + 50, style=plot.style_columns, color=color.new(diColor,47), histbase=50, title='DI Difference')

// Plots divergences
plotshape(mygreen ? showADX1 ? na : diDiff + 50 : na, location=location.top, style=shape.triangledown, color=color.new(color.red, 30), size=size.tiny, offset=0)
plotshape(myred ? showADX1 ? na : diDiff + 50 : na, location=location.bottom, style=shape.triangleup, color=color.new(color.green, 30), size=size.tiny, offset=0)
guaicotrader73
@kocurekc
hola, como puedo descargar y utilizar tu indicador OBV - ADX y DI +/- ? gracias
Gann-Mode
Excellent Contribution!! Thank you!!
zschonn
@kocurekc thanks mate for your invention. How OBV works here ? should I assume, it shows bullish when it reaches above the certain SMA level ?
kocurekc
@zschonn, I've always used it for volume confirmation. I've turn on the background highlighting, you can see the points in time which a better to make a move counter to the market. Volume (change in direction) will typically precede price for sustainable moves

Davechart
Really nice indicator ! Thanks you so much ! Is there a way to set an alert when the green/red arrows stop. I tried many combinations without success. Thanks again.
更多