Overloading Amibroker? Three exact backtests return three different performance results

Is it possible to have a database so large that it breaks Amibroker? Here is what's happening. We have built a 90+GB database of all US stocks at a 1min interval for the past 13 years. When we run a particular intraday strategy more than once, back-to-back, without changing any parameters or settings Amibroker will return different backtest results. Just this morning I have run it three different times and I got three different results. To note, this backtest machine has 64gb of RAM and 1tb SSD harddrive. I can see through the performance monitor that I am not able to cache all of the symbols. Have we stretched the limits of Amibroker? Any insight would be appreciated!

The machine has an i9-9900 processor.

Also to note, we have daily common shares outstanding as a separate symbol for each stock so that we can calculate market cap. We calculating market cap like this:

myClose = Close;

if (UseMktCap)
{
	SetForeign(Name() + "_QTCO", True);
	MktCap = Close * myClose;
	RestorePriceArrays();

	bMktCap = Ref(MktCap,-1) >= MinMktCap;
	printf("MktCap: " + NumToStr(MktCap, 1.0) + "\n");
}
else
{
	bMktCap = 1;
}

Through further testing, when not using the above "UseMktCap" Amibroker returns the same results with every backtest. So is there something wrong with the way that I have constructed the market cap filter?

Check this: http://www.amibroker.com/kb/2014/05/07/why-do-backtest-results-change/

Also when using SetForeign you have to make sure that in-memory cache defined in Preferences is large enough to hold all symbols referenced by SetForeign.
Consider using Static variables instead of Foreign if you can not guarantee the above.

1 Like