[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] turning in-sample analysis into out-of-sample



PureBytes Links

Trading Reference Links

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



------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/