Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChangeOrder Quantity and Filled

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

    ChangeOrder Quantity and Filled

    Hello,

    I am wondering if the Quantity property of an Order is adjusted when the Order gets partial fills?

    For example, say I have an ExitLongStopMarket Order for 100 shares. So when the order is initially entered the Filled property = 0. Say 25 shares get filled. The Filled property is now 25. Is the value of the value of the Quantity property still 100 or does it get changed to 75?

    Thanks

    #2
    Hello tornadoatc,

    Thank you for your inquiry.

    The quantity amount of a specific IOrder object will remain at the quantity specified for the order.

    Here is a simple test you can do to check this:
    Code:
    private IOrder entryOrder;
    
    protected override void OnBarUpdate()
    {
         // entry logic ....
    }
    
    // called on an incoming execution (fill)
    protected override void OnExecution(IExecution execution)
    {
         if (execution.Order == entryOrder)
              Print(entryOrder.Quantity);
    }
    More information about OnExecution() can be found here: https://ninjatrader.com/support/help...nexecution.htm

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Hello Zachary,

      So the question originated from thoughts around a scenario of how to handle a ChangeOrder for a Stop Order when there might be partial fills. Not something I can easily test...

      So again, if I have entered an order EnterLong(100) and only get filled on 25 and the EnterLong is still working.. Immediately after entering the EnterLong(100, "enterlong Signal Name") I also enter ExitLongStopMarket(stopPrice, "enterlong Signal Name") .. I understand that this order is monitoring the Filled property of the Entry Order ... So if only 25 of the 100 were filled the ExitLongStopMarket order would be working on 25.

      Then on next bar I want to change my ExitLongStopMarket order using ChangeOrder(stopOrder, aQuanity, 0, newStopPrice).

      Question 1: Why do I have to provide Quantity? The only thing I really want to change is the StopPrice. Providing the StopOrder and the newStopPrice should be sufficient. Can you provide an additional overload on ChangeOrder() that would be ChangeOrder(StopOrder, newStopPrice)?

      Question 2: If I have to provide a Quantity, what value should I provide? The amount Filled from entry order (Filled = 25 and entry order still working on 75 more shares) or amount of original Quantity of 100?

      Question 3: Do I enter a value of "0" for the LimitPrice parameter of ChangeOrder() as above ?

      These questions pertain to NT8.

      Thanks,
      Last edited by tornadoatc; 12-20-2015, 04:56 PM.

      Comment


        #4
        Hello tornadoatc,


        Question #1
        You have to specify the quantity because you are changing the order. If you wish to continue using the same order quantity, you could do so by using the original order quantity value.
        "Can you provide an additional overload on ChangeOrder() that would be ChangeOrder(StopOrder, newStopPrice)?"
        Simply enter the new stop price in the stopPrice parameter.


        Question #2
        The value of the Quantity property will be updated with each partial fill.


        Question #3
        You would use 0 for the limitPrice if this parameter is irrelevant for the OrderType being submitted.


        Here is the ChangeOrder() Help Guide to assist you further.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X