Help with error 5 for corresponding symbol


#include_once "Formulas\Norgate Data\Norgate Data Functions.afl"

indexSymbol = NorgateIndustryIndexCorresponding ("$SP1500",4,"PR");
indexSymbolName = GetFnDataForeign("FullName",indexSymbol);

Filter = 1;

AddTextColumn (indexSymbol, "Index Symbol");
AddTextColumn  (indexSymbolName, "Index Name");```

I tried NUMTOSTR but it didn't work either. Please advise how can I resolve the error 5. If a watchlist has 2,000 stocks, it stops in between. I am using Amibroker Version 6.2 with Norgate Data.

@applet, try this snippet:

// #pragma maxthreads 1
#include_once "Formulas\Norgate Data\Norgate Data Functions.afl"

indexSymbol = NorgateIndustryIndexCorresponding( "$SP1500", 4, "PR" );
indexSymbolName = GetFnDataForeign( "FullName", indexSymbol );

Filter = 1;

// _TRACE(NAME());

// _TRACE(typeof(indexSymbol));
// _TRACE(indexSymbol);
// _TRACE(typeof(indexSymbolName)); // this returns a number when indexSymbol is n/a
if( typeof( indexSymbolName ) == "number" )
    indexSymbolName = "n/a";

AddTextColumn( indexSymbol, "Index Symbol" );
AddTextColumn( indexSymbolName, "Index Name" );

The commented lines are the ones I used to figure out/debug the issue.

3 Likes

Thanks @beppe for your help with this. Commented lines also help me to navigate this in future.

1 Like

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