Download MetaTrader 5
To add comments, please log in or register
Find out how social trading can improve your profits
dolar
22
dolar 2014.05.07 19:00 
Hello Guys,

Do you know any solution which allows save to an array:
- an account balance (as balance1) before trade and
- an account balance (as balance2) after trade?

How to check AccountBalance() every time when OrdersHistoryTotal() changes?

Thanks.
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.05.07 23:58  
Store the value using Global Variables. Retrieve it when needed.
Alain Verleyen
Moderator
28701
Alain Verleyen 2014.05.08 10:30  
dolar:
Hello Guys,

Do you know any solution which allows save to an array:
- an account balance (as balance1) before trade and
- an account balance (as balance2) after trade?

How to check AccountBalance() every time when OrdersHistoryTotal() changes?

Thanks.
   static int previousHistoryTotal=0;
   
   if(OrdersHistoryTotal()!=previousHistoryTotal)
   {
      // Check your account balance
      ...
      previousHistoryTotal=OrdersHistoryTotal();
   }
qjol
3243
qjol 2014.05.08 10:47  
using OrdersHistoryTotal can be a problem unless you make sure you selected to show all history
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.05.08 10:53  
Its got even worst when there are brokers that truncate the order history.
/
To add comments, please log in or register