EA bot not activating sell stop in time

 

Hi everyone,


So i've been working on this EA for some time. However today while testing it on a live chart I noticed an issue where my EA wouldn't activate the sell stop in time.

[Image 1]

Notice in image1 that the sellstop was roughly around 1.33060 however looking at [Image 2]

you'll notice that the deal was done at 1.32899 which was way off from the first one. 

How i have the trades being sent is shown below:


     double candlePrice = iOpen(_Symbol,PERIOD_M15,0);
         trade.SellStop(MyLotSize,(candlePrice-(10*_Point)),_Symbol,Bid+StopLoss*_Point,NULL,ORDER_TIME_SPECIFIED,time_exp,NULL);

where the candle price would be the opening price of the candle.


So im just wondering if anyone has ever encountered this issue and if so if they have any tips on to solve this. Or if anyone has any tips on debugging this issue? 

Thank you :) 

Files:
Image1.PNG  1553 kb
Image2.PNG  9 kb
Reason: