I'm having trouble adding a watchlist to a composite when scanning another 
watchlist

I have a watch list will all the ProShare stocks in it called "U Pro All". I 
also have 10 other individual watchlist for each of ProShare Fund groups

What I want to do is only do one scan on the watchlist "U Pro All" to set up 
composites for each of the fund groups. When I do the scan it gets all the 
values in "U Pro All" and not from the other watchlist that I'm interested in.

The line of code that I'm having trouble with is:
if(CategoryGetName( categoryWatchlist, 6) == "U Market Cap")


Below is the code to scan the "U Pro All" watchlist. For simplification only 
two of the funds are being used from the watchlist
I also checked each watchlist number is correct.

//
// file Ultra_ProShare.afl
//
_SECTION_BEGIN("Utra Market Cap Composite setup");
 
// Add Ultra Proshare Market Cap to composite
if(CategoryGetName( categoryWatchlist, 6) == "U Market Cap")
{
  AddToComposite(RSI(12), "~RSI_UMC", "X" ); 
  AddToComposite( 1, "~RSI_UMC", "I" );

}
// Add Ultra Proshare Market Cap Short to composite
if(CategoryGetName( categoryWatchlist, 11) == "U Market Cap Short")
{
  AddToComposite(RSI(12) , "~RSI_UMCS", "X" ); 
  AddToComposite( 1, "~RSI_UMCS", "I" );

}
umc = IIf(CategoryGetName( categoryWatchlist, 6) == "U Market Cap", True,False);
"umc = "+WriteVal(umc);
umcs = IIf(CategoryGetName( categoryWatchlist, 11) == "U Market Cap Short", 
True,False);
"umcs = "+WriteVal(umcs);

Buy = 0; // required by scan mode

_SECTION_END();


The following code is to plot the each fund group. These files work fine if I 
scan them individually, but it's a pain to do 10 scans a day. 

//
// file Ultra_Market_Cap.afl
//
_SECTION_BEGIN("Utra Market Cap ");

Buy = 0; // required by scan mode

AddToComposite(RSI(12), "~RSI_UMC", "X" ); 

AddToComposite( 1, "~RSI_UMC", "I" );


Foreign_RSI_UMC = Foreign( "~RSI_UMC", "RSI UMC" )/Foreign( "~RSI_UMC", "I" );

Plot(Foreign_RSI_UMC, "Foreign RSI UMC", colorBlue, styleLine);

Plot(60,"",colorRed,styleLine);
Plot(30,"",colorBlack,styleLine);

_N( Title = "{{NAME}} - (Ultra Market Cap) {{VALUES}}" ); 

_SECTION_END();

//
// file Ultra_Market_Cap_Short.afl
//
_SECTION_BEGIN("Utra Market Cap Short");
/* this part is for Indicator */

Buy = 0; // required by scan mode

AddToComposite(RSI(12), "~RSI_UMCS", "X" ); 

AddToComposite( 1, "~RSI_UMCS", "I" );

Foreign_RSI_UMCS = Foreign( "~RSI_UMCS", "RSI UMCS" )/Foreign( "~RSI_UMCS", "I" 
);

Plot(Foreign_RSI_UMCS, "Foreign RSI UMCS ", colorBlue, styleLine);

Plot(60,"",colorRed,styleLine);
Plot(30,"",colorBlack,styleLine);

_N( Title = "{{NAME}} (Ultra Maket Cap Short)  {{VALUES}}" ); 

_SECTION_END();

Any help would be appreciated.

Reply via email to