Back tester profit factor bug or is it me again?

 
I have had weird results poping up in the profit factor column of the bac tester results. I read that there should be at least 30 trades before results can be calculated correctly but shouldn't the system just leave the table empty rather than put some values in the boxes at random? Also it seems to have fallen over in this test. I don't know if my program has caused it or if the results are valid because of the weird display. Any help would be appreciated.

 
Ruptor:
I have had weird results poping up in the profit factor column of the bac tester results. I read that there should be at least 30 trades before results can be calculated correctly but shouldn't the system just leave the table empty rather than put some values in the boxes at random? Also it seems to have fallen over in this test. I don't know if my program has caused it or if the results are valid because of the weird display. Any help would be appreciated.

You can refer to the actual calculation being done in the article 'How to Evaluate the Expert Testing Results' -> https://www.mql5.com/en/articles/1403.

if(GrossLoss<0.0) GrossLoss*=-1.0;
...
//---- profit factor
   if(GrossLoss>0.0) ProfitFactor=GrossProfit/GrossLoss;

Where - GrossProfit is a summation of the profit of all results with profit > 0, GrossLoss ... with profit < 0.


So in theory, if u have a result that lost 0.01 while all other results won thousands - ProfitFactor would indeed have a ridicules value.

 
So you are saying it is a bug then like not handling divide by zero. I think the bug is far worse though because if you look at the next profit factor there is a value coincidently following the bad calculation. It sort of smacks of the bad value corrupting the next calculation and they should be independant. It's not the first time I have seen this.
 
Ruptor:
So you are saying it is a bug then like not handling divide by zero. I think the bug is far worse though because if you look at the next profit factor there is a value coincidently following the bad calculation. It sort of smacks of the bad value corrupting the next calculation and they should be independant. It's not the first time I have seen this.

I'm not sure if this should be considered a bug. My only point is that from the code you can see how it's possible to get a very large profit factor. Note though that the code in that article is pretty old and I know for a fact that some of it has changed since that article was written (for example the drawdown calculation is done differently in current version).

There is a way to gain more insight into this matter: if u can run both those results as normal Tests and get the values of gross loss and gross profit from the report (or better yet, if u can just publish the full reports here)... We can then see if my theory is correct.

Reason: