Send order close request and wait for execution.
Namespace:
mtapi.mt5
Assembly:
mt5api (in mt5api.dll) Version: 4.6.1.4
Syntaxpublic Order OrderClose(
long ticket,
string symbol,
double price,
double lots,
OrderType type,
ulong deviation = 0,
FillPolicy fillPolicy = FillPolicy.FillOrKill
)
Public Function OrderClose (
ticket As Long,
symbol As String,
price As Double,
lots As Double,
type As OrderType,
Optional deviation As ULong = 0,
Optional fillPolicy As FillPolicy = FillPolicy.FillOrKill
) As Order
public:
Order^ OrderClose(
long long ticket,
String^ symbol,
double price,
double lots,
OrderType type,
unsigned long long deviation = 0,
FillPolicy fillPolicy = FillPolicy::FillOrKill
)
member OrderClose :
ticket : int64 *
symbol : string *
price : float *
lots : float *
type : OrderType *
?deviation : uint64 *
?fillPolicy : FillPolicy
(* Defaults:
let _deviation = defaultArg deviation 0
let _fillPolicy = defaultArg fillPolicy FillPolicy.FillOrKill
*)
-> Order
Parameters
- ticket
- Type: SystemInt64
Order ticket - symbol
- Type: SystemString
Symbol - price
- Type: SystemDouble
Price - lots
- Type: SystemDouble
Volume - type
- Type: mtapi.mt5OrderType
Order type - deviation (Optional)
- Type: SystemUInt64
Max deviation from specified price also known as Slppage - fillPolicy (Optional)
- Type: mtapi.mt5FillPolicy
Fill policy depends on symbol settings on broker
Return Value
Type:
OrderClosed order
See Also