Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error message

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

    Error message


    Welcome
    My connection with (playback)
    I placed a pending order with trailing stop
    I got this error message

    Click image for larger version

Name:	Error Message.png
Views:	514
Size:	19.1 KB
ID:	1179314

    What is the problem and how can I fix it
    I made a video showing the error, I will send it to you if you want
    Thank you


    #2
    Hello Trader199,

    Thanks for your message.

    The error states that the stop price of a Sell Stop Market order was attempted to be moved above the market.

    This can be seen in moments of higher volatility when the stop price is moved too close to the current market price, where the current market price can move back before the order change gets processed.

    You could increase the distance of the stop loss so it is further away from the market and this kind of error would be less often seen. This would be set up for an ATM strategy's Stop Strategy settings.

    Stop Strategies - https://ninjatrader.com/support/help...p_strategy.htm

    If you are still having trouble, please attach some screenshots showing how the ATM strategy is set up, and how the stop strategy is set up.

    Attaching a Screenshot

    To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.

    Click here for instructions

    Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.


    Click here for detailed instruction

    We look forward to assisting
    JimNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      Hello Trader199,

      Thanks for your message.

      The error states that the stop price of a Sell Stop Market order was attempted to be moved above the market.

      This can be seen in moments of higher volatility when the stop price is moved too close to the current market price, where the current market price can move back before the order change gets processed.

      You could increase the distance of the stop loss so it is further away from the market and this kind of error would be less often seen. This would be set up for an ATM strategy's Stop Strategy settings.

      Stop Strategies - https://ninjatrader.com/support/help...p_strategy.htm

      If you are still having trouble, please attach some screenshots showing how the ATM strategy is set up, and how the stop strategy is set up.

      Attaching a Screenshot

      To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.

      Click here for instructions

      Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.


      Click here for detailed instruction

      We look forward to assisting
      Hi
      Thank you
      Yes, I use ATM and set my stop loss using it
      I have put in the following link a video
      https://www.mediafire.com/file/c98m1r4xddo6un8/Erorr+Message.mp4/file
      at minute number 1:28 the error appears
      I hope to find a solution because my strategy is completely based on (Scalping) and the small stop loss, so it is very important to move the stop loss correctly before the price reverses

      Please watch the video and let me know, there might be an unknown error

      Comment


        #4
        Hello Trader199,

        I don't think the Auto Trail is the biggest concern (this is distanced 6 ticks from the current market price.) Rather, your Auto Breakeven to move the stop loss 1 tick above the average entry price after 2 ticks of profit are seen would mean the stop loss would be moved just 1 tick under the current market price, which could very likely turn against you before the order change completes.

        You could consider loosening the Auto Breakeven Plus field so it does not move the stop loss so close to the current market price, and this can help to avoid error message.

        When the error message is received, we do see the position closes by the Stop1 order at the last price it was before the change attempt took place.
        JimNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jim View Post
          Hello Trader199,

          I don't think the Auto Trail is the biggest concern (this is distanced 6 ticks from the current market price.) Rather, your Auto Breakeven to move the stop loss 1 tick above the average entry price after 2 ticks of profit are seen would mean the stop loss would be moved just 1 tick under the current market price, which could very likely turn against you before the order change completes.

          You could consider loosening the Auto Breakeven Plus field so it does not move the stop loss so close to the current market price, and this can help to avoid error message.

          When the error message is received, we do see the position closes by the Stop1 order at the last price it was before the change attempt took place.
          Thank you
          Please note, I previously did not use (Auto Breakeven), The same error message appears.
          So I think something is wrong.
          In addition, a little while ago I tried not to use (Auto Breakeven), the same error appeared.

          I have put in the following link a video
          https://www.mediafire.com/file/3blg6he3ictrdgr/Eroor+message+2.mp4/file
          At minute number 2:45 the same error appears

          I hope to find a solution to the problem

          Comment


            #6
            Hello Trader199,

            Could you test again with a 1 second chart open in addition to the 30 minute chart?

            We would want to see the execution marker for the entry order and the Stop1 order on the 1 second chart and reference the 1 second bars to get a better idea of the volatility that took place during that time. As the bar you are referencing is very large, it is possible that the market jumped fast enough where it moved to the other side of the market when the stop loss was moved.
            JimNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Jim View Post
              Hello Trader199,

              Could you test again with a 1 second chart open in addition to the 30 minute chart?

              We would want to see the execution marker for the entry order and the Stop1 order on the 1 second chart and reference the 1 second bars to get a better idea of the volatility that took place during that time. As the bar you are referencing is very large, it is possible that the market jumped fast enough where it moved to the other side of the market when the stop loss was moved.
              Hi
              Thank you
              I ran another test with a 1 second chart, the message appeared again.
              I have put in the following link a video
              https://www.mediafire.com/file/v82kno07txwq5vj/Error+Message+3.mp4/file
              The duration of the video is 19 minutes, please note:
              ( Start – 0: 39 ) You can see ATM setting
              ( 0:39 – 16:48 ) Everything it's ok.
              ( 16:49 ) Error message appears
              I hope to find the reason for this problem with the solution so I can start trading
              Thanks

              Comment


                #8
                Hello Trader199,

                This is a slightly different error.

                You entered short at 1816.1 and the stop loss (Buy Stop Market) was placed at 1816.4 which was an invalid price when the order was processed.

                Looking at the 1 second bar, it is about 5 ticks in size for that 1 second. It is the market did move above 1816.4 in that second, and we can confirm as we see the 1 second bar reaches 1816.6.

                You would be looking for the same thing to confirm the case for an Unable To Change order error in Playback, except instead of comparing with the Execution marker of the entry, you would be looking at the price action of the 1 second bar when the order error is seen.

                JimNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Jim View Post
                  Hello Trader199,

                  This is a slightly different error.

                  You entered short at 1816.1 and the stop loss (Buy Stop Market) was placed at 1816.4 which was an invalid price when the order was processed.

                  Looking at the 1 second bar, it is about 5 ticks in size for that 1 second. It is the market did move above 1816.4 in that second, and we can confirm as we see the 1 second bar reaches 1816.6.

                  You would be looking for the same thing to confirm the case for an Unable To Change order error in Playback, except instead of comparing with the Execution marker of the entry, you would be looking at the price action of the 1 second bar when the order error is seen.

                  thank you very much
                  I understand why the problem is now.
                  I have some questions please:

                  1- Is there any way to place pending order with target and stop loss?
                  If yes, that would be a good thing
                  Because as you can see now only the pending order is placed, and after the pending order is activated the target and stop loss order is sent.

                  The problem occurs because there is a time between placing the pending order and (sending target and stop loss).

                  2- What is the speed of latency for Playback connection? Is it the same as in real time?

                  3- Do you have any suggestions to solve this problem?

                  Thank you again

                  Comment


                    #10
                    Hello Trader199,

                    ATM strategies operate by waiting for the entry order to be confirmed as filled to trigger the submissions of target and stop orders. NinjaTrader is highly programmable and it would be possible to program functionality to submit target and stop before an entry order, but this would not be possible out-of-box with ATM strategies. I also do not think it would be the solution you are looking for.

                    The problem from post #7 would be that the stop and target need time to be processed after they are submitted, and by the time the orders are processed, they end up on the other side of the market and get rejected. The consequence is that you are informed that the order cannot be submitted so you can take action on the position. (Submit another order to act as your stop loss, close the position, etc.)

                    The problem involving the Unable To Change order involves the market moving the stop loss close enough to the market where the by the time the order change is processed, the order is on the other side of the market and the attempt to change throws an error. The consequence is that the change fails and the stop loss remains at the same level.

                    Playback's latency is very small, and it is much smaller than realtime. Sim101 will have random delays added which switching order states, which adds latency to simulate slippage. Live account order submissions would have higher latency since the orders will need to leave NinjaTrader and travel to the broker/exchange. It will be more likely to hit order errors and rejections with tight stops on Sim than Playback, and it will be more likely to hit order errors and rejections with tight stops on live connections than Sim.

                    Greater distanced stops would be most likely to avoid these types of situations, or you could decide to monitor your trades closely and react incase a stop loss gets rejected, as would be the case with post #7.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Jim View Post
                      Hello Trader199,

                      ATM strategies operate by waiting for the entry order to be confirmed as filled to trigger the submissions of target and stop orders. NinjaTrader is highly programmable and it would be possible to program functionality to submit target and stop before an entry order, but this would not be possible out-of-box with ATM strategies. I also do not think it would be the solution you are looking for.

                      The problem from post #7 would be that the stop and target need time to be processed after they are submitted, and by the time the orders are processed, they end up on the other side of the market and get rejected. The consequence is that you are informed that the order cannot be submitted so you can take action on the position. (Submit another order to act as your stop loss, close the position, etc.)

                      The problem involving the Unable To Change order involves the market moving the stop loss close enough to the market where the by the time the order change is processed, the order is on the other side of the market and the attempt to change throws an error. The consequence is that the change fails and the stop loss remains at the same level.

                      Playback's latency is very small, and it is much smaller than realtime. Sim101 will have random delays added which switching order states, which adds latency to simulate slippage. Live account order submissions would have higher latency since the orders will need to leave NinjaTrader and travel to the broker/exchange. It will be more likely to hit order errors and rejections with tight stops on Sim than Playback, and it will be more likely to hit order errors and rejections with tight stops on live connections than Sim.

                      Greater distanced stops would be most likely to avoid these types of situations, or you could decide to monitor your trades closely and react incase a stop loss gets rejected, as would be the case with post #7.
                      Thank you very much
                      A great answer that clarifies all the details and all my questions
                      Things became clear
                      Thank you again

                      Comment


                        #12
                        Hello Jim
                        I continue the posts just because I have the same problem (OCO ORDER ID NOT VALID) with a Strategy that call an ATM Strategy.

                        The question is if the error deriving from OCO Order of an ATM strategy could detected and managed with ninja scripiting?

                        I saw this script from sample , but it seems is working with the primary order , not with the oco associated by ATM Strategy
                        if (status[2] == "Filled" || status[2] == "Cancelled" || status[2] == "Rejected")
                        orderId = string.Empty;

                        thanks
                        Roberto

                        Comment


                          #13
                          Hello Roberto,

                          ATM strategies that are started from NinjaScript strategies would be separate and would have to be peeked at with ATM Strategy methods, or to use account level events to watch what transpires with the ATM strategy's orders.

                          You can use GetAtmStrategyStopTargetStatus to check if target/stop are filled, cancelled or rejected.

                          https://ninjatrader.com/support/help...rgetorders.htm

                          Generally an OCO related error from an ATM strategy means the stop loss fills or gets rejected before the profit target gets submitted. When the target gets submitted, it cannot be accepted because the OCO ID was already used when the other OCO order had filled or rejected.

                          If you need to wire into account level order update events, you could do so by subscribing to the Account.OrderUpdate event within the NinjaScript strategy.

                          Account.OrderUpdate - https://ninjatrader.com/support/help...rderupdate.htm

                          Since these questions are starting to get further into NinjaScript, please open a new thread in our Strategy Development forums if you have additional NinjaScript related questions.
                          JimNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by algospoke, Yesterday, 06:40 PM
                          2 responses
                          23 views
                          0 likes
                          Last Post algospoke  
                          Started by ghoul, Today, 06:02 PM
                          3 responses
                          14 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by jeronymite, 04-12-2024, 04:26 PM
                          3 responses
                          45 views
                          0 likes
                          Last Post jeronymite  
                          Started by Barry Milan, Yesterday, 10:35 PM
                          7 responses
                          22 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by AttiM, 02-14-2024, 05:20 PM
                          10 responses
                          181 views
                          0 likes
                          Last Post jeronymite  
                          Working...
                          X