[Possible Bug] OnPendingOrdersFilled
[Possible Bug] OnPendingOrdersFilled
11 Jul 2018, 04:23
Hi.
I think I found a bug. I used PlaceStopOrder and set TP and Target Price. When the event OnPendingOrdersFilled fires, the args.Position has INCORRECT values comparing with args.PendingOrders.
args.PendingOrders = Pending Order that was filled.
args.Position = Position that was filled from Pending Order.
That is a BUG? Take a look at the Print below. TakeProfit never would be different once I set on PlaceStopOrder before.
Replies
julioc1010
13 Jul 2018, 01:21
RE:
Hi Andrey,
Thank you for your advice. Using StopLimit solved my problem. Sorry for my mistake between StopOrder and StopLimit.
Regards,
Julio
Andrey Pisarev said:
Hi Julioc1010,
Pending order Take Profit is set in pips. And in your case, it is equal to 200 pips.
Probably order was executed at 0.9849 and Take Profit was placed at 0.9649 - 200 pips away from the entry price.
Please check if it is the case.
P.S.
If you don't want your order to be executed on gaps, away from target price, you can use StopLimit orders.Regards,
Andrey
@julioc1010
ap11
12 Jul 2018, 16:03
Hi Julioc1010,
Pending order Take Profit is set in pips. And in your case, it is equal to 200 pips.
Probably order was executed at 0.9849 and Take Profit was placed at 0.9649 - 200 pips away from the entry price.
Please check if it is the case.
P.S.
If you don't want your order to be executed on gaps, away from target price, you can use StopLimit orders.
Regards,
Andrey
@ap11