Strategy tester skips some trades???

 

Hello everyone,


I have created a simple MA crossover EA. When I run it from 26.02.2018. until 28.02.2018. it shows 3 trades only:

But it has more crossovers (see the red arrow):


If I run it from 27.02.2018. until 28.02.2018., it makes the trade which he missed when I tested from 26.02.2018.:


Why is that? Here is my code:

void OnTick()
  {
   double FastMA = iMA(NULL, 0, FastMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
   double SlowMA = iMA(NULL, 0, SlowMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
   double LastFastMA = iMA(NULL, 0, FastMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
   double LastSlowMA = iMA(NULL, 0, SlowMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
   
    if(LastSlowMA > LastFastMA && FastMA >= SlowMA)
    {
      TicketNo = OrderSend(Symbol(), OP_BUY, Lots, Ask, 0, Bid-StopLoss*Point*10, Bid+TakeProfit*Point*10);
    }
    
    if(LastFastMA > LastSlowMA && SlowMA >= FastMA)
    {
   
      TicketNo = OrderSend(Symbol(), OP_SELL, Lots, Bid, 0, Ask+StopLoss*Point*10, Ask-TakeProfit*Point*10);
    }
  }
Reason: