help with trade condition

 

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
 
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. 

 
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)