Click or drag to resize

MT5APIOrderClose Method

Send order close request and wait for execution.

Namespace: mtapi.mt5
Assembly: mt5api (in mt5api.dll) Version: 5.3677.1.2
Syntax
public Order OrderClose(
	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

ticket  Int64
Order ticket
symbol  String
Symbol
price  Double
Price
lots  Double
Volume
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)
 

Return Value

Order
Closed order
See Also