Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATI StrategyPosition DLL Function Usage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ATI StrategyPosition DLL Function Usage

    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
    Last edited by whitmark; 09-25-2007, 03:30 PM.
    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    #2
    You have to wait once the entry is filled and then check for status on the strategy.

    You can not retrieve order id values of ATM strategy generated stop/target orders.
    RayNinjaTrader Customer Service

    Comment


      #3
      You have to wait once the entry is filled and then check for status on the strategy.
      Thanks Ray, I thought so too but as I show in the exhibit in the previous post, on tick #18 the entry order is confirmed to be filled (via the Filled function) but not until tick #20 does the StrategyPosition indicate that the position is long. So it seems like a delay is needed even after the entry order is filled. This example is using the Sim101 account . . . I'll have to see what the lag is on a live brokerage account. Thoughts?

      Regards,

      Whitmark
      whitmark
      NinjaTrader Ecosystem Vendor - Whitmark Development

      Comment


        #4
        Your experience is possible. Different brokerages can also have differnent experiences since there never a guarantee in which order order states and executions (which drive our position objects) come in from the broker.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        119 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        62 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        40 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        45 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        82 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X