I am very NEW to pinescript and I am stuck at this point... I would like to plot a cross ONLY when 10 EMA crosses over 21 EMA while 21 is above 50 EMA and 50 EMA is above 200 EMA. This is to indicate Long signal. And at the same time, when 10 EMA crosses over 21 EMA while 21 is below 50 EMA and 50 EMA is below 200 EMA. This is to indicate Short signal.
I have this much code but I don't know how to proceed further:
//@version=3
study(title="MA Cross ATTEMPT", overlay=true)
s10ema = ema(close, 10)
s21ema = ema(close, 21)
s50ema = ema(close, 50)
s200ema = ema(close, 200)
plot(s10ema, color = red, linewidth = 1, transp=0)
plot(s21ema, color = aqua, linewidth = 1, transp=0)
plot(s50ema, color = aqua, linewidth = 2, transp=0)
plot(s200ema, color = red, linewidth = 2, transp=0)
mycond = s200ema < s50ema and s50ema < s21ema and s21ema < s10ema
EMACross = cross(s10ema, s21ema) ? s10ema : na, style = cross, linewidth = 4, color = yellow, transp=0
plot(?????)
Any help would be greatly appreciated