Download MetaTrader 5

Pending Order not working

To add comments, please log in or register
Marcelo Coutinho
1200
Marcelo Coutinho  

Good Afternoon,

Can someone please help me with the order below ?

This is the structure of my order. The script has no problem to run but when market reaches the price, the order is not triggered.

It is not clear to me if mrequest.stoplimit=1.25165 (above price) is correct or the number must be below 1.25155 (below price) 

Thank you. 

mrequest.action=TRADE_ACTION_PENDING;
mrequest.symbol=_Symbol;
mrequest.volume=1;
mrequest.price=1.25160;
mrequest.stoplimit=1.25165;
mrequest.sl=1.25150;
mrequest.tp=1.25220;
mrequest.type=ORDER_TYPE_BUY_LIMIT;
mrequest.type_filling=ORDER_FILLING_FOK;
mrequest.type_time=ORDER_TIME_GTC;
mrequest.comment="BUY LIMIT";
Rodrigo Malacarne
Moderator
10388
Rodrigo Malacarne  
YouTrade:

Good Afternoon,

Can someone please help me with the order below ?

This is the structure of my order. The script has no problem to run but when market reaches the price, the order is not triggered.

It is not clear to me if mrequest.stoplimit=1.25165 (above price) is correct or the number must be below 1.25155 (below price) 

Thank you. 

Are you trying to send a ORDER_TYPE_BUY_LIMIT or ORDER_TYPE_BUY_STOP_LIMIT ?

Buy limit orders do not have a trigger price ... 

Marcelo Coutinho
1200
Marcelo Coutinho  
Malacarne:

Are you trying to send a ORDER_TYPE_BUY_LIMIT or ORDER_TYPE_BUY_STOP_LIMIT ?

Buy limit orders do not have a trigger price ... 

It is ORDER_TYPE_BUY_LIMIT;

Unfortunatelly it is not clear to me the function of mrequest.stoplimit in this context.

Do you mind if I kindly ask you for an example ?

Regards,

MRC 

Rodrigo Malacarne
Moderator
10388
Rodrigo Malacarne  
YouTrade:

It is ORDER_TYPE_BUY_LIMIT;

Unfortunatelly it is not clear to me the function of mrequest.stoplimit in this context.

Do you mind if I kindly ask you for an example ?

Regards,

MRC 

Sure ... mrequest.stoplimit has absolutely no effect on ORDER_TYPE_BUY_LIMIT.

You can simply delete it from your request.

Marcelo Coutinho
1200
Marcelo Coutinho  
Malacarne:

Sure ... mrequest.stoplimit has absolutely no effect on ORDER_TYPE_BUY_LIMIT.

You can simply delete it from your request.

Thank you ... so when do I have to use it ?
Rodrigo Malacarne
Moderator
10388
Rodrigo Malacarne  
YouTrade:
Thank you ... so when do I have to use it ?

For ORDER_TYPE_BUY_STOP_LIMIT or ORDER_TYPE_SELL_STOP_LIMIT orders .

Marcelo Coutinho
1200
Marcelo Coutinho  
Malacarne:

For ORDER_TYPE_BUY_STOP_LIMIT or ORDER_TYPE_SELL_STOP_LIMIT orders .

Thank you
To add comments, please log in or register