Reference

This is the group of functions intended for managing trading activities.

Before you proceed to study the trade functions of the platform, you must have a clear understanding of the basic terms: order, deal and position:

An order is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels.

A deal is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the supply price (Bid). A deal can be opened as a result of market order execution or pending order triggering. Note that in some cases, execution of an order can result in several deals.

A position is a trade obligation, i.e. the number of bought or sold of a financial instrument. A long position is financial security bought expecting the security price go higher. A short position is an obligation to supply a security expecting the price will fall in future.

Reference

Trade

FunctionAction
BuyPlaces a market order request to buy certain volume. It will execute immediately
SellPlaces a market order request to sell certain volume. It will execute immediately
BuyLimitPlaces the pending order of Buy Limit type (buy at the price lower than current market price)
SellLimitPlaces the pending order of Sell Limit type (sell at the price higher than current market price)
BuyStopPlaces the pending order of Buy Stop type (buy at the price higher than current market price)
SellStopPlaces the pending order of Sell Stop type (sell at the price lower than current market price)

Orders

FunctionAction
GetOrderReturns an order
GetPendingOrdersReturns an array of all pending orders
GetHistoryOrdersReturns an array of closed orders
OrderModifyModifies a pending order
OrderDeleteDeletes a pending order

Positions

FunctionAction
GetPositionReturns an position
GetOpenPositionsReturns an array of all open positions
GetHistoryPositionsReturns an array of closed positions
PositionModifyModifies a position
PositionCloseCloses a position by the specified product or order id
PositionClosePartialPartially closes a position on a specified product or order id
PositionCloseByCloses a position with the specified order id by an opposite position

Deals

FunctionAction
GetDealsReturns a deal
GetHistoryDealsReturns an array of deals