MT5APIOrderCloseAsync Method
|
Send order close request and don't wait execution. Use OnOrderProgress event to get result.
Namespace: mtapi.mt5Assembly: 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
)
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.Any,
Optional expertId As Long = 0,
Optional comment As String = Nothing,
Optional closeByTicket As Long = 0,
Optional placedType As PlacedType = PlacedType.Manually
)
public:
void OrderCloseAsync(
int requestId,
long long ticket,
String^ symbol,
double price,
double lots,
OrderType type,
unsigned long long deviation = 0,
FillPolicy fillPolicy = FillPolicy::Any,
long long expertId = 0,
String^ comment = nullptr,
long long closeByTicket = 0,
PlacedType placedType = PlacedType::Manually
)
member OrderCloseAsync :
requestId : int *
ticket : int64 *
symbol : string *
price : float *
lots : float *
type : OrderType *
?deviation : uint64 *
?fillPolicy : FillPolicy *
?expertId : int64 *
?comment : string *
?closeByTicket : int64 *
?placedType : PlacedType
(* Defaults:
let _deviation = defaultArg deviation 0
let _fillPolicy = defaultArg fillPolicy FillPolicy.Any
let _expertId = defaultArg expertId 0
let _comment = defaultArg comment null
let _closeByTicket = defaultArg closeByTicket 0
let _placedType = defaultArg placedType PlacedType.Manually
*)
-> unit
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