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

ExchangeRejectCode

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

    ExchangeRejectCode


    Hello, I have obtained this error in a strategy: "Buy order stop price must be above last trade price ExchangeRejectCode = 2061 affected. Order: BuyToCover: 1 [email protected]" It has occurred because prices have moved very quickly. How can I avoid this situation? How can I prevent the strategy from being deactivated, even if an error like this occurs? Thanks in advance and regards.

    #2
    Hello soyjesus,

    Thanks for your post.

    Situations like this can occur when the stop price is being submitted to close to the market when there is higher volatility. The stop price can be moved further away from the current market price, or the strategy can be modified so it does not disable on rejections.

    To prevent the strategy from being deactivated, you can set the strategy's RealtimeErrorHandling property to IgnoreAllErrors or StopCancelCloseIgnoreRejects. With this property set, you can then trap order rejections in OnOrderUpdate if you would like to have the strategy attempt a different action.

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

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

    Please let me know if I can be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello, I have detected that when my strategy needs to close one position and open another in the oppsite direction "on the same bar", I get an error and the second order is rejected. How can I solve it?

      Comment


        #4
        Hello soyjesus,

        Thanks for your message.

        Have you added the advised code for RealtimeErrorHandling so the strategy does not disable upon rejections?

        What is the error you are receiving which results in the strategy disabling? Please include a screenshot or copy the error from the Log tab of the Control Center by selecting it and pressing Ctrl + C.

        I look forward to assisting.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,281 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Tim-c, Today, 02:10 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        5 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        53 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Working...
        X