Here I am again after some testing has been done. Certainly it works better now, but no completely fine. Let me show you my results.
Test conditions:
Automatic trades instead of manual ones. I used a different EA opening trades an then, on a separate chart, the pipcounter EA. Obviously the same magic number was used on all of them.
A total of 5 charts were used simultaneously, all of them having different point rules.
No previous closed trades were available for the test. That means the number of pips for closed trades at the beginning was exactly 0.
And this was the outcome. After a few hours, three trades were closed, with the following results:
0_1515582302991_001.png
These are the numbers. The USDJPY trade was closed with a positive 5.5 pips. The first JP225 trade was closed with a negative 10 pips an the second one with a negative 26 pips. That means the overall resul for closed pips should be 5.5 - 10 - 34 = -38.5 pips.
Sadly, this is what I got:
0_1515582608140_002.png
This is a screenshot including a fourth open trade correctly counted, as you can see. The problem is, once again, the count of closed pips. At first glance, the number shown (506) seemps completely random, but then I tried to figure out why it was so. This is my bes guess of how it was counted:
550 pips for the positive USDJPY trade minus 10 pips for the first JP225 and minus 34 for the second equals exactly 506.
That means that both JP225 trades were correctly counted once closed, but that was not the case with the USDJPY that was multiplied by 100. Then I took a look at the point rules for three digit charts and I confirmed that they were 0.001 = 0.01. And this is not the correct result.
Any idea why the EA is only partially counting pips correctly?