title: pinescript - plot cross when EMA crosses over SMA while above/ below 200 moving average
body: <p>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.</p>
  
  <p>I have this much code but I don't know how to proceed further:</p>
  
  <pre><code>//@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 &lt; s50ema and s50ema &lt; s21ema and s21ema &lt; s10ema
  EMACross = cross(s10ema, s21ema) ? s10ema : na, style = cross, linewidth = 4, color = yellow, transp=0
  
  plot(?????)
  </code></pre>
  
  <p>Any help would be greatly appreciated</p>