DEFINITION:
An order is an instruction to buy or sell an asset at a specified price. Learn how orders work in algorithmic trading, understand order types, states, and how to monitor your algorithm's execution.
What Is an Order?
An order is an instruction to buy or sell an asset at a specified price or at the current market price. In algorithmic trading, orders are the fundamental building blocks that trading bots use to execute their strategies.
Understanding Orders
When a trading bot wants to enter or exit a position, it creates an order. This order is sent to an exchange, where it's either executed immediately (market orders) or placed in the order book waiting to be filled (limit orders).
Order Anatomy
┌─────────────────────────────────────────────────────────────────┐
│ ORDER │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ORDER TYPE ORDER SIDE │
│ ────────── ────────── │
│ • Market Order • Buy (Long entry) │
│ • Limit Order • Sell (Long exit) │
│ │
│ ORDER STATUS ORDER DETAILS │
│ ──────────── ───────────── │
│ • Open • Size (quantity) │
│ • Filled • Price │
│ • Partially Filled • Amount (value) │
│ • Cancelled • Timestamp │
│ │
└─────────────────────────────────────────────────────────────────┘
Order Types
Market Orders
A market order is executed immediately at the best available price:
- Pros: Guaranteed execution, instant fill
- Cons: Price may differ from expected (slippage)
- Best for: When speed of execution is more important than price
Limit Orders
A limit order specifies the exact price at which you want to buy or sell:
- Pros: Price certainty, no slippage
- Cons: May not be filled if price doesn't reach your limit
- Best for: When price precision is more important than immediate execution
Order Lifecycle
1. Order Creation
The trading bot creates an order:
- Determines buy or sell direction based on strategy
- Calculates the appropriate size
- Sets the order type (market or limit)
- Submits the order to the exchange
2. Order States
An order can be in various states:
| Status | Description |
|---|---|
| Open | Order is placed but not yet filled |
| Filled | Order has been completely executed |
| Partially Filled | Part of the order has been executed |
| Cancelled | Order was cancelled before being filled |
| Rejected | Order was rejected by the exchange |
3. Order Execution
When an order is filled:
- The exchange matches your order with a counterparty
- Assets are transferred between accounts
- Fees are deducted
- The order status updates to "Filled"
Order Information
Each order contains important information:
Size and Amount
- Size: The quantity of the asset being traded (e.g., 0.5 BTC)
- Amount: The total value of the order in the quote currency (e.g., €15,000)
- Price: The execution price per unit
Timestamps
- Created: When the order was submitted
- Last Checked: When the order status was last updated
- Filled: When the order was completely executed
Orders vs Trades
It's important to understand the relationship between orders and trades:
| Orders | Trades |
|---|---|
| Individual buy or sell instructions | Complete investment cycles |
| Can be open, filled, or cancelled | Consist of entry and exit orders |
| Building blocks of trading | Measure of overall performance |
| Have immediate status | Track profit/loss over time |
A trade is created from one or more orders:
- A buy order opens a trade
- A sell order (or multiple sell orders) closes the trade
- The difference between buy and sell prices determines profit/loss
Monitoring Orders
When monitoring your algorithm's orders, pay attention to:
- Fill Rate: What percentage of orders are being filled?
- Execution Speed: How quickly are orders being executed?
- Slippage: Is the executed price close to the intended price?
- Order Frequency: How often is the algorithm placing orders?
Common Order Issues
Unfilled Orders
Orders may remain unfilled when:
- Limit price is too far from market price
- Market lacks liquidity
- Exchange is experiencing issues
Partial Fills
Large orders may be partially filled when:
- Market liquidity is insufficient
- Price moves away from the limit
- Multiple smaller counterparties are matched
Best Practices
- Monitor open orders regularly to ensure they're being filled
- Review order history to understand your algorithm's trading behavior
- Check for patterns in cancelled or rejected orders
- Analyze execution quality to optimize order placement
Summary
Orders are the mechanism through which trading bots interact with the market. Understanding how orders work—their types, states, and lifecycle—is essential for evaluating your algorithm's execution and identifying potential improvements in its trading strategy.
Table of Contents
What Is an Order?
Understanding Orders
Order Types
Order Lifecycle
Order Information
Orders vs Trades
Monitoring Orders
Common Order Issues
Best Practices
Summary
About the Author
Marc van Duyn
Founder & CEOMarc is the Founder and CEO of Finterion. He is passionate about making algorithmic trading accessible to everyone.