Send order 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 Order OrderSend(
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.FillOrKill,
TradeType tradeType = TradeType.Transfer,
double stoplimit = 0
)
Public Function OrderSend (
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.FillOrKill,
Optional tradeType As TradeType = TradeType.Transfer,
Optional stoplimit As Double = 0
) As Order
public:
Order^ OrderSend(
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::FillOrKill,
TradeType tradeType = TradeType::Transfer,
double stoplimit = 0
)
member OrderSend :
symbol : string *
lots : float *
price : float *
type : OrderType *
?sl : float *
?tp : float *
?deviation : uint64 *
?comment : string *
?expertID : int64 *
?fillPolicy : FillPolicy *
?tradeType : TradeType *
?stoplimit : float
(* 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.FillOrKill
let _tradeType = defaultArg tradeType TradeType.Transfer
let _stoplimit = defaultArg stoplimit 0
*)
-> Order
Parameters
- symbol
- Type: SystemString
Symbol - lots
- Type: SystemDouble
Lots - price
- Type: SystemDouble
Price - type
- Type: mtapi.mt5OrderType
Order type - sl (Optional)
- Type: SystemDouble
Stop Loss - tp (Optional)
- Type: SystemDouble
Take Profit - deviation (Optional)
- Type: SystemUInt64
Max deviation from specified price also known as Slppage - comment (Optional)
- Type: SystemString
String comment - expertID (Optional)
- Type: SystemInt64
Also known as magic number - fillPolicy (Optional)
- Type: mtapi.mt5FillPolicy
Fill policy depends on symbol settings on broker - tradeType (Optional)
- Type: mtapi.mt5TradeType
Allows to specify execution type - stoplimit (Optional)
- Type: SystemDouble
StopLimit price
Return Value
Type:
Order
See Also