Hi,
I have some problem with use function StaticVarGenerateRanks and compose own indicator bases on ranking. Below my formula, I can do ranking and generate chart (Plot), but i need to save datas in separatly symbols (i.e. ~turn). Have you any idea, how can do it ? I tried to use AddToComposite but it work not properly.
symlist = CategoryGetSymbols( categoryMarket, 1);
StaticVarRemove("SortFund*");
StaticVarRemove("RankSortFund*");
for( i = 0; ( sym_fund = StrExtract( symlist, i ) ) != ""; i++ )
{
SetForeign(sym_fund);
Value_f = V*C;
RestorePriceArrays();
StaticVarSet( "SortFund" + sym_fund, Value_f);
}
StaticVarGenerateRanks( "rank", "SortFund", 0, 1224 );
for (j = 0; j < BarCount; j++)
{
for( i = 0; ( sym_fund = StrExtract( symlist, i ) ) != ""; i++ )
{
rank = StaticVarGet("rankSortFund" + sym_fund);
ind = StaticVarGet("SortFund" + sym_fund);
if ( rank[j] == 15)
turn[j] = ind[j];
}
}
Plot(turn,"sort", colorred, styleLine);
Marcin B