title: PineScript: Plotshape when two conditions are met one after the other
body: <p>PineScript: Plotshape when two conditions are met one after the other</p>
  <p>I want the chart to be marked as soon as two conditions have occurred one after the other.</p>
  <p>For example, that plotshape is executed only when the Moving Average (5) has fallen below 20 and then risen above 20 again.</p>
  <p>So I want both conditions to be met in succession before plotshape is executed.</p>
  <p>How can I proceed with this?</p>
  <p>I initially tried it with this:</p>
  <pre><code>    C = 0
  
  if MA5 &lt; 20 
      if MA5 &gt; 25 
        C := C +1 
  
  plotshape(C == 1, ....)
  </code></pre>
  <p>It didn't work that way.</p>
  <p>Does anybody has an idea?</p>