Fail to write to aux1 and aux 2

Hi senior users,

Am using AB3.2 32bit.
I use add to composite for storing ranking data for different period. For OHLCVI fields no problem but my AFL failed to write to aux1 & 2 fields.

I try to test it using explore and the fields remain zero.

AddToComposite(8, "~CGW", "1");
AddToComposite(9, "~CGW", "2");

//AddtextColumn(fullName(), "ticker");
AddColumn(O,"rankingR4w");
AddColumn(H,"rankingR8w"); 
AddColumn(L,"rankingR12w"); 
AddColumn(C,"rankingR1y");
AddColumn(V,"rankingSd"); 
//
AddColumn(OI,"rar8w"); 
AddColumn(Aux1,"rar12w"); 
AddColumn(Aux2,"rar1y"); 
//SetSortColumns( -6 ); 


Filter = 1;

Appreciate if someone could help point to my problem.

Thanks for your help,

Default analysis run mode for AddToComposite is Scan.

So if you want to use it in Exploration instead then you have to adjust flags argument.

atcflags = atcFlagDefaults | atcFlagEnableInExplore;

AddToComposite(8, "~CGW", "1", atcflags);
AddToComposite(9, "~CGW", "2", atcflags);

//AddtextColumn(fullName(), "ticker");
AddColumn(O,"rankingR4w");
AddColumn(H,"rankingR8w"); 
AddColumn(L,"rankingR12w"); 
AddColumn(C,"rankingR1y");
AddColumn(V,"rankingSd"); 
//
AddColumn(OI,"rar8w"); 
AddColumn(Aux1,"rar12w"); 
AddColumn(Aux2,"rar1y"); 
//SetSortColumns( -6 ); 


Filter = 1;

100925

If you want to call Aux1 and Aux2 of ~CGW after creation then use foreign!

atcflags = atcFlagDefaults | atcFlagEnableInExplore;

AddToComposite(8, "~CGW", "1", atcflags);
AddToComposite(9, "~CGW", "2", atcflags);

//AddtextColumn(fullName(), "ticker");
AddColumn(O,"rankingR4w");
AddColumn(H,"rankingR8w"); 
AddColumn(L,"rankingR12w"); 
AddColumn(C,"rankingR1y");
AddColumn(V,"rankingSd"); 
//
AddColumn(OI,"rar8w"); 
AddColumn(Foreign( "~CGW", "1"),"rar12w"); 
AddColumn(Foreign( "~CGW", "2"),"rar1y"); 
//SetSortColumns( -6 ); 


Filter = 1;
5 Likes