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: 4.6.1.4
Syntaxpublic void OrderCloseAsync(
int requestId,
long ticket,
string symbol,
double price,
double lots,
OrderType type,
ulong deviation = 0,
FillPolicy fillPolicy = FillPolicy.FillOrKill
)
Public Sub OrderCloseAsync (
requestId As Integer,
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
)
public:
void OrderCloseAsync(
int requestId,
long long ticket,
String^ symbol,
double price,
double lots,
OrderType type,
unsigned long long deviation = 0,
FillPolicy fillPolicy = FillPolicy::FillOrKill
)
member OrderCloseAsync :
requestId : int *
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
*)
-> unit
Parameters
- requestId
- Type: SystemInt32
Uniq temporary ID that can be used before ticket would be assigned. You can use GetID() - ticket
- Type: SystemInt64
Order ticket - symbol
- Type: SystemString
Symbol - price
- Type: SystemDouble
Price - lots
- Type: SystemDouble
How many lots - 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
See Also