title: PineScript RSI Conditional Statement not working
body: <p>I am trying to change long and short conditions based on RSI values but the below code is not working and the values are not initializing. The error says <strong>enterLong</strong> not found.</p>
  <p><strong>Code:</strong></p>
  <pre><code>rs1=rsi(close,14) &gt; 50
  
  rs2=rsi(close,14) &lt; 50
  
  if rs1
  
      enterLong = cshort  
      enterShort = clong 
  if rs2
  
      enterLong = clong 
      enterShort = cshort 
  </code></pre>
  <p>Can you help in assigning values based on RSI condition? Everything else is working just fine. If I just use the code with only one set of conditions without using <strong>if rs1</strong> and <strong>if rs2</strong>, the code works just fine but the drawback is that I can't backtest it then and we can use only one set of conditions (e.g only RSI&gt;50 condition)</p>