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 jaybedreamin, Today, 05:56 PM
              0 responses
              3 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              1 view
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              6 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Working...
              X