I'm trying to do some mathematical equations within my EA , but the problem is one of equations requires the first number of account's balance . For example if the balance is 506.60 I want to get this value "5" , if it is 432.32 I want to get "4" . So how can it be done ?
Note : To get the current balance I use AccountBalance();
long value = StringToInteger (StringSubstr (DoubleToString (AccountBalance ( )), 0, 1));
int d = int( AccountBalance() / 100); // 4xx.xx/100=4.xxx 5xx.xx/100=5
To add comments, please log in or register