Download MetaTrader 5

Place Pending Order once certain Price reached

To add comments, please log in or register
supercallim
174
supercallim  
Hello!

Does MT4 have this function where, once a certain Price is met, a Pending Order will be then placed (Limit Order or Stop Order)?

Thank you all!
Mohammad Soubra
30745
Mohammad Soubra  
supercallim:
Hello!

Does MT4 have this function where, once a certain Price is met, a Pending Order will be then placed (Limit Order or Stop Order)?

Thank you all!

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

supercallim
174
supercallim  
Mohammad Soubra:

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?

Mohammad Soubra
30745
Mohammad Soubra  
supercallim:



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
Just press F1
Or visit
Book.mql4.com
supercallim
174
supercallim  
Mohammad Soubra:
Yes from there
Just press F1
Or visit
Book.mql4.com

Thank you so much!! That is great!! :)

I appreciate your help so much!
Mohammad Soubra
30745
Mohammad Soubra  
supercallim:

Thank you so much!! That is great!! :)

I appreciate your help so much!
Great
To add comments, please log in or register