Optimization Type:
RSquared is the coefficient of determination.
The optimization performs simple linear regression of the equity curve by the least squares method to determine slope of a linear line. This linear regression line is then correlated with the equity curve by trade # to calculate r-squared. The closer to 1 the better the fit. I have wrote the code to only return result with positive net income.
I have pulled the following definition from Investopedia which provides a very good explanation.
What Does Coefficient of Determination Mean?
A measure used in statistical model analysis to assess how well a model explains and predicts future outcomes. It is indicative of the level of explained variability in the model. The coefficient, also commonly known as R-square, is used as a guideline to measure the accuracy of the model.
Investopedia explains Coefficient of Determination
One use of the coefficient of determination is to test the goodness of fit of the model. It is expressed as a value between zero and one. A value of one indicates a perfect fit, and therefore, a very reliable model for future forecasts. A value of zero, on the other hand, would indicate that the model fails to accurately model the dataset.
Copy file to directory ".../Ninja Trader 7/bin/custom/type/" and open up any indicator for editing and recompile. This optimization type will then show up in strategy analyzer.
Revision 0.12 - Uploaded 11/10/2011: Fixed error in calculation
Category NinjaTrader 7 Miscellaneous
|
|
|