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 cls71, Today, 04:45 AM
        0 responses
        1 view
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        213 views
        1 like
        Last Post PaulMohn  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        4 responses
        544 views
        0 likes
        Last Post PaulMohn  
        Started by GLFX005, Today, 03:23 AM
        0 responses
        3 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        12 views
        0 likes
        Last Post XXtrader  
        Working...
        X