Three Options to see ADX (ADX will not show, different scale than price)
1- You can see values of ADX, ADX+ and ADX- in Tradingview Data window which is located on the right hand side of under watchlist, alerts and news icons
2- Go to indicator settings, style and change color transparency for ADX, ADX+ and ADX- then move Y axis scale to show values from 0 to above.
3- Add the following indictor https://www.tradingview.com/script/VTPMMOrx-ADX-and-DI/
//@version=4
strategy("Donchain BO",shorttitle = "DBO",default_qty_type = strategy.percent_of_equity,default_qty_value = 100, overlay=true)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////=== ADX ===/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
len = input(14, "ADX Lenth", group="ADX")
TrueRange = max(max(high-low, abs(high-nz(close[1]))), abs(low-nz(close[1])))
DirectionalMovementPlus = high-nz(high[1]) > nz(low[1])-low ? max(high-nz(high[1]), 0): 0
DirectionalMovementMinus = nz(low[1])-low > high-nz(high[1]) ? max(nz(low[1])-low, 0): 0
SmoothedTrueRange = 0.0
SmoothedTrueRange := nz(SmoothedTrueRange[1]) - (nz(SmoothedTrueRange[1])/len) + TrueRange
SmoothedDirectionalMovementPlus = 0.0
SmoothedDirectionalMovementPlus := nz(SmoothedDirectionalMovementPlus[1]) - (nz(SmoothedDirectionalMovementPlus[1])/len) + DirectionalMovementPlus
SmoothedDirectionalMovementMinus = 0.0
SmoothedDirectionalMovementMinus := nz(SmoothedDirectionalMovementMinus[1]) - (nz(SmoothedDirectionalMovementMinus[1])/len) + DirectionalMovementMinus
DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100
DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
DX = abs(DIPlus-DIMinus) / (DIPlus+DIMinus)*100
ADX = sma(DX, len)
plot(DIPlus, color=color.new(color.blue,100), title="DI+")
plot(DIMinus, color=color.new(color.red,100), title="DI-")
plot(ADX, color=color.new(color.navy,100), title="ADX")
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////=== Donchain BO ===/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
length = input(20, minval=1, group="Donchain BO")
exit = input(1, minval=1, maxval=2,title = "Exit Option", group="Donchain BO") // Use Option 1 to exit using lower band; Use Option 2 to exit using basis line
lower = lowest(length)
upper = highest(length)
basis = avg(upper, lower)
l = plot(lower, color=color.blue, title="lower")
u = plot(upper, color=color.blue, title="upper")
plot(basis, color=color.orange, title="basis")
fill(u, l, color=color.blue, title="fill")
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////=== ADX Filter ===/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ADXfilter_OnOff = input(true, title = "Enable ADX Filter", group="Trades Filter")
ADX_Plus = input(28, minval=1, title="DIPlus", group="Trades Filter")
ADX_Minus = input(28, minval=1, title="DIMinus", group="Trades Filter")
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////=== Strategy ===/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
longCondition = crossover(close,upper[1]) and (DIPlus > ADX_Plus or ADXfilter_OnOff == false)
shortCondition = crossunder(close,lower[1]) and (DIMinus > ADX_Minus or ADXfilter_OnOff == false)
if (longCondition)
strategy.entry("Long", strategy.long)
if(exit==1)
if (crossunder(close,lower[1]))
strategy.close("Long")
if(exit==2)
if (crossunder(close,basis[1]))
strategy.close("Long")
if (shortCondition)
strategy.entry("Short", strategy.short)
if(exit==1)
if (crossover(close,upper[1]))
strategy.close("Short")
if(exit==2)
if (crossover(close,basis[1]))
strategy.close("Short")