Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM Order(s) Cancel when Changing (Dragging) Stop

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

    ATM Order(s) Cancel when Changing (Dragging) Stop

    Hi.

    I've got an ATM strategy for a 2 position trade, each with a separate stop. One of the two has a Target1 and a Stop1 (a fixed target position if you will) and the second has no target, only to exit at it's Stop2 which will trail once the fixed target position hits its Target1. When that Position1 hits a certain point relative to its target, I will move its stop up or down manually for money management.

    If that fixed position happens to hit target while I am in the process of moving its stop (i have clicked it and am in the process of positioning it but have not clicked to place it at its new level), I will get an error regarding not being able to set the stop and the remaining positions Stop2 (that I was NOT modifying) then gets cancelled. This leaves me with that remaining position (since the first one hit target) with no target (by design) and no stop (because it got cancelled in the error sequence). I then have to set ATM to none and manually create an exit stop. Since it was manually created, it will also not trail as the ATM one would have if it did not get cancelled out by the software issue.

    Here is the log file entries for the sequence... Stop1 is the one that I had clicked and was in the process of changing when Target1 was filled.

    Seems like a bug to me. No reason I should have lost my Stop2.

    2022-03-03 06:48:39:523|1|32|Order='834869055/213725' Name='Target1' New state='Filled' Instrument='RTY 03-22' Action='Buy to cover' Limit price=2045.7 Stop price=0 Quantity=1 Type='Limit' Time in force=DAY Oco='617aec561038405f9ffc1938a44f7666' Filled=1 Fill price=2045.7 Error='No error' Native error=''
    2022-03-03 06:48:39:524|1|8|Execution='585126153984' Instrument='RTY 03-22' Account='213725' Exchange=Globex Price=2045.7 Quantity=1 Market position=Long Operation=Operation_Add Order='834869055' Time='3/3/2022 6:48 AM'
    2022-03-03 06:48:39:524|1|32|Order='834960824/213725' Name='Stop1' New state='Cancelled' Instrument='RTY 03-22' Action='Buy to cover' Limit price=0 Stop price=2050.1 Quantity=1 Type='Stop Market' Time in force=DAY Oco='617aec561038405f9ffc1938a44f7666' Filled=0 Fill price=0 Error='No error' Native error=''
    2022-03-03 06:48:39:536|1|32|Order='834960824/213725' Name='Stop1' New state='Rejected' Instrument='RTY 03-22' Action='Buy to cover' Limit price=0 Stop price=2050.1 Quantity=1 Type='Stop Market' Time in force=DAY Oco='617aec561038405f9ffc1938a44f7666' Filled=0 Fill price=0 Error='Order rejected' Native error='The order was in a state that cannot be modified'
    2022-03-03 06:48:39:538|0|32|213725, The order was in a state that cannot be modified affected Order: BuyToCover 1 StopMarket @ 2050.1
    2022-03-03 06:48:39:539|1|32|Order='834960824/213725' Name='Stop1' New state='Cancelled' Instrument='RTY 03-22' Action='Buy to cover' Limit price=0 Stop price=2050.1 Quantity=1 Type='Stop Market' Time in force=DAY Oco='617aec561038405f9ffc1938a44f7666' Filled=0 Fill price=0 Error='No error' Native error=''
    2022-03-03 06:48:39:563|1|32|Order='834869053/213725' Name='Stop2' New state='Cancel submitted' Instrument='RTY 03-22' Action='Buy to cover' Limit price=0 Stop price=2052.6 Quantity=1 Type='Stop Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2022-03-03 06:48:39:584|1|64|Instrument='RTY 03-22' Account='213725' Average price=2048.1 Quantity=1 Market position=Short Operation=Update
    2022-03-03 06:48:39:668|1|32|Order='834869053/213725' Name='Stop2' New state='Cancelled' Instrument='RTY 03-22' Action='Buy to cover' Limit price=0 Stop price=2052.6 Quantity=1 Type='Stop Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    Last edited by GrumpyDude; 03-03-2022, 10:33 AM.

    #2
    Hello GrumpyDude,

    Thank you for your note.

    This would be expected if Target 1 is filled while Stop 1 is in a state of being changed. As the cancel signal is sent while Stop 1 is already in a state of being changed, it cannot be changed again (cancel signal from Target 1 filling) until that first change is completed and results in a rejection from the exchange.

    When this happens all associated orders with the ATM are cancelled per the built in logic due to the rejected order:This is typically a rare occurrence and can happen if the signal of the change is not received yet from the exchange and the cancel signal is sent specially when moving order manually.

    To reduce the likelihood of this we recommend making sure no Auto Breakeven or Auto Tail moves are happening at the same time your Targets are filling.

    An example would be having a Profit Target of 4 ticks and also having a Breakeven Profit Trigger set at 4 ticks for the same Target in the ATM strategy.

    Spencer F.NinjaTrader Customer Service

    Comment


      #3
      I could see that for Stop1. But why would Stop2 get cancelled?

      Comment


        #4
        Hello GrumpyDude,

        The second stop is canceled due to the ATM Strategy logic described in the link I provided in my post above.

        Due to the first stop technically being rejected by the exchange all other associated orders for the ATM are then canceled.
        Spencer F.NinjaTrader Customer Service

        Comment


          #5
          As a follow up to this, I have been getting this same error ( "The order was in a state that cannot be modified" ) when an auto-trail kicks in at a profit level. It seems to happen when price moves quickly through the profit level point that triggers the first auto-trail step.

          The order gets this error and is then cancelled. I then have to go in and manually make a new stop and attach it to a trailing indicator and manually give it the adjustments I would have gotten at steps 2 & 3.

          Any thoughts?

          Comment


            #6
            Hello GrumpyDude,

            Thank you for your note.

            This would increase the chances of a rejected order and this message due to the connected Stop order being changed while the Target is being filled.

            An order cannot be canceled while it is in a state of being changed which results in a rejection and a cancelation of the ATM.

            If the cancel signal is sent while the Stop Loss is still being changed to a new price this will occur.

            To decrease that chances of this happening I would recommend adjusting your Stop Strategy to ensure the change to your Stop Loss do not occur when a Profit Target could potentially be filled.
            Spencer F.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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