Amibroker closes when exploration run

I downloaded some code from the KB and when I use it to explore a watchlist amibroker closes

code below:

// watchlist should contain all symbols included in the test
wlnum = GetOption( "FilterIncludeWatchlist" );
List = CategoryGetSymbols( categoryWatchlist, wlnum ) ;

if( Status( "stocknum" ) == 0 )
{
    // cleanup variables created in previous runs (if any)
    StaticVarRemove( "rank*" );
    StaticVarRemove( "values*" );
    categoryList = ",";

    for( n = 0; ( Symbol = StrExtract( List, n ) )  != "";  n++ )
    {
        SetForeign( symbol );

        // use sectors for ranking
        category = GicsID();

        // add sector to the list
        if( ! StrFind( categoryList, "," + category + "," ) ) categoryList += NumToStr( category, 1, 0 ) + ",";

        // write our ranking criteria to a variable
        // in this example we will use 10-bar rate-of-change
        values = Roc( Close, 10 );
        
        RestorePriceArrays();

        // write ranked values to a static variable
        StaticVarSet( "values" + category + "_" + symbol, values );

    }

    // generate separate ranks for each category from the list
    for( i = 1; ( category = StrExtract( categoryList, i ) ) != ""; i++ )
    {
        StaticVarGenerateRanks( "rank", "values" + category + "_", 0, 1224 );
    }
}

category = sectorID();
symbol = Name();
m = Month();

values = StaticVarGet( "values" + category + "_" + symbol );
rank = StaticVarGet( "rank" + "values" + category + "_" + symbol );

// exploration code for verification
AddColumn( values, "values" );
AddColumn( rank, "rank" );
AddTextColumn( SectorID( 1 ), "Sector" );
AddColumn( SectorID(), "Sector No", 1 );
Filter = rank <= 2;

if( Status( "Action" ) == actionExplore ) SetSortColumns( 2, 5, 4 );

// sample backtesting rules
SetBacktestMode( backtestRotational );
score = IIf( rank <= 2, values, 0 );
// switch symbols at the beginning of the month only
PositionScore = IIf( m != Ref( m, -1 ), score, scoreNoRotate );
SetPositionSize( 1, spsPercentOfEquity );

You ought to post the link to the code.

In most cases, AB recovery window pops up:
https://www.amibroker.com/guide/x_bugrecovery.html
Doesn't this come up for you?

And while i'm writing this post, be more proactive stating details about AB Version, OS details and other things that are relevant and can be of use.

You know every one doesn't use the same specs as you do, right?

found the KB however I must have changed it slightly and that's probably the issue
http://www.amibroker.com/kb/2016/01/30/separate-ranks-for-categories-that-can-be-used-in-backtesting/

no pop up error occurs it just closes down
version 6.28.0 64 bit

@Colydog,
It looks like a "not enough memory available" issue (not saying it is the case...).
But how much RAM do you have?
Watch the memory developing in Windows task manager.

Besides https://www.amibroker.com/guide/x_performance.html

Since you are running 64-bit AB...
The developer of AB once mentioned that one should use 64-bit software only if having minimum 4GB of RAM. So if you have less than that try 32-bit AB instead.

1 Like

thanks

I run amibroker on parallels.. I will check my settings on parallel