objective function

Posted By: Ger1

objective function - 11/05/17 00:39

Can anyone explain how to implement the objective function?

I tried to optimize based on different performance metrics but the results don't make sense to me.

As an example I tried to find the value that maximizes R2:

var objective()
{
if(!NumWinTotal && !NumLossTotal) return 0.;
return ThisPerformance.vR2;
}

I also set(PEAK) and used Commission=Slippage=RollLong=RollShort=0;


The optimize chart shows that the best parameter has an R2 value of about .75.

However, running a test with this parameter results in a performance of R2 = 0.87.

I also tried to insert other parameter values and tested and have never been able to match test report with the optimize chart.


Can anyone shed some light on how to properly utilize the objective function?

Thanks.
Posted By: pascalx

Re: objective function - 11/05/17 16:35

In the include/default.c you will find an example implementation of the objective() function.
Posted By: jcl

Re: objective function - 11/06/17 08:55

The optimize chart shows the result over the range of a single parameter, while the test runs with the parameter combination that achieved the best result when PEAK was set.
© 2024 lite-C Forums