Click or drag to resize

MT5APIOrderCloseAsync Method

Send order close request and don't wait execution. Use OnOrderProgress event to get result.

Namespace: mtapi.mt5
Assembly: mt5api (in mt5api.dll) Version: 5.3677.1.2
Syntax
public void OrderCloseAsync(
	int requestId,
	long ticket,
	string symbol,
	double price,
	double lots,
	OrderType type,
	ulong deviation = 0,
	FillPolicy fillPolicy = FillPolicy.Any,
	long expertId = 0,
	string comment = null,
	long closeByTicket = 0,
	PlacedType placedType = PlacedType.Manually
)

Parameters

requestId  Int32
Uniq temporary ID that can be used before ticket would be assigned. You can use GetID()
ticket  Int64
Order ticket
symbol  String
Symbol
price  Double
Price
lots  Double
How many lots
type  OrderType
Order type
deviation  UInt64  (Optional)
Max deviation from specified price also known as Slppage
fillPolicy  FillPolicy  (Optional)
Fill policy depends on symbol settings on broker
expertId  Int64  (Optional)
 
comment  String  (Optional)
 
closeByTicket  Int64  (Optional)
 
placedType  PlacedType  (Optional)
 
See Also