Create a Market Range Close Order (Using Price and Distance)
A market range close order closes a position at the available market rate in case this rate is in the range specified in the command.
Please note that close, stop and limit orders must be permitted for the account in order to be
used (see also core.host:execute("getTradingProperty", ...)
for details
about permissions).
Valuemap field |
Datatype |
Description |
Command |
string |
The command. Must be |
OrderType |
string |
The type of the order. Must be |
OfferID |
string |
The identifier of the instrument the order should be placed for.
The value must be obtained from the "Offers" table, the |
AcctID |
string |
The identifier of the account the order should be placed for.
The value must be obtained from the "Accounts" table, the Please note that the account identifier may not necessarily be equal to the account name which is shown in the Trading Station application. |
TradeID |
string |
The identifier of the trade to be closed. The value must be obtained from the "Trades" table, the |
BuySell |
string |
The order direction. The value must be |
Quantity |
number |
The quantity of the instrument to be bought or sold. The quantity is expressed in contracts and must
be divisible by the value of the lot size (see The quantity must be less than or equal to the size of the position (see the Do not fill this value for the net quantity order. |
NetQtyFlag |
string |
The net quantity flag. The value can be either An close order in the netting mode closes all positions which
exist at the moment of the order filling and which are created for the
order account and order instrument in the direction (see |
Rate |
number |
The center price of the price range in which the order can be filled. |
AtMarket |
number |
The distance from the rate specified by the The value must be expressed in pips. For example, if the pip of the instrument is 0.01 and |
GTC |
string |
Time-In-Force value. Can be IOC (Immediate-or-Cancel) or FOK (Fill-or-Kill). The value is optional. Market orders are IOC orders by default. |
CustomID |
string |
The custom identifier of the order. This value will be populated into all order-related QTXT columns of the following tables: "Orders", "Trades", and "Closed Trades". |