- Pending order questions
- Pending order using OrderSend
- How to protect my account from huge losses?
Hello!
Yes, use the following function:
OrderSend The main function used to open market or place a pending order. int OrderSend( string symbol, // symbol int cmd, // operation double volume, // volume double price, // price int slippage, // slippage double stoploss, // stop loss double takeprofit, // take profit string comment=NULL, // comment int magic=0, // magic number datetime expiration=0, // pending order expiration color arrow_color=clrNONE // color );
While cmd
[in] Operation type. It can be any of the Trade operation enumeration.
Order Properties
Operation type for the OrderSend() function. It can be any of the following values:
ID | Value | Description |
OP_BUY | 0 | Buy operation |
OP_SELL | 1 | Sell operation |
OP_BUYLIMIT | 2 | Buy limit pending order |
OP_SELLLIMIT | 3 | Sell limit pending order |
OP_BUYSTOP | 4 | Buy stop pending order |
OP_SELLSTOP | 5 | Sell stop pending order |
Yes, use the following function:
While cmd
[in] Operation type. It can be any of the Trade operation enumeration.
Order Properties
Operation type for the OrderSend() function. It can be any of the following values:
ID | Value | Description |
OP_BUY | 0 | Buy operation |
OP_SELL | 1 | Sell operation |
OP_BUYLIMIT | 2 | Buy limit pending order |
OP_SELLLIMIT | 3 | Sell limit pending order |
OP_BUYSTOP | 4 | Buy stop pending order |
OP_SELLSTOP | 5 | Sell stop pending order |
hello Mohammad!
Thank you for responding. I am new to programmig EAs. May i know where do i copy and paste this? Metaquotes Editor?
hello Mohammad!
Thank you for responding. I am new to programmig EAs. May i know where do i copy and paste this? Metaquotes Editor?
Yes from there

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use