• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why do I keep getting this error message?

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

    Why do I keep getting this error message?

    it was on a strategy how do I fix this? I made it ignore all errors on the stratetgy

    #2
    The message is quite literal. This indicates that a sell stop market order was placed on the incorrect side of the market. I recognize this exact question and screenshot from an earlier inquiry. Did you reach out to us via email? If so, we replied to you shortly after you first wrote in. If you didn't receive that email, check your junk/spam folders for messages from NinjaTrader and ensure that they're allowed to arrive in your inbox.

    If I am mistaken, we can continue here on the forums. Please answer all of the following questions:
    • What version of NinjaTrader 8 are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.0.X.X)
    • What does "I made it ignore all errors on the stratetgy" mean exactly?
    • Are these orders being submitted manually via ATM strategies? Or are you referring to fully automated NinjaScript strategies?
    Patrick G.NinjaTrader Customer Service

    Comment


      #3
      1. 8.0.16.3
      2. this is what i mean RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors; I have that in my code dont know if that helps
      3. Ninjascript strategy

      Comment


        #4
        Hello rickyblah12,

        The error message is stating that a sell stop market order was placed above the bid price.

        No brokerage will accept a sell stop market order above the bid price.

        You will need to ensure the stop price for the order is less than the current bid price.

        You can use GetCurrentBid() to ensure that your stop price is below this bid price.

        Below is a public link to the help guide.
        https://ninjatrader.com/support/help...currentbid.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea but even with a sim account it would still matter?

          Comment


            #6
            Hello rickyblah12,

            Yes, on the Sim101 a sell stop market order placed above the bid will be rejected.

            Try it out on the SuperDOM.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              how would I go about implementing the GetCurrentBid() in my code?

              Comment


                #8
                Originally posted by NinjaTrader_ChelseaB View Post
                Hello rickyblah12,

                Yes, on the Sim101 a sell stop market order placed above the bid will be rejected.

                Try it out on the SuperDOM.
                what part of the code does it go in?

                Comment


                  #9
                  Hello rickyblah12,

                  You can use GetCurrentBid() in a condition that leads to the order being placed.

                  double myCalculatedPrice = 100;

                  if (myCalculatedPrice < GetCurrentBid() - TickSize)
                  ExitLongStopMarket(myCalculatedPrice);


                  Or you could use Math.Min() and take whichever is less

                  ExitLongStopMarket(Math.Min(myCalculatedPrice, GetCurrentBid() - TickSize));
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_ChelseaB View Post
                    Hello rickyblah12,

                    You can use GetCurrentBid() in a condition that leads to the order being placed.

                    double myCalculatedPrice = 100;

                    if (myCalculatedPrice < GetCurrentBid() - TickSize)
                    ExitLongStopMarket(myCalculatedPrice);


                    Or you could use Math.Min() and take whichever is less

                    ExitLongStopMarket(Math.Min(myCalculatedPrice, GetCurrentBid() - TickSize));
                    will it still place the order and move the stop loss futher below if its not true or it wont place the order?

                    Comment


                      #11
                      Hello rickyblah12,

                      Using Math.Min() would place the order with the stop price set to which ever is lower, the current bid or the calculated price.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        I used the strategy builder to create the stop loss...what do you think would be the issue for this error if im using the default stop loss from the builder

                        Comment


                          #13
                          Hello rickyblah12,

                          The Strategy Builder is not able to use a dynamically changing price for a stop loss. This means either a number of ticks must be used, or a percent.

                          Use a larger value to move the stop further away.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            ok...do u think since the volatility is high...when I put a 5 tick stop loss thats why i get that error?

                            Comment


                              #15
                              Hello rickyblah12,

                              Depending on the market and price used, yes. The message is specifically what happened in this case.

                              Can you detail how you set the stop in the builder and what instrument this was? An image of your stop in the builder would be helpful, depending on the instrument and its tick size 5 ticks may or may not be too close to the active market, this could also deal with how the stop was set

                              I look forward to being of further assistance.
                              JesseNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ct_fx, Today, 05:14 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post ct_fx
                              by ct_fx
                               
                              Started by Beauregard, Today, 04:36 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Beauregard  
                              Started by fx.practic, Today, 04:34 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post fx.practic  
                              Started by thomaspartyof10, Today, 02:33 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post thomaspartyof10  
                              Started by ArmKnuckle, Today, 01:59 AM
                              0 responses
                              12 views
                              0 likes
                              Last Post ArmKnuckle  
                              Working...
                              X