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

"order status is changepending" error

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

    "order status is changepending" error

    Hi,

    When I use the following code to submit an buy order then I get error.

    SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.Market, 2, 0, 0, GetAtmStrategyUniqueId(), "LongEntry");

    Would you please advice me , how this error happen.

    Click image for larger version  Name:	ChangePending error.JPG Views:	5 Size:	39.9 KB ID:	1142403

    Last edited by bosajin; 02-17-2021, 03:12 PM.

    #2
    Hello bosajin,

    Thanks for your post.

    With the information provided, it is not conclusive that the strategy was not attempting to change an order when this error is seen. Also, when I test the attached Unmanaged strategy, I am not able to reproduce.

    Please attach a small test script that reproduces following some steps so we may review.

    Please also test to see if this is happening with NinjaTrader standard BarsTypes. If we are to move forward with an issue report it should be presented using one of the BarsTypes that comes with NinjaTrader.

    Attaching as source code - https://ninjatrader.com/support/help...tAsSourceFiles

    We look forward to hearing from you.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      This example gives the attached error. (Im running the same script, dont change anything)
      Im working in playback connection at max speed.
      What is wrong??
      Attached Files

      Comment


        #4
        Hello fscabrera03,

        The error message is indicating that a Sell Limit order was submitted below the current bid price. Since the order is OCO tied, we get another order error mentioning the OCO paired order cannot be submitted because the OCO ID for the pair is no longer valid.

        The example submits entry order to High[0]+EntryDistance*TickSize. If the bar closes and the this calculated price ends up being below the current bid price, you will see this order rejection.

        As a tip, GetCurrentBid/GetCurrentAsk can be used to get the current Bid/Ask price and can be used to offset your orders from these prices.

        GetCurrentBid - https://ninjatrader.com/support/help...currentbid.htm

        GetCurrentAsk - https://ninjatrader.com/support/help...currentask.htm

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by warreng86, 11-10-2020, 02:04 PM
        7 responses
        1,360 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        5 views
        0 likes
        Last Post Perr0Grande  
        Started by elderan, Today, 08:03 PM
        0 responses
        9 views
        0 likes
        Last Post elderan
        by elderan
         
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        14 views
        0 likes
        Last Post maybeimnotrader  
        Working...
        X