whitmark
09-25-2007, 03:26 PM
I would like to identify the best practice for determining whether an ATI-submitted ATM strategy (with unique strategyID) is flat after previously being in a position.
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 15 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Working OrdFill: 0 FillPrice: 0.00 StratPos: 0
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
Is there any other tactic I can use in the calling code to know when my ATI-submitted ATM strategy is flat or do I just need to wait N ticks or N seconds once the entry is filled and before I query the StrategyPosition function? Perhaps there is a way to obtain the ATM stop and target order IDs and query their status directly? Thanks.
Regards,
Whitmark
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 15 Symbol: ES ##-## LastOrdID: 3CDE3865F97D40399C54A7132E23D136 OrdStatus: Working OrdFill: 0 FillPrice: 0.00 StratPos: 0
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
Is there any other tactic I can use in the calling code to know when my ATI-submitted ATM strategy is flat or do I just need to wait N ticks or N seconds once the entry is filled and before I query the StrategyPosition function? Perhaps there is a way to obtain the ATM stop and target order IDs and query their status directly? Thanks.
Regards,
Whitmark