title: Pine script - strategy entry using heikin ashi but strategy tester uses the real price not ha bar open
body: <p>So the following code in Pine-script on TradingView uses the Heikin-Ashi candle-bar <code>open</code> price instead of the actual real open in the strategy tester panel.</p>
  
  <p><strong>Is there a way to get the strategy tester to use the real price?</strong></p>
  
  <p><a href="https://medium.com/@MattGosden/tradingview-bugs-1-heikin-ashi-candles-6c2b8707d8f4" rel="nofollow noreferrer">This link</a> explains the issue further.</p>
  
  <pre class="lang-js prettyprint-override"><code>//@version=2
  strategy("haup", overlay=true)
  
  cci20 = cci(close, 20)
  sma10 = sma(close, 10)
  source = close
  sourcea = open
  
  haclose = (open + high + low + close) / 4
  haopen = na(haopen[1]) ? (open + close) / 2 : (haopen[1] + haclose[1]) / 2
  
  fromYear = year &gt; 2016
  toYear = year &lt; 2019
  
  longCondition = haopen &lt; haclose
  if (longCondition and fromYear and toYear)
      strategy.entry("Long 1", strategy.long)
  
  closeCondition = haopen &gt; haclose
  if (closeCondition)
      strategy.close("Long 1")
  </code></pre>