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 geddyisodin, Today, 05:20 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        3 responses
        32 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by timko, Today, 06:45 AM
        2 responses
        13 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by habeebft, Today, 07:27 AM
        0 responses
        5 views
        0 likes
        Last Post habeebft  
        Started by Tim-c, Today, 03:54 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X