Documentation
Order Basics
An introduction to Orders.
What is an Order?
An Order is a request from a User to buy or sell an amount of a Tradeable Item on a particular Market.
An electronic exchange takes Orders from many Users and tries to match Buy Orders to Sell Orders by price. When a match is made, the overlapping quantity between the Buy Order and Sell Order is executed, and both Orders are updated to reflect the executed amount. If the Orders have not executed their full requested quantity, they continue trying to match against other Orders. Each successful match is an execution, and that execution creates one Fill for each participating Order.
At a bare minimum, an Order states how much of the Transactional Tradeable Item the User wants to buy or sell. An Order is said to be "working" if it is currently eligible for matching and is not yet fully filled. An Order is "suspended" if it is held by the exchange, but is awaiting either a trigger price to be reached (Stop Orders) or a point in time to pass (Effective Orders).
Beyond the quantity to trade and the side (Buy or Sell), the User can specify further details that affect how the system processes the Order. The User can set a LIMIT price to specify that the Order must not trade at a price worse than the stated LIMIT price. STOP Orders can be configured to begin working only if the Market trades beyond a particular price. An Order can have time limits so that it begins working at one point in time and cancels itself at a later point.
Additionally, an Order can carry extra information if it originated on a client system. The Order can have an OnBehalfOf setting that records the user on the client system who placed the Order. The ClOrdID setting can be used to record a unique Order ID that the client system uses to refer to the Order. These details are propagated through the system and recorded on the Fills.
What is a Price?
A Price data packet is a snapshot of the Market, showing the current working LIMIT Orders together with the last traded price and volume.
The idea behind Price data is that all Users can see the current state of the Market and understand what Order they would need to place in order to trade. All Users with permission to view the Market see the same anonymised Price data.
Price data shows the best bids (Buy Orders) and best offers (Sell Orders). The best bid is the bid with the highest price, and the best offer has the lowest price. Orders with the same or similar prices are grouped together and their volumes are aggregated.
Price data is updated whenever there is an execution, or when the Market attempts a matching pass but fails to find two Orders that can be matched.
Order Types
Orders can be very simple, or they can have quite complex behaviour, depending on the strategy that the trader wants to follow.