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

NT8 - Strategy is being disabled

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

    NT8 - Strategy is being disabled

    I need help understanding what this error message is trying to tell me... 12/7/2017 16:33 Default Strategy 'AAATrader/124108200' 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. and 12/7/2017 16:33 Order Playback101, Stop price can't be changed below the market. affected Order: BuyToCover 1 StopMarket @ 13090.5 and 12/7/2017 16:33 Default Disabling NinjaScript strategy 'AAATrader/124108200' I am simulating ATM with the Managed Orders and it seems that when the entry is executed that when the Profit Targets are trying to be submitted, that I can getting this error. It seems that this error occurs when the ticks go against the trade in the moments during/as the Profit Targets are being submitted?? I am testing this in Replay against CL and FDAX. Both generate the error under certain conditions. In this case, I submit three orders, the first two orders have a Profit Target, first of 5 ticks, and the second of 8 ticks. I will study the log for more detailed information. This is a port from Ninja 7, where there this did not occur. Any advice? The other question is, and I can also test this....would the Ninja ATM do a better job at recovery than my code (which tested fine on NT7, Replay and Sim, no error like this)?

    #2
    reformat text?

    why are my posts wrapping all the paragraphs together?

    Comment


      #3
      Hello Turtle Trader,

      Thanks for your inquiry.

      I'm not sure exactly on on the formatting of your post. I would maybe try editing the post from different browsers to see if that can narrow down the issue.

      We see the following from the error:
      Stop price can't be changed below the market.
      This is illegal to do in NinjaTrader 7 and NinjaTrader 8. It looks like it has to do with the Stop loss as it is a stop market order. This behavior is the same in ATM strategies as well.

      Some options to take would involve modifying the strategy logic to avoid such submissions, increasing the distance the Profit Target and Stop Loss take from the market, or you can add logic to your strategy to react to order rejections like these and place a market order after the rejection is received.

      I'll include some publicly available documentation on handling order rejections in OnOrderUpdate() if you would like to implement such functionality in your strategy.

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

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

      Please let us know if we may be of further assistance.
      JimNinjaTrader Customer Service

      Comment


        #4
        reply

        this is a test for formatting I think there needs to be a new line / space or it wraps with only a new line? test test

        Comment


          #5
          ............

          My ATM submits Stop Loss and Profit Targets. These submissions are being aborted it seems. . . The root/primary error message does not seem to match what is actually happening. . . fist this message occurs, followed by the others . . 'Unable to change order'. Strategy has sent cancel requests, attempted to close the position and terminated itself. . . but I am not "changing" the entry order, The order management is trying to place the Stop and Profit orders.

          Comment


            #6
            will test with Ninja ATM

            I have a javascript blocker, maybe that is causing the compression on the formatting.

            test

            test

            Comment


              #7
              reformatted

              sorry, it seems that javascript is what creates the paragraphs....repost

              My ATM submits Stop Loss and Profit Targets. These submissions are being aborted it seems. . .

              The root/primary error message does not seem to match what is actually happening. . . fist this message occurs, followed by the others . .

              'Unable to change order'. Strategy has sent cancel requests, attempted to close the position and terminated itself. . .

              but I am not "changing" the entry order, The order management is trying to place the Stop and Profit orders when the error occurs.

              Comment


                #8
                Hello Turtle Trader,

                Is this error coming from an ATM strategy, a NinjaScript strategy with the managed approach, or from a NinjaScript Strategy that starts an ATM strategy?

                When you look at the log tab of the Control Center, do you see order states that show an order change taking place before the rejection is received?

                If this is observed from a NinjaScript Strategy using the Managed Approach, you can use TraceOrders in the strategy to see the order states in the NinjaScript Output window.

                If this is an ATM strategy, you can check if you are using a Stop Strategy that is adjusting your Stop Loss for example.

                We should expect to see this error message if there is change of an order before the rejection. Do you see this noted in TraceOrders output or in the log tab of the Control Center?
                JimNinjaTrader Customer Service

                Comment


                  #9
                  reply

                  This is my personally coded ATM Strategy using the Ninja Managed methods.

                  I tested this extensively in NT7 with Replay and streaming SIM and no error like this.

                  I will follow your suggestions and dig deeper in the logs.....

                  In some cases, the error occurs between the moment the entry order is executed and the stop/profit targets are executed. It seems to occur on the submission of these targets, before they are executed to completion.

                  and also test the same data with a corresponding Ninja ATM.

                  and then repost, next week

                  thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by TheMarlin801, 10-13-2020, 01:40 AM
                  20 responses
                  3,914 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by timmbbo, 07-05-2023, 10:21 PM
                  3 responses
                  150 views
                  0 likes
                  Last Post grayfrog  
                  Started by Lumbeezl, 01-11-2022, 06:50 PM
                  30 responses
                  805 views
                  1 like
                  Last Post grayfrog  
                  Started by xiinteractive, 04-09-2024, 08:08 AM
                  3 responses
                  11 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by Johnny Santiago, 10-11-2019, 09:21 AM
                  95 responses
                  6,194 views
                  0 likes
                  Last Post xiinteractive  
                  Working...
                  X