• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 Hurrikane, Yesterday, 09:18 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by tgasingh307, Today, 07:00 AM
        0 responses
        1 view
        0 likes
        Last Post tgasingh307  
        Started by stewarco, Today, 05:46 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jermaine  
        Started by andrewtrades, Yesterday, 08:24 PM
        2 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChristopherD  
        Started by authenticx, Yesterday, 10:07 PM
        1 response
        31 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Working...
        X