OEC Application Programming Interface

Order Class

A client order.

For a list of all members of this type, see Order Members.

System.Object
   MarshalByRefObject
      IDObject<Int32>
         IDObject
            Order

public class Order : IDObject

Remarks

When order is created, its placed to Orders collection with a local ID (always negative). As server receives the order, it confirms it and assigns a global unique order ID, then client is notified by OnOrderConfirmed event. At this point, order current state is Sent, it has one State in its States collection, a create Command with initial order Version in Commands and Versions respectively.

Some orders, especially pit or MOO/MOC ones, could then change their state to Held - this means that they are not active yet and waiting of activation. MOO/MOC orders

Prior to activation, order can be rejected at different stages by risk system, live broker or electronic execution system. In this case it becomes Rejected

When order is accepted by system, broker and/or electronic execution system, it becomes Working - this means that order is active and could be filled. Market orders usually get filled and completed in a few milliseconds, if trading session is now active for order Contract. Other orders will wait until order condition is satisfied.

Client can request order cancellation - see CancelOrder, or modification - in this case he needs to create a ModifyOrderDraft, change values he wants to modify and call ModifyOrder method. Both of these actions creates a Command, and modification also creates a new order version.

Finally, order becomes Completed or Cancelled - note, that cancellation of a partially filled order makes the order completed, so client should look at filled quantity instead of order quantity to see whether order was fully completed or not.

Requirements

Namespace: OEC.API

Assembly: API (in API.dll)

See Also

Order Members | OEC.API Namespace | Orders | Command | Version | State | Fill | SendOrder | OrderDraft