Why can not set TP SL correctly by MQL5

 

Hi all:

  I'm a new comer to MQL5.  When I want to write a simple EA with SL and TP , I can't set SL and TP correctly. I choose Standart library Ctrade.  The code is like following. The PrintRequest and PrintResult show I set TP and SL correctly. But when I use history tester , I found there is no SL/TP  set. So always only 1 trade invoked. Anyone can give a hand ?

 

 

      trade.Buy(0.1,NULL,sym.Ask(),sl,tp);

      trade.PrintRequest();

      trade.PrintResult();

      Print("Result = ",trade.RequestTP()," " ,trade.RequestSL());