Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Unable to change order

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

    Unable to change order

    I am experimenting with using a trailing stop on my strategy. While in a position the strategy threw an error and closed down with the message "Cannot change order 'nnnnn' because current order values already match'. It appears that the strategy generated a change on the stop at the same price. I have seen this previously when moving profit target limits explicitly, but in this case my strategy took no programmatic action.

    1. Why does this minor mistake cause such a catastrophic consequence? It would make sense to simply reject the change order rather than close the position and terminate the entire strategy.
    2. What can I do to avoid this error since my strategy took no explicit action?


    #2
    Hello aworldnervelink.

    Thanks for your post.

    Strategies will disable when an order error is encountered. This is in an effort to prevent having the strategy getting left in an unwanted position when an order error is received. Orders submitted with Set methods also update based on the Calculate mode, and the order change to the same price may have occurred from this functionality. Testing with Trace Orders enabled can help to see where the orginal Change ORder came from.

    TraceOrders - https://ninjatrader.com/support/help...aceorders2.htm

    To prevent the strategy from being deactivated, you can set the strategy's RealtimeErrorHandling property to IgnoreAllErrors. With this property set, you can then trap the order error OnOrderUpdate if you would like to have the strategy attempt a different action. I have attached a demonstration script to demonstrate trapping another case of an unable to change order error.

    RealtimeErrorHandling - https://ninjatrader.com/support/help...orhandling.htm

    OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm

    We also have a feature request tracking interest to have NinjaTrader silently ignore these specific errors since the error itself may not be consequential. The ticket ID is SFT-3667 and I have added a vote on your behalf. This is an internal number, but for anyone else wishing to have their interest tracked, please let our support staff know that you would like a vote added for this request.

    Feature Request Disclaimer.

    We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

    When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm


    We look forward to assisting.
    Attached Files
    Last edited by NinjaTrader_Jim; 06-10-2020, 08:33 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      I tried RealtimeErrorHandling = StopCancelCloseIgnoreRejects and this did not work - my strategy still closed.

      Currently running with IgnoreAllErrors and this seems to be working. I was alerted by several warning dialogs with audio, but the strategy did not close and the trailing stop is moving.

      Comment


        #4
        Hello aworldnervelink,

        Thanks for the catch. This is correct that IgnoreAllErrors would need to be used to trap the Change Order fails. I've corrected my post.

        Let us know if there is anything else we can do to help.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hey Jim,

          Would you please add a vote for me on this ticket as well? I'm having the same issue, please see a portion of my log export below. Thank you!

          Code:
          8/16/2020 11:03:26 PM,Order,Order='1299102177/M####' Name='Trail stop' New state='Cancelled' Instrument='MES 09-20' Action='Sell' Limit price=0 Stop price=3358.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='356200999936' Filled=0 Fill price=0 Error='No error' Native error='',
          8/16/2020 11:03:26 PM,Order,Order='5ae438c18a8942398a36abf184f48c3c/Sim102' Name='Trail stop' New state='Accepted' Instrument='MES 09-20' Action='Sell' Limit price=0 Stop price=3359 Quantity=1 Type='Stop Market' Time in force=GTC Oco='6a5f3e70ff7b4a96ad1239f99c84d53e' Filled=0 Fill price=0 Error='No error' Native error='',
          8/16/2020 11:03:26 PM,Order,Order='1299102177/M####' Name='Trail stop' New state='Cancel submitted' Instrument='MES 09-20' Action='Sell' Limit price=0 Stop price=3358.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='356200999936' Filled=0 Fill price=0 Error='No error' Native error='',
          8/16/2020 11:03:26 PM,Default,Disabling NinjaScript strategy 'HLPBOptimized/156813872',
          [B]8/16/2020 11:03:26 PM,Order,M#### Cannot change order '1299102177' because current order values already match. affected Order: Sell 1 StopMarket @ 3358.75,[/B]
          8/16/2020 11:03:26 PM,Order,Order='1299102177/M####' Name='Trail stop' New state='Working' Instrument='MES 09-20' Action='Sell' Limit price=0 Stop price=3358.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='356200999936' Filled=0 Fill price=0 Error='Unable to change order' Native error='Cannot change order '1299102177' because current order values already match.',
          8/16/2020 11:03:26 PM,Default,Strategy 'HLPBOptimized/156813872' submitted an order that generated the following error 'Unable to change order'. Strategy has sent cancel requests attempted to close the position and terminated itself.,
          8/16/2020 11:03:26 PM,Order,Order='1299102177/M####' Name='Trail stop' New state='Accepted' Instrument='MES 09-20' Action='Sell' Limit price=0 Stop price=3358.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='356200999936' Filled=0 Fill price=0 Error='No error' Native error='',
          8/16/2020 11:03:26 PM,Order,Order='5ae438c18a8942398a36abf184f48c3c/Sim102' Name='Trail stop' New state='Change submitted' Instrument='MES 09-20' Action='Sell' Limit price=0 Stop price=3359 Quantity=1 Type='Stop Market' Time in force=GTC Oco='6a5f3e70ff7b4a96ad1239f99c84d53e' Filled=0 Fill price=0 Error='No error' Native error='',
          8/16/2020 11:03:26 PM,Order,Order='5ae438c18a8942398a36abf184f48c3c/Sim102' Name='Trail stop' New state='Accepted' Instrument='MES 09-20' Action='Sell' Limit price=0 Stop price=3358.75 Quantity=1 Type='Stop Market' Time in force=GTC Oco='6a5f3e70ff7b4a96ad1239f99c84d53e' Filled=0 Fill price=0 Error='No error' Native error='',

          Comment


            #6
            +1

            Please add my vote.

            Comment


              #7
              Thanks for the feedback bltdavid and pdennis.

              Votes added.
              JimNinjaTrader Customer Service

              Comment


                #8
                Same issue here. +1 vote please

                Comment


                  #9
                  Hello mase2005,

                  Your vote has been added.
                  JimNinjaTrader Customer Service

                  Comment


                    #10
                    Add my vote too please.


                    2021-01-26 16:14:13:148|1|32|Order='***' Name='ES ON SHORT LIMIT MICRO' New state='Rejected' Instrument='MES 03-21' Action='Sell short' Limit price=3851.5 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=2 Fill price=3851.5 Error='Order rejected' Native error='Cannot modify a filled order.'
                    Last edited by NinjaTrader_Jim; 01-29-2021, 08:48 AM.

                    Comment


                      #11
                      Hello eliiot5,

                      The change request mentioned here is specific to ignoring orders that are unable to change an order because the price values match, your case involving an inability to modify an order because it is filled. I have added your vote, but please also consider the following:

                      An error where an order cannot be modified because it is filled may have different circumstances than an order error where the price was attempted to be moved to the same level. If someone was trying to loosen their stop and target, and they see this error, they may want to react to that error. Using RealtimeErrorHandling would be the way to go to keep the strategy alive or react to that error.

                      We look forward to assisting.
                      JimNinjaTrader Customer Service

                      Comment


                        #12
                        Please could you add my vote as well.

                        Many thanks.

                        Comment


                          #13
                          add my vote as well.

                          Comment


                            #14
                            Thanks for the feedback UltraNIX and hoojm,

                            Your votes have been added.
                            JimNinjaTrader Customer Service

                            Comment


                              #15
                              • +1

                                Please add my vote.
                              • September 2021 and still the same annoying warning dialogs using set methods

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by RubenCazorla, Today, 09:07 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post RubenCazorla  
                              Started by BarzTrading, Today, 07:25 AM
                              2 responses
                              28 views
                              1 like
                              Last Post BarzTrading  
                              Started by devatechnologies, 04-14-2024, 02:58 PM
                              3 responses
                              20 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by tkaboris, Today, 08:01 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post tkaboris  
                              Started by EB Worx, 04-04-2023, 02:34 AM
                              7 responses
                              165 views
                              0 likes
                              Last Post VFI26
                              by VFI26
                               
                              Working...
                              X