Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Order Un-mamaged Question

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

    Change Order Un-mamaged Question

    Hi I am running an unmanaged strategy on multiple underlying instruments.

    I have no issue on order submission and NT will change the order price the first time but not on subsequent calls to change the order. I am wondering if after I change the order the first time the IOder Object changes and if I need to capture this new IOrder Object to subsequently change the order?

    I use a private IOrder entryOrder to enter the order:
    SubmitOrder(p+1, OrderAction.Buy, OrderType.Limit, BuyQty, BuyPX, 0, "", orderName);

    I then capture the Order in a IOrderArry with the following code
    OrderReference[p]=entryOrder;

    I then use the following code to change the order which works the first time

    if(OrderReference[p]!=null)
    {if ((OrderReference[p].OrderAction==OrderAction.Buy || OrderReference[p].OrderAction==OrderAction.BuyToCover)
    && (OrderReference[p].OrderState==OrderState.Accepted || OrderReference[p].OrderState==OrderState.PartFilled||OrderReference[p].OrderState==OrderState.Working)
    && OrderReference[p].LimitPrice!=BuyPX)
    {int BuyQty= (int)(OrderReference[p].Quantity);
    ChangeOrder(OrderReference[p],BuyQty,BuyPX, 0);}
    }

    But it will not change the order subsequently
    Note.. I Change the Order but am not capturing the IOrder again as I assumed that the IOrder Object remained the same. Is this the case? If not how do I get the new IOrder Object?

    #2
    I've tested a few scnearios here and in every case the IOrder object stays the same. I can ChangeOrder as many times as I need.

    Can you simplify the ChangeOrder block in your code and see if there is something there that is blocking it from changing?

    Also, where are you doing this? OnBarUpdate?
    Last edited by NinjaTrader_Matthew; 03-07-2013, 02:01 PM.
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    666 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    377 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X