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

Stop price can't be changed above the market

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

    Stop price can't be changed above the market

    Hi all,
    What happens when the error below happens?
    a. the Stop price will not be changed
    b. the Stop price will be changed to the Last of the previous bar?
    c. Or?
    Also, how to avoid this kind of error?
    Thanks in advance for your help!

    Stop price can't be changed above the market. affected Order: Sell 1 StopMarket @ 7530.75

    #2
    Hello timko, thanks for your note.

    This error means the strategy is trying to place a sell stop order above the market. The code needs to make sure the price to be moved to is below the current market price. You can check the current bid/ask at any time with the GetCurrentBid/GetCurrentAsk methods.

    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Chris,
      could you modify NT8 to offer an option:
      if such an event is encountered, change to market price?
      yeah, I know, u will say to create a ticket for me and count in people who also support this. then problem solve till time goes to infinity

      Comment


        #4
        Hello timko,

        This is Jim, responding on behalf of Chris who is out of the office at this time.

        This sort of error handling functionality is already possible with NinjaTrader. Please set RealtimeErrorHandling to IgnoreAllErrors and use OnOrderUpdate to trap the order which received an ErrorCode of UnableToChangeOrder. Once trapped, you can call ExitLong/ExitShort to exit the position via market order.

        Exiting via market order when this error is received would not be applied across the board as not every person will want to exit their position if they receive an ErrorCode of UnableToChangeOrder. Some users may want to do nothing but let the script stay running.

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

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

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          In order to address this UnableToChangeOrder issue, does one need to implement both solutions suggested above--using the GetCurrentBid/GetCurrentAsk methods AND setting RealtimeErrorHandling to IgnoreAllErrors + calling ExitLong/ExitShort--or are the approaches either EITHER/OR?

          Comment


            #6
            Hello kirkvan, thanks for your question.

            It's up to the developer to decide. NinjaTrader sets the default to Cancel/Close because the majority of people would want to disable the strategy an exit any live positions if an error occurs. If one wishes to handle the error themselves and keep the strategy running they can do so and try resubmitting the order at a new price.

            Please let me know if I can assist any further.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Thank you. I'll ask my programmer to take a look at this thread.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by funk10101, Yesterday, 09:43 PM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
              5 responses
              551 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by rtwave, 04-12-2024, 09:30 AM
              5 responses
              37 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by funk10101, Today, 12:02 AM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by GLFX005, Today, 03:23 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Erick  
              Working...
              X