Last account balance
Hello,
I'm blocking on a code.
I wish the ea keeps in memory the last highest balance, here is my code but it does not work, can you help me?
double highestbalance() { static double highestbalance1=1000; if ( AccountBalance() > (highestbalance1 )) highestbalance1 = AccountBalance(); return(highestbalance1); }
what if computer shuts down or crashes and we need to reinstall the MTx?
Hi, I just read your comment and there are actually a couple of solutions for that:
1) the easiest solution is to use a Global Variable of the client terminal (see this article https://www.mql5.com/en/docs/globals). These are variable that (unlike normal global variables) are kept in the platform for up to 4 weeks, so if the platform shuts down you will not lose the variable. This is something specific of Mql5.
2) another solution would be to store and retrieve the variable from a file.
Regards
- www.mql5.com
Hello,
I'm blocking on a code.
I wish the ea keeps in memory the last highest balance, here is my code but it does not work, can you help me?