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

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?

    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.
        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 GwFutures1988, Today, 02:48 PM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by ScottWalsh, 04-16-2024, 04:29 PM
                              6 responses
                              30 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by frankthearm, Today, 09:08 AM
                              10 responses
                              36 views
                              0 likes
                              Last Post frankthearm  
                              Started by mmenigma, Today, 02:22 PM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by NRITV, Today, 01:15 PM
                              2 responses
                              9 views
                              0 likes
                              Last Post NRITV
                              by NRITV
                               
                              Working...
                              X