Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

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

NameDescription
exchange.BuySubmits a buy order.
exchange.SellSubmits a sell order.
exchange.CreateOrderPlaces an order.
exchange.ModifyOrderModifies the price and quantity of an existing regular order.
exchange.CancelOrderCancels an order.
exchange.GetOrderObtains order information.
exchange.GetOrdersObtains the current unfilled orders.
exchange.GetHistoryOrdersRetrieves the historical orders of the current trading pair or contract, and supports specifying a particular trading instrument.
exchange.CreateConditionOrderCreates a conditional order.
exchange.ModifyConditionOrderModifies an existing conditional order, including its order quantity, trigger condition and execution price.
exchange.CancelConditionOrderCancels a conditional order.
exchange.GetConditionOrderRetrieves information about a specified conditional order.
exchange.GetConditionOrdersObtains unfinished conditional orders (conditional orders that have not yet been triggered or canceled).
exchange.GetHistoryConditionOrdersRetrieves the historical conditional orders (including triggered, canceled, and expired conditional orders) for the current trading pair or contract, and suppor…