Built-in Functions
Global
Log
Market
Trade
exchange.Buy
exchange.Sell
exchange.CreateOrder
exchange.ModifyOrder
exchange.CancelOrder
exchange.GetOrder
exchange.GetOrders
exchange.GetHistoryOrders
exchange.CreateConditionOrder
exchange.ModifyConditionOrder
exchange.CancelConditionOrder
exchange.GetConditionOrder
exchange.GetConditionOrders
exchange.GetHistoryConditionOrders
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges
Trade
Trading functions place, modify, cancel and query orders, both ordinary orders and conditional (take-profit / stop-loss) orders; they act only on the account bound to the exchange object they are called on.
Prefer exchange.CreateOrder for placing orders: it takes the symbol and side directly. exchange.Buy and exchange.Sell trade the current trading pair, and on futures need the direction set first with exchange.SetDirection. See Order for the order structure and Condition for conditional order settings.
In this sectionRead the whole section
| Name | Description |
| exchange.Buy | Submits a buy order. |
| exchange.Sell | Submits a sell order. |
| exchange.CreateOrder | Places an order. |
| exchange.ModifyOrder | Modifies the price and quantity of an existing regular order. |
| exchange.CancelOrder | Cancels an order. |
| exchange.GetOrder | Obtains order information. |
| exchange.GetOrders | Obtains the current unfilled orders. |
| exchange.GetHistoryOrders | Retrieves the historical orders of the current trading pair or contract, and supports specifying a particular trading instrument. |
| exchange.CreateConditionOrder | Creates a conditional order. |
| exchange.ModifyConditionOrder | Modifies an existing conditional order, including its order quantity, trigger condition and execution price. |
| exchange.CancelConditionOrder | Cancels a conditional order. |
| exchange.GetConditionOrder | Retrieves information about a specified conditional order. |
| exchange.GetConditionOrders | Obtains unfinished conditional orders (conditional orders that have not yet been triggered or canceled). |
| exchange.GetHistoryConditionOrders | Retrieves the historical conditional orders (including triggered, canceled, and expired conditional orders) for the current trading pair or contract, and suppor… |