Hi
I go on with my purpose: to obtain accurate results from the walk
forward analysis. I think I've got it: this is the code that inserts
the optimal values of two variables into a standard analisys in-sample:
for( i = 0; i < BarCount; i++ )
{
n=DateNum ();
switch (n[i])
{
case (n[i] >= 1080901): stop=6; profit=5.5; break;
case (n[i] >= 1080501): stop=3; profit=2.5; break;
case (n[i] >= 1080101): stop=6;profit=3; break;
case (n[i] >= 1070901): stop=5.5; profit=3.5; break;
case (n[i] >= 1070501): stop=6; profit=2; break;
case (n[i] >= 1070101): stop=2; profit=3.5; break;
case (n[i] >= 1060901): stop=3.5; profit=2; break;
case (n[i] >= 1060501): stop=4; profit=2.5; break;
case (n[i] >= 1060101): stop=4; profit=2.5; break;
case (n[i] >= 1050901): stop=3.5; profit=2.5; break;
case (n[i] >= 1050501): stop=4; profit=3; break;
case (n[i] >= 1050101): stop=10; profit=10; break;
case (n[i] >= 1040901): stop=2; profit=2; break;
case (n[i] >= 1040501): stop=2; profit=6; break;
case (n[i] >= 1040101): stop=5; profit=2.5; break;
default:
stop=3; profit=2.5;printf("Stops optimos"); break;
}
/* Here, rest of the code, with sell, stops etc...*/
As you can see, as the date advance, the stops and profits change with
the values obtained in a Walk forward. This way, I can do analytical
work with accurate results..
The problem is that this code is very slow.
Any idea to improve it?
Thanks