A simple addition of profits not working ...

 

Hello everybody,

I found an indicator on this website usefull to me because it displays all the opening positions on the chart. Usefull when you have an expert that open many position at the same time.

Any way it works well but I needed to modify a bit the code in order to display the profits with their entire amount ( 2 numbers after comma). 

The developper decided to not show the numbers after comma so I changed it. My expert trades only small sizes lot.

It works well for all the trades in the opening position list but it does not make correctly the addition at the top the list.

I don't understand why because the formula works perfectly for the lot sizes ( 2 numbers after comma are correctly added in the formula) but not for the profit...

Any one has an idea why please ?



I put screen-shots to understand clearly the matter and the code that I have modify.

first screen shor is the original one, second is mine.

Files:
orginal.PNG  25 kb
code.total.PNG  13 kb
code_total.mq4  11 kb
 

Line 48.

//int buys_profit = 0.0, sells_profit = 0.0;
double buys_profit = 0.0, sells_profit = 0.0;
 

Lol, I spend 3 or 4 hours trying to see where could be the difference.

Amazing it works perfectly.

Thank you very much Naguisa Unada.

Reason: