hi, i have been trying by myself but i am not able so I would like to ask for help to this great community. I want to use ratios for multiple securities in exploration, ratios which I build using the classic formula :

ratio = Foreign("Symbol1", "C") / Foreign("Symbol2", "C");

The way I determine the denominator is by using two methods:

- depending on the watchlist to which it belongs. eg:

if ( InWatchList ( 1 ) ) Symbol2 = "SPY" ;

- or directly stating the formula:

if( Name( ) == "Symbol1" ) Symbol2 = "SPY" ;

My problem is when I want to pass an exploration using more than one ratio for any symbol as numerator. For example, let´s suppose that I want to use two ratios with XLF as numerator in an exploration. One ratio would be using the denominator SPY and the other ratio using the denominator BND(or whatever).

Taking into account the two methods that I use, I am not able to make it. I have been trying to use the formula CategoryGetSymbols but I cannot succesfully make it. What i would like is to tell Amibroker to go throgh an exploration with all the components of a watchlist1 (for eg. wl #6), creating ratios with all components of the watchlist , and then, go sequentially to another watchlist2 (e.g. wl #7 and create new ratios with all componets of the watchlist that also would participate in the exploration.

This way, if I have one symbol which is a component of both watchlist 6 and 7, it will be explored as two different ratios. The way i thoght of doing this was using the formula "CategoryGetSymbols"

listnum =6;

if( InWatchList ( 6 )) {

// retrive comma-separated list of symbols in watch list

list = CategoryGetSymbols( categoryWatchlist, listnum )

for( i = 0; ( sym1 = StrExtract( list, i ) ) != ""; i++ )

{

f = Foreign( sym1, "C" );

}

Denominador = "SPY" ;

DenominadorC = Foreign (Denominador,"C") ;

ratC = f/ DenominadorC ;

AddColumn(ratC,"ratioC",1.5);

}

but i cannot make it . i have been investigating if StaticVar would be a solution, but sincerely, I cannot figure it out.

What I would like to do is to force the exploration to go SEQUENTIALLY through LIST 6 and then through LIST 7 creating different ratios for exploration with all the components of both lists, duplicating the common components of both lists. I would pass the exploration to a list with all the securities of 6+7. At the moment, the only way I can do it is by creating AddtoComposites that duplicate the security that i want to explore in two ratios, so it would be like this:

if( Name( ) == "Symbol1" ) Symbol2 = "SPY" ;

if( Name( ) == "~ Symbol1_1" ) Symbol2 = "BND" ;

I hope that I explained myself, thanks for your attention and help,