Backtest Specific Sector(s) using AFL

Apologies for what is a basic question - but couldn't find an answer I could easily understand using Google and Forum search

Th main Amibroker application window allows us to manually set backtest filter settings under the 'green filter' icon - which opens the 'Filter settings' window.

How to I override these Application filters and set the Sector(s) / Group(s) / Industry(s) / Watchlist(s) etc to use for a backtest using AFL code?

For example, I use:

 Exclude = SectorID()!=11;	//Sector = 'Technology'

to limit the standard backtest to the 'Technology' Sector - but this only works if the main Amibroker window filter settings are set to 'test everything'. If the main filter is set to, say, Sector = 'Finance', then the AFL backtest produces no output. So the above AFL code is 'in addition to', and does not override the main window filter settings.

Would the AFL code be the same if the 'custom backtestor'; is used instead of the standard backtestor?

thanks, JonS

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.