CloseOrder

CloseOrder - request to close order by it, partialy or full volume.

Example:

{"id": 11, "type":"CloseOrder", "body": {"ticket":969163, "volume": 0.01, "deviation": 100}}

Request Body Fields:

Parameter
Required
Type
Description

ticket

unsigned long long

the ticket of order to be closed on Meta Trader Server

volume

double

volume of the order that should be closed

time_out

int64

time in milliseconds that should be wait for async requests results (it can be from 109 msec to 7 sec; if you set time_out <109 msec, it will be 109 msec; if you set time_out > 7 sec, it will be 7 sec)

Responce Type - CloseOrder.

Responce Body Fields:

Parameter
Always returned
Type
Description

result

int

result of operation Meta Trader server

ticket

unsigned long long

the ticket of new opened order on Meta Trader Server

price

double

price of order execution, in case of pending, limit, stop orders price is 0

time

int64

time of order execution

symbol

string

a string with the symbol name

type

int

a string with the symbol name

action

int

type of action to which the trade request belongs

price_order

double

the price of an order in a trade request

price_trigger

double

the price, at which a Limit order is placed when the Stop Limit order triggers

tp

double

the Take Profit level

sl

double

the Stop Loss level

profit

double

the value of the profit

volume

double

the Volume of closed trade requests

Example:

Last updated