Code:
SectorIndexUS = IIf(InGics(“10”),Foreign(“$SPXE”,”C”),
IIf(InGics(“15”),Foreign(“$SPXM”,”C”),
IIf(InGics(“20”),Foreign(“$SPXI”,”C”),
IIf(InGics(“25”),Foreign(“$SPXD”,”C”),
IIf(InGics(“30”),Foreign(“$SPXS”,”C”),
IIf(InGics(“35”),Foreign(“$SPXA”,”C”),
IIf(InGics(“40”),Foreign(“$SPXF”,”C”),
IIf(InGics(“45”),Foreign(“$SPXT”,”C”),
IIf(InGics(“50”),Foreign(“$SPXL”,”C”),
IIf(InGics(“55”),Foreign(“$SPXU”,”C”),Foreign(“$SPXR”,”C”)))))))))));
SectorIndexAUS = IIf(InGics(“10”),Foreign(“$XEJ.au”,”C”),
IIf(InGics(“15”),Foreign(“$XMJ.au”,”C”),
IIf(InGics(“20”),Foreign(“$XNJ.au”,”C”),
IIf(InGics(“25”),Foreign(“$XDJ.au”,”C”),
IIf(InGics(“30”),Foreign(“$XSJ.au”,”C”),
IIf(InGics(“35”),Foreign(“$XHJ.au”,”C”),
IIf(InGics(“40”),Foreign(“$XFJ.au”,”C”),
IIf(InGics(“45”),Foreign(“$XIJ.au”,”C”),
IIf(InGics(“50”),Foreign(“$XTJ.au”,”C”),
IIf(InGics(“55”),Foreign(“$XUJ.au”,”C”),Foreign(“$XPJ.au”,”C”)))))))))));