How to get the sectors names

Hello,

I am using the below code ( Credits to the original developer @fxshrat . How to get the sector names in the below code what parameters should be changed? In one sector there are so many industries

image

WatchlistName = ParamList("WatchList", "Auto,Bank");
wlnumber = CategoryFind(WatchlistName, cat = categoryWatchlist); 
list = Name() + "," + CategoryGetSymbols(cat, wlnumber);

I tried this

SectorlistName = ParamList("Sectors", "FERTILISERS & PESTICIDES");
slnumber = CategoryFind(SectorlistName, Scat = categorySector); 
list2= Name() + "," + CategoryGetSymbols(Scat, slnumber);

Now i have two lists how to change the below code?

for ( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
    SetForeign( sym );

    rs = getrs( C, 1 );
    rm = getrs( C, 0 );

    for ( ii = BarCount - tbar; ii < BarCount; ii++ )
    {
        drawpos( rs[ ii ], rm[ ii ], sym, WriteIf( ii == BarCount - 1, sym, "" ) );
    }

    RestorePriceArrays( True );
}

Thank you

How about CategoryGetName

http://www.amibroker.com/guide/afl/categorygetname.html

1 Like

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