Send order close request and wait for execution.
Namespace: mtapi.mt5Assembly: 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
)
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.Any,
Optional expertId As Long = 0,
Optional comment As String = Nothing,
Optional closeByTicket As Long = 0,
Optional placedType As PlacedType = PlacedType.Manually
) As Order
public:
Order^ OrderClose(
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 OrderClose :
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
*)
-> Order
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
OrderClosed order
See Also