Download MetaTrader 5
To add comments, please log in or register
Do you know C++? MQL5 has much in common with it. Just try it yourself!
Arav007
412
Arav007 2014.03.19 19:50 

I have been trying to get the 'Last Closed Order' from 'History' of closed trades but not getting things done correctly.

My EA will open 3 trades simultaneously and when the third trade will be closed, i.e. there wont be any trade left (Buy/Sell)

and if the Trade_after_SL==TRUE, the EA will look for the third trade whether it got closed or not. If it got closed and the

conditions for opening that trade is still 'Valid' then it'll open just a 'Single' trade.

Like if the Last closed trade was a 'Buy' trade and still the conditions for 'Buying' are valid, then it'll open A New 'Buy' trade.

I tried to use the 'OrdersHistoryTotal()' but it hasn't worked.

qjol
3243
qjol 2014.03.19 20:08  
Arav007:


My EA will open 3 trades simultaneously and when the third trade will be closed, i.e. there wont be any trade left (Buy/Sell)


then why use OrdersHistoryTotal ? use OrdersTotal

if (OrdersTotal == 0)
   Do your thing
Arav007
412
Arav007 2014.03.19 20:11  
qjol:

then why use OrdersHistoryTotal ? use OrdersTotal


For that part (opening 3 trades) there is function too.

You probably haven't gone through the whole code yet.

qjol
3243
qjol 2014.03.19 20:59  
i haven't read the code at all just read what you wrote
/
To add comments, please log in or register