Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATMStrategyClose and gap below stop

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

    ATMStrategyClose and gap below stop

    Using OnMarketData() it is possible to determine when the Bid/Ask have both breached a stop level. In very fast markets it is possible that they may move a long way before another tick triggers OnBarUpdate(). I have a strategy that uses ATMStrategyClose() in the OnMarketData() method if that happens.

    Using Interactive Brokers interface, can this result in a double execution by having the stop hit between the time the StrategyClose command executes and it is received in Trader Workstation? resulting in a stop order hit and the additional ATMStrategyClose Target order also executing. This could result in a virtual Market Position Reversal.

    #2
    Hello snaphook,

    Thank you for your post.

    To clarify on your inquiry, you are using AtmStrategyClose() in both OnBarUpdate() and OnMarketData() for the same ATM Strategy ID, is this correct?

    Comment


      #3
      It is only used in OnMarketData(), however, it will only trigger if BOTH Bid and Ask breach a stop level.

      Comment


        #4
        Hello snaphook,

        Thank you for your response.

        AtmStrategyClose() cancels any working orders and closes any open position of a strategy by first modifying any existing target orders so they are filled or submitting a market order if no target orders exist. AtmStrategyClose() means the specified ATMstrategy is found and the internal close routine was triggered.

        This should in no way trigger two close routines and should wait for the confirmation from the brokerage technology and not continue to submit close routines.

        For information on AtmStrategyClose() please visit the following link: http://www.ninjatrader.com/support/h...ategyclose.htm

        Please let me know if you have any questions.

        Comment


          #5
          Yes, I read that, however, if an existing STOP order exists, is it possible for it to be executed and, before it being reported to NT, have the ATMCloseStrategy() method also fire a market order if no target exists, resulting in a STOP execution and a Market order also being filled?

          Comment


            #6
            Hello snaphook,

            Thank you for your patience.

            In your specific example the AtmStrategyClose() would be ignored as an order to close was already in a state of being filled. In addition, the Strategy would be in a terminal position or closed and awaiting the confirmation from the broker, so to avoid an unwanted position NinjaTrader would ignore the second order.

            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by helpwanted, Today, 03:06 AM
            1 response
            7 views
            0 likes
            Last Post sarafuenonly123  
            Started by Brevo, Today, 01:45 AM
            0 responses
            7 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            5 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            242 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            385 views
            1 like
            Last Post Gavini
            by Gavini
             
            Working...
            X