> May I ask though why R-Squared differs and why and how it is calculated differently/better(?) in EA Studio / Express Generator?
The original R-squared formula uses sums of squares of bar numbers, balance values, and also bar*balance.
I'm afraid that when we use big data series with a large account (imagine account in JPY) the intermediate values can overload the number values of JavaScript. The program will not crash in such a case, but the calculated R-squared will not be correct. We may miss good strategies in case of overloading.
From a long time I'm thinking how to fix the problem without breaking changes and now, with Express Generator I solve it in a different way.
Instead of calculating R-squared on the original trade values, I'm using the scaled balance line what we see on the Balance chart in the EA Studio's Collection or Editor.
I do the following thing:
- scale the original balance line to 300 points.
- divide each value to the initial account. I receive 300 points from 1 to 3 for example (if the final balance is 3 times larger).
- calculate R on the given 300 points. It is safe to do it without overloading.
- Power R to 5 instead of 2. The original formula is R^2 (r-squared). However, I found out the numbers are reaching easily values to 95+ and then they are very near each other. For that reason, I'm using R^5 in EA Studio instead of R^2 to spread the values in the upper end. I'm using the same in Express Generator.
> Isn't there a way to unify it the calculation between both?
Yes, of course. It is completely possible. Let's see how the formula in Express Generator works. If it is fine, I'll apply it in EA Studio also.
It will be good to unify R-squared because all other parameters and stats match completely. I'm vary happy from that because the backtesting functions are very different in Express Generator. Thanks to that I noticed and fixed a lot of issues in EA Studio engine and indicators when compared the results.