Download MetaTrader 5

help with trade condition

To add comments, please log in or register
Do you have Linux? Find out how to install MetaTrader on it!
sentinelx
44
sentinelx 2012.07.31 15:09 

Hello all,

I want to set a condition of opening a buy order which will be : open a 'buy' order only if the previous order was also 'buy'.

Can anyone assist me in setting this condition? 

Thanks in advance 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Trade Orders in DOM - Documentation on MQL5
Pieter Schalley
272
Pieter Schalley 2012.07.31 21:58  
sentinelx:

Hello all,

I want to set a condition of opening a buy order which will be : open a 'buy' order only if the previous order was also 'buy'.

Can anyone assist me in setting this condition? 

 

set a simple parameter,

ex: when you made buy: value = 1; when you made sell: value = 2
then when next signal arrises: check if value of parameter is 1 or 2.

reset parameter when it needs to be reset. 

sentinelx
44
sentinelx 2012.08.02 12:45  
Financialarts:

set a simple parameter,

ex: when you made buy: value = 1; when you made sell: value = 2
then when next signal arrises: check if value of parameter is 1 or 2.

reset parameter when it needs to be reset. 

Thanks a lot. But i instead used this condition for buy :- (Buy_opened==true)
To add comments, please log in or register