No errors but buy/sell orders are not sending

 
No errors or warning when i compile the code but buy/sell orders are not sending when i backtest it. simple ema sma crossover. please help if you can, thank you.
double PreviousEMA = iMA(NULL,0,EMA,EMAShift,EMAMethod,EMAAppliedTo,2);
double CurrentEMA = iMA(NULL,0,EMA,EMAShift,EMAMethod,EMAAppliedTo,1);
double PreviousSMA = iMA(NULL,0,SMA,SMAShift,SMAMethod,SMAAppliedTo,2);
double CurrentSMA = iMA(NULL,0,SMA,SMAShift,SMAMethod,SMAAppliedTo,1);
if(PreviousEMA<PreviousSMA && CurrentEMA>CurrentSMA)
   if (OrdersTotal()==0)
      int ticket = OrderSend(Symbol(),1,LotSize,Ask,3,Ask-(StopLoss*pips),Ask+(TakeProfit*pips),NULL,0,0,Green);

if(PreviousEMA>PreviousSMA && CurrentEMA<CurrentSMA)
   if (OrdersTotal()==0)
      int ticket = OrderSend(Symbol(),2,LotSize,Ask,3,Bid+(StopLoss*pips),Bid-(TakeProfit*pips),NULL,0,0,Red);
 
What do you see, when you print the ticket nr?
 
daybyter:
What do you see, when you print the ticket nr?
what do you mean by print the ticket nr? i apologize as i am relatively new to coding especially with mql4  
 
Print("Ticket is: ",ticket);

Is it bigger than -1 ?


 
mlundin04:
what do you mean by print the ticket nr? i apologize as i am relatively new to coding especially with mql4  
you need to separately display the verification messages about the signal and the opening of the order, for example:
if(PreviousEMA<PreviousSMA && CurrentEMA>CurrentSMA) {
   Print("Signal to SELL");
   if (OrdersTotal()==0) {
      int ticket = OrderSend(Symbol(),OP_SELL,LotSize,Ask,3,Ask-(StopLoss*pips),Ask+(TakeProfit*pips),NULL,0,0,Green);
      if(ticket > 0) Print("Order SELL ticket=", ticket); else Print("Error to order SELL");
   }
}