OrderClientSafeOrderSend Method
|
The main function used to open a position or place a pending order.
Namespace:
TradingAPI.MT4Server
Assembly:
MT4ServerApi (in MT4ServerApi.dll) Version: 4.6.1.8
Syntaxpublic Order OrderSend(
string symbol,
Op operation,
double volume,
double price,
int slippage,
double stoploss,
double takeprofit,
string comment,
DateTime expiration
)
Public Function OrderSend (
symbol As String,
operation As Op,
volume As Double,
price As Double,
slippage As Integer,
stoploss As Double,
takeprofit As Double,
comment As String,
expiration As DateTime
) As Order
public:
Order^ OrderSend(
String^ symbol,
Op operation,
double volume,
double price,
int slippage,
double stoploss,
double takeprofit,
String^ comment,
DateTime expiration
)
member OrderSend :
symbol : string *
operation : Op *
volume : float *
price : float *
slippage : int *
stoploss : float *
takeprofit : float *
comment : string *
expiration : DateTime -> Order
Parameters
- symbol
- Type: SystemString
Symbol for trading. - operation
- Type: TradingAPI.MT4ServerOp
Operation type. - volume
- Type: SystemDouble
Number of lots. - price
- Type: SystemDouble
Preferred price of the trade. - slippage
- Type: SystemInt32
Maximum price slippage for buy or sell order. - stoploss
- Type: SystemDouble
Stop loss level. - takeprofit
- Type: SystemDouble
Take profit level. - comment
- Type: SystemString
Order comment text. Last part of the comment may be changed by server. - expiration
- Type: SystemDateTime
Order expiration time (for pending orders only).
Return Value
Type:
OrderOpened order.
ExceptionsException | Condition |
---|
ServerException | Check exception message for details. |
RequoteException | Server cannot execute order(instant execution) at specified price. Check exception fields for latest server price. |
TradeTimeoutException | No reply from server in TradeTimeout milliseconds. |
See Also