title: open close price difference in pine-script
body: <p>I am a newbie in pinescript.</p>
  <p>I am hoping for your kind help. I believe that it will be very easy for you to answer this But given that I am a newbie, I am struggling with it.</p>
  <p>Question:</p>
  <p>I am trying to backtest a strategy with following conditions on any forex script:</p>
  <ol>
  <li>If the pip difference between open and close is +30 (basically a green candle with body size 30), buy.</li>
  <li>If the pip difference between open and close is -30 (a red candle with body size 30), sell.</li>
  </ol>
  <p>I tried the following code, but there is no uptraingle or down triangle i see on the chart. It shows no error in compiling. I am confused where I am wrong.</p>
  <pre><code>//@version=4
  study(&quot;mystudy&quot;, overlay=true)
  
  differenceGreen = (close[1] - open[1]) &gt;= 30 //green bar with body size 30+
  plotshape(series=differenceGreen, location=location.belowbar, color=color.green, transp=0, style=shape.triangleup)
  
  differenceRed = (open[1]- close[1]) &gt;= 30  //red bar with body size 30+
  plotshape(series=differenceRed, location=location.abovebar, color=color.red, transp=0, style=shape.triangledown)
  </code></pre>