title: Buy/Sell signal until 5 bars condition Trigger
body: <p>I'm having trouble writing a script. My strategy is based on two conditions:</p>
  <p>1°- When CCI crosses over -110 or under 110 first condition is trigger.</p>
  <p>2°- The 2 SMA needs to cross at a range of 5 bars, after the first condition was triggered to a trigger a &quot;BUY&quot; or &quot;SELL&quot;</p>
  <p>I haven't programming experience, the little I learned was researching I'll be grateful if you can help me.</p>
  <pre><code>enter code here
  </code></pre>
  <p>/// BUY AND SELL RULES</p>
  <p>BS1 = ta.crossover(CCI,-110)
  SS1 = ta.crossunder(CCI, 110)</p>
  <p>BUY = ta.crossover(sslUp, sslDown) ///if ta.barssince(BS1,5)\\- //i don't know how to fit that last condition in the script</p>
  <p>SELL = ta.crossover(sslUp, sslDown) ///if ta.barssince(BS1,5)\\</p>
  <pre><code>enter code here
  </code></pre>