title: Plot shape once two conditions are met but don't repaint until it is met after 100 bars
body: <p>I want to plot a shape once two separate conditions are met and not replot again until the condition is met again 100 bars later. So far i've been playing around with the following;</p>
  <pre><code>    var bool bull1=na, bool bull2=na, var a_thisBar=1, var a_barCount=bar_index-a_thisBar, var b_thisBar=1, var b_barCount=bar_index-b_thisBar
  
      a4K:=sma(stoch(close,high,low,8),3)
      a5K:=sma(stoch(close,high,low,32),12)
  
      if a5K&gt;50
           bull1:=true,a_thisBar:=bar_index
      if bull1 and a_barCount&lt;25 and crossover(a4K,a4D)
           bull2:=true,bull1:=false
  
     plotshape(bull2,style=shape.arrowup,location=location.belowbar,color=color.blue,size=size.small)
  </code></pre>
  <p>Atm this is working fine but, understandably, it is plotting a shape every time the two conditions are met. What I would like it to do is plot it on the first instance and then not plot it again until the two conditions are met at least 100 bars after the first instance.</p>
  <p>I have tried playing with variations of the following with no success;</p>
  <pre><code>    if a5K&gt;50
          bull1:=true,a_thisBar:=bar_index
      if bull1 and a_barCount&lt;25 and crossover(a4K,a4D) and b_barCount&gt;100
          bull2:=true,bull1:=false,b_thisBar:=bar_index
  </code></pre>