0
//@version=2
study(title="EMA & MA Crossover", shorttitle="EMA & MA Crossover", overlay = true)

LengthMA = input(50, minval=1)
LengthEMA = input(200,minval=1)

xMA = ema(close, LengthMA)
xEMA = ema(close, LengthEMA)
pos = iff(xEMA < xMA , 1, iff(xEMA > xMA, -1, nz(pos[1], 0))) 
barcolor(pos == -1 ? red: pos == 1 ? green : blue)

plot(xMA, color=red, title="MA")
plot(xEMA, color=blue, title="EMA")

Conversion failed, reason: Source pine is incorrect. line 10: Undeclared identifier pos; line 11: Undeclared identifier pos

Please help me

I Hade tried too many time but not succeeded please help me

0 Answers0