title: I confuse convert Tradingview Strategy to study strategy.position_size and strategy.position_avg_price to study
body: <p>I try to convert Strategty to study I don't know it right?</p>
  <pre><code>if Long 
      strategy.entry(&quot;L&quot;, strategy.long)
  if Short
      strategy.entry(&quot;S&quot;, strategy.short)
  </code></pre>
  <p>I convert to this</p>
  <pre><code>alertcondition(Long,&quot;Long&quot;,&quot;Take Long position&quot;)    
  alertcondition(Short,&quot;Short&quot;,&quot;Take Short position&quot;)
  plotshape(Long, text = &quot;Long&quot;,color=color.green)
  plotshape(Short, text = &quot;Short&quot;,color=color.red)   
  
  //I think it is wrong because pyramiding=1  
  </code></pre>
  <p>And die on this line too</p>
  <pre><code>per(pcnt) =&gt;
      strategy.position_size != 0 ? round(pcnt / 100 * strategy.position_avg_price / syminfo.mintick) : float(na)
  stoploss=input(title=&quot; stop loss&quot;, defval=9, minval=0.01)
  los = per(stoploss)
  q=input(title=&quot; qty percent&quot;, defval=100, minval=1)
  
  tp=input(title=&quot; Take profit&quot;, defval=1.3, minval=0.01)
  
  strategy.exit(&quot;tp&quot;, qty_percent = q, profit = per(tp), loss = los)
  </code></pre>
  <p>I don't know how to convert please tell me.</p>