title: I'm Backtesting. Why TradingView Strategy Tester Doesn't Have Trades for My Strategy?
body: <p>I'm Backtesting. Why TradingView Strategy Tester Doesn't Have Trades for My Strategy ?</p>
  <pre><code>//@version=4
  strategy(&quot;Simple Long&quot;)
  
  Long1 = sma(close,150) &gt; sma(close,200)
  Long2 = sma(close,50) &gt; sma(close,150)
  Long3 = ema(close,21) &gt; sma(close,50)
  Long4 = close &gt; ema(close,21)
  
  OutTrade = strategy.position_size &lt;= 0
  TimePeriod = time &gt; timestamp(syminfo.timezone, 2010, 01, 01, 0, 0)
  
  if(Long1 and Long2 and Long3 and Long4 and OutTrade)
      StopLoss = strategy.position_avg_price * 0.95
      TakeProfit = strategy.position_avg_price * 1.2
      strategy.entry(&quot;Long&quot;, strategy.long, when=OutTrade)
      strategy.exit(&quot;Exit&quot;, &quot;Long&quot;, stop=StopLoss, limit=TakeProfit)
  </code></pre>
  <p>The Result Image is attached</p>
  <p><a href="https://i.stack.imgur.com/X4Lxl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X4Lxl.png" alt="enter image description here" /></a></p>