Announcement

Collapse
No announcement yet.

Order.state and Order.fillQty for partial fills

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

  • Order.state and Order.fillQty for partial fills

    Can anybody provide clarifications, based on actual trading experience, for any of the following questions? I could not find answers in the documentation or other threads.

    1. Can a partially filled order continue to be a working order? In other words. can the following two conditions be true at the same time?

    Order.state( OrderID ) == Order.STATE_PARTIALFILL
    and
    Order.state( OrderID ) == Order.STATE_WORKING

    2. Do any of the following conditions become true when an order is partially filled (due to the change in the remaining unfilled quantity)?

    Order.state( OrderID ) == Order.STATE_PLACING
    Order.state( OrderID ) == Order.STATE_UPDATING

    3. Does Order.fillQty( OrderID ) return the cumulative filled quantity when multiple fills occur for one order?

    4. Does Order.qty ( OrderID ) change when a partial fill occurs? In other words, does the quantity of the order reflect the original quantity when the order was submitted or the current (unfilled) quantity of the order?

    I realize that there is an Execution object with information which can aid in monitoring orders and fills, but I do not know how to associate an OrderID with an ExecutionID. That seems to open a possibility for another error in determining what quantity has filled and not filled.

    Thank you.
    Last edited by omerproteus; 08-14-2015, 10:19 AM.

  • #2
    As to your numbered questions, arranged here in descending order of confidence in my response:
    (3) Order.fillQty(OrderID) is cumulative and Order.fillPrice(OrderID) is the average price of whatever number/amount has been filled so far.
    (1) Notification of a partial fill changes Order.state(OrderID) momentarily; but the state will revert to what's happening next, which could be Order.STATE_WORKING.
    (4) Order.qty(OrderID) should stay fixed at the original quantity.
    (2) I don't know, but I am highly confident that I don't know so maybe this should be at the top of this list.

    Comment

    Working...
    X