Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy ATM "No Outstanding Orders" Check

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

    Strategy ATM "No Outstanding Orders" Check

    When running a tick-update NinjaScript strategy, what is the best way to suppress the placement of an ATM command submission until 1) the ATM market position is flat and 2) there are no active ATM-based orders. GetAtmStrategyMarketPosition() is part of the solution but there seems to be no straightforward way to ensure that there are no outstanding orders . . . keeping in mind that previously placed orders could be filled, cancelled, rejected, etc. An example would be appreciated. Thanks.

    Regards,

    Whitmark
    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    #2
    Unfortunately there is no guaranteed method to ensure that all orders internally generated from an initiated ATM strategy (stops and targets) reach a terminated status. The ATM strategy itself when flat/terminated takes care of cancelling any pending orders but there is a chance that you get inflight fills prior to the order actually reaching a cancelled state. This is not frequent but can happen.

    NT 6.5 provides full order state events for NinjaScript generated orders (not ATM) which can be monitored.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks Ray. If you don't mind, I have a few of follow-up questions.
      1. Under certain conditions, I can submit an AtmStrategyCancelEntryOrder() that will cancel the Entry order as well as the OCO targets and stops, but I suspect I would still be at risk for these inflight issues should I then try to place a new ATM command on the next tick? Is this correct?

      2. It seems to me that with the use of GetAtmStrategyStopTargetOrderStatus() and GetAtmStrategyEntryOrderStatus() methods it is possible to inspect the orderstate of the last OrderName / AtmStrategyID to determine if all orders have reached a terminal status (e.g., Filled, Cancelled, Rejected). Is this a reliable approach to avoid any inflight issues? Is it too processing intensive to consider for tick-by-tick operations?

      3. Will 6.5 include some convenience functionality for the common use-case to easily know when there are no outstanding orders vs having to inspect each entry, exit, and remaining partial fill order?


      Many thanks,

      Whitmark
      whitmark
      NinjaTrader Ecosystem Vendor - Whitmark Development

      Comment


        #4
        1. Correct.

        2. No way with an ATM strategy to detect inflight executions

        3. In NT 6.5 we will expand NinjaScript to provide official support for additional events such as order state, executions, position changes etc... This will allow an advanced programmer to code their own ATM like functionality with as much exception handling as they see fit.
        RayNinjaTrader Customer Service

        Comment


          #5
          Thanks Ray,

          Regarding #2, I agree there is "No way with an ATM strategy to detect inflight executions" per se. What I am specifically asking is if I am able to inspect all entry and exit orders associated with the last executed ATM command and determine each is of a terminal orderstate (e.g., filled, cancelled, or rejected) before submitting the next ATM order, is it likely I can minimize or even eliminate the risk of inflight executions?

          I apprecate where you are heading with 6.5 but could use a viable interim solution for ATM operations that allows interaction with the orders on the DOM without impacting the underlying strategy.

          Regards,

          Whitmark
          whitmark
          NinjaTrader Ecosystem Vendor - Whitmark Development

          Comment


            #6
            You can since ATM strategies could be terminated while 'pending cancel' stop/target orders are filled inflight. You can not query a terminated strategy's orders. This is a limitation.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            574 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X