1) Current Ask is 500. I'm putting in multiple buy prices. The first at 400 and the second at 300.
2) The first buy price is hit when it pulls back to 350. The price then moves up to its exit/target price.
3) Since the second buy price @ 300 (which was entered at the same time as the first buy) was never reached on the pullback, I now need to cancel that order.
1 & 2 are working fine. However, for whatever reason, I cannot get #3 to happen. In the:
protected override void OnOrderUpdate(IOrder order)
section, I'm putting in the following:
if (targetOrder1 == order) { Print(order.ToString()); if (order.OrderState == OrderState.Filled) CancelOrder(entryOrder2); }
Could someone tell me what is wrong with my methodology?
Thanks
Comment