title: how to make just first crossing when another condition executed
body: <p>I need to write this indicator :
  MFI be under 20 and then cross over 20 ( it is main condition)
  the buy signals appears when first cross up of RSI to rsiMA</p>
  <p>I write this code :</p>
  <pre><code>    var sessionStart = false
  if ta.crossover(mf,20)
      sessionStart := true
  var rsicross = false
  if rsi &lt; rsiMA or rsi &gt; rsiMA or ta.crossunder(rsi,rsiMA) 
      rsicross := false
  if ta.crossover(rsi,rsiMA)
      rsicross := true
  //====
  buyCondition = sessionStart and rsicross
  </code></pre>
  <p>the problem that : all the rsi rsiMA crosses give buy signals because the main condition MFI crossed 20 before.
  I need after MFI cross up 20 , just first rsi , rsiMA crossing give buy signals.
  can someone help me please</p>
  <p>thank you</p>