StaticVarGetRankedSymbols
- retrieve a list of ranked symbols from static variables

Miscellaneous functions
(AFL 3.70)


SYNTAX StaticVarGetRankedSymbols( "outputprefix", "inputprefix", datetime )
RETURNS STRING
FUNCTION Retrieves the comma-separated list of symbols from static variables generated using StaticVarGenerateRanks. For more information see StaticVarGenerateRanks documentation.
EXAMPLE symlist = "C,CAT,DD,GE,IBM,INTC,MSFT";

// delete static variables
StaticVarRemove("ValuesToSort*");

// fill input static arrays
for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
{
SetForeign(sym );
Value =
ROC( C, 10 );
RestorePriceArrays();
StaticVarSet( "ValuesToSort" + sym, Value );
}

// perform ranking
StaticVarGenerateRanks( "rank", "ValuesToSort", 0, 1224 ); // normal rank mode
StaticVarGenerateRanks( "top", "ValuesToSort", 3, 1224 ); // top-N mode
StaticVarGenerateRanks( "bot", "ValuesToSort", -3, 1224 ); // bottom-N mode
// read ranking
for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
{
Plot( StaticVarGet( "RankValuesToSort" + sym ), sym, colorCustom10 + i );
}

sdt =
SelectedValue( DateTime() );
Title = "{{NAME}} -{{DATE}} - {{VALUES}} TOP: " + StaticVarGetRankedSymbols( "top", "ValuesToSort", sdt ) +
" BOT: " + StaticVarGetRankedSymbols( "bot", "ValuesToSort", sdt ) ;
SEE ALSO StaticVarGenerateRanks() function

References:

The StaticVarGetRankedSymbols function is used in the following formulas in AFL on-line library:

More information:

Updated on-line reference