Confirming whether an entry order has been filled is easy enough using the Filled(orderID) or OrderStatus(orderID) functions, where the orderID is obtained when the order is placed. However, determining whether a ATM-submitted Stop or Target exit order has been filled or that the ATM StrategyID is flat, is more difficult. As can be seen in the attached tick-by-tick log of orders placed on the ES continous contract, there is a small lag (albiet subsecond) between when the entry order is filled and when the StrategyPosition function recognizes a position is on (e.g., 1 or -1 vs 0). The challenge, of course, is that there is no way to directly and definitively query the DLL interface tick-by-tick to determine whether a once long or short position is now flat.
2007/09/25 16:32:40 #14591 T 16 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Working OrdFill: 0 FillPrice: 0.00 StratPos: 0
2007/09/25 16:32:40 #14591 T 17 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Working OrdFill: 0 FillPrice: 0.00 StratPos: 0
2007/09/25 16:32:40 #14591 T 18 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Filled OrdFill: 1 FillPrice: 1529.00 StratPos: 0
2007/09/25 16:32:40 #14591 T 19 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Filled OrdFill: 1 FillPrice: 1529.00 StratPos: 0
2007/09/25 16:32:40 #14591 T 20 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Filled OrdFill: 1 FillPrice: 1529.00 StratPos: 1
2007/09/25 16:32:50 #14592 T 1 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Filled OrdFill: 1 FillPrice: 1529.00 StratPos: 1
2007/09/25 16:32:50 #14592 T 2 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Filled OrdFill: 1 FillPrice: 1529.00 StratPos: 1
Regards,
Whitmark
Comment