MT5APIOrderSendAsync Method
|
Send order 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 OrderSendAsync(
int requestId,
string symbol,
double lots,
double price,
OrderType type,
double sl = 0,
double tp = 0,
ulong deviation = 0,
string comment = null,
long expertID = 0,
FillPolicy fillPolicy = FillPolicy.Any,
TradeType tradeType = TradeType.Transfer,
double stoplimit = 0,
Expiration expiration = null,
long closeByTicket = 0,
PlacedType placedType = PlacedType.Manually
)
Public Sub OrderSendAsync (
requestId As Integer,
symbol As String,
lots As Double,
price As Double,
type As OrderType,
Optional sl As Double = 0,
Optional tp As Double = 0,
Optional deviation As ULong = 0,
Optional comment As String = Nothing,
Optional expertID As Long = 0,
Optional fillPolicy As FillPolicy = FillPolicy.Any,
Optional tradeType As TradeType = TradeType.Transfer,
Optional stoplimit As Double = 0,
Optional expiration As Expiration = Nothing,
Optional closeByTicket As Long = 0,
Optional placedType As PlacedType = PlacedType.Manually
)
public:
void OrderSendAsync(
int requestId,
String^ symbol,
double lots,
double price,
OrderType type,
double sl = 0,
double tp = 0,
unsigned long long deviation = 0,
String^ comment = nullptr,
long long expertID = 0,
FillPolicy fillPolicy = FillPolicy::Any,
TradeType tradeType = TradeType::Transfer,
double stoplimit = 0,
Expiration^ expiration = nullptr,
long long closeByTicket = 0,
PlacedType placedType = PlacedType::Manually
)
member OrderSendAsync :
requestId : int *
symbol : string *
lots : float *
price : float *
type : OrderType *
?sl : float *
?tp : float *
?deviation : uint64 *
?comment : string *
?expertID : int64 *
?fillPolicy : FillPolicy *
?tradeType : TradeType *
?stoplimit : float *
?expiration : Expiration *
?closeByTicket : int64 *
?placedType : PlacedType
(* Defaults:
let _sl = defaultArg sl 0
let _tp = defaultArg tp 0
let _deviation = defaultArg deviation 0
let _comment = defaultArg comment null
let _expertID = defaultArg expertID 0
let _fillPolicy = defaultArg fillPolicy FillPolicy.Any
let _tradeType = defaultArg tradeType TradeType.Transfer
let _stoplimit = defaultArg stoplimit 0
let _expiration = defaultArg expiration 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 GetRequestID()
- symbol String
- Symbol
- lots Double
- Lots
- price Double
- Price
- type OrderType
- Order type
- sl Double (Optional)
- Stop Loss
- tp Double (Optional)
- Take Profit
- deviation UInt64 (Optional)
- Max deviation from specified price also known as Slppage
- comment String (Optional)
- String comment
- expertID Int64 (Optional)
- Also known as magic number
- fillPolicy FillPolicy (Optional)
- Fill policy depends on symbol settings on broker
- tradeType TradeType (Optional)
- Allows to specify execution type
- stoplimit Double (Optional)
- StopLimit price
- expiration Expiration (Optional)
-
- closeByTicket Int64 (Optional)
-
- placedType PlacedType (Optional)
-
See Also