//Created by Robert Nance on 072315 study(title="Moving Average Colored EMA/SMA", shorttitle="Colored EMA /SMA", overlay=true) emaplot = input (true, title="Show EMA on chart") len = input(8, minval=1, title="ema Length") src = close out = ema(src, len) up = out > out down = out < out mycolor = up ? green : down ? red : blue plot(out and emaplot ? out :na, title="EMA", color=mycolor, linewidth=3) smaplot = input (false, title="Show SMA on chart") len2 = input(8, minval=1, title="sma Length") src2 = close out2 = sma(src2, len2) up2 = out2 > out2 down2 = out2 < out2 mycolor2 = up2 ? green : down2 ? red : blue plot(out2 and smaplot ? out2 :na , title="SMA", color=mycolor2, linewidth=1)
I tried to put: Moving down 1.00, but it doesn't work, and it doesn't let me put -1 or 0.
Thanks a lot!
I'm trying to apply the idea to this HPotter's ADV Line indicator, but can't figure it out. Any chance you could help?
This is the code:
study(title="Advance/Decline Volume Line", shorttitle="ADV Line", overlay = false)
AdvSymbolVolume = input(title="Advancing Volume Symbol", type=symbol, defval="USI:UVOL")
DecSymbolVolume = input(title="Declining Volume Symbol", type=symbol, defval="USI:DVOL")
Resolutin = input(title="Resolution", type=resolution, defval="D")
xASVValue = security(AdvSymbolVolume, Resolutin, close)
xDSVValue = security(DecSymbolVolume, Resolutin, close)
NetADV = xASVValue - xDSVValue
nRes = nz(nRes, 0) + NetADV
plot(nRes, color=green, title="ADV Line", style=line)
Many thanks in advance.