# Order Lifecycle
The lifecycle consists of three levels as shown in the diagram:

- Position (unique)
- - Order 1 (Order 1)
- - Transaction record 1
- - Transaction record 2
- - Order 2 (Order 2)
- - Transaction record 1
- - Transaction record 2
The order lifecycle can be divided into several stages:
-
Every time a request for a trade is triggered by the source (customer, program, manager), the system generates an order (an order ticket).
-
When this order is successfully executed (i.e., a trade occurs), a new transaction record is created under the order to capture detailed information;
After each order (ticket) generates a transaction record, the system determines whether to create the corresponding position based on the account type:
-
Netting account: Orders with the same trading symbol must be grouped under a single position. If no position exists, a new one is created.
-
Hedging account: Positions are only grouped under the same position when an existing position is closed or reduced (not locked).
Order Fields
-
Order Number: The order number associated with the trade execution.
-
Trading Account: The account number that placed the order.
-
Request Time: The time when the trade request was made.
-
Requested Price: The requested price (not the executed price).
-
Trading Symbol: The symbol being traded in the order.
-
Trade Type: The direction of the trade (Buy/Sell).
-
Leverage: The leverage ratio for the order. If not applicable, shows as "-".
-
Trading Volume: The volume of the trade, currently counted in lots.
-
Order Type: The following types of orders are currently supported (corresponding order types can be placed on the trading terminal):
-
- Market Order
-
- Limit Order
-
- Stop Loss Order
-
-
Take Profit/Stop Loss: The take-profit and stop-loss settings for the order.
-
Modified Price: The price recorded when the order status changes (typically when the status updates to "Completed" during transaction record creation).
-
Modified Time: The time recorded when the order status changes (typically when the status updates to "Completed" during transaction record creation).
-
Reason: The source of the order placement, currently supporting the following options:
-
- Client: The order placed by the client.
-
- Manager: The order placed by the manager on behalf of the client.
-
- Forced Close: A trade triggered by the system when the client's net worth falls below the alert threshold.
-
-
Order Status:
-
- Completed
-
- Canceled
-
- Failed
-
- Pending
-
Transaction Record Fields
-
Transaction ID: The unique identifier for the transaction record.
-
Order Number: The order number associated with the transaction.
-
Position Number: The position number associated with the transaction.
-
Trading Account: The trading account that the transaction belongs to.
-
Execution Price: The price at which the transaction was executed.
-
Execution Time: The time when the transaction was completed.
-
Transaction Direction: The direction of the trade (not buy/sell):
-
- IN: Represents an open or increase position.
-
- OUT: Represents a close or reduce position.
-
-
Trading Symbol: The symbol being traded in the transaction.
-
Trading Volume: The volume of the trade, currently counted in lots.
-
Fees: Recorded only for transaction records with OUT direction.
-
Profit/Loss: Recorded only for transaction records with OUT direction.
-
Swap Fee: Recorded only for transaction records with OUT direction.
Position Fields
-
Position ID: The unique identifier for the position.
-
Trading Account: The trading account associated with the position.
-
Open Time: The time when the position was opened.
-
Open Price: The price at which the position was opened.
-
Trading Symbol: The symbol associated with the position.
-
Trading Volume: The volume of the position, currently counted in lots.
-
Trade Direction: The direction of the trade (Buy/Sell).
-
Leverage: The leverage ratio for the position. If not applicable, shows as "-".
-
Take Profit/Stop Loss: The take-profit and stop-loss settings for the position.
-
Status: The position can only have two statuses:
-
- Open
-
- Closed
-
-
Modified Time: Represents different meanings depending on the status. If the status is "Closed", it refers to the closing time.
-
Profit/Loss: The profit or loss of the position.
-
Fees: The fees associated with the position.
-
Swap Fee: The swap fee for the position.