Custom Code scripting

Hi, I am trying to add three custom breadth code outcomes using the switch function - first variable being = 1 and second = 0. I am not able to create any output for the following script - Custom Code XLEBT - I am trying to add the 3 codes for each sector.

//ADP (I used the Adv Dec Percent breadth function)
C1 = XLEADP:Market Breadth;
MA1 = MA(C1, BARS=10, STYLE=Exponential, CALC=Close);
V1 = CLOSE(MA1) > 30;
V2 = CLOSE(MA1) < -30;
V3 = SWITCH(V1,V2);

//HLP (I used the Adv Dec Percent breadth function)
C2 = XLEHLP:Market Breadth
V4 = CLOSE(C2) > 10;
V5 = CLOSE(C2) < -10;
V6 = SWITCH(V4,V5);

//%200 ( I used the Percent breadth function) 
C3 = XLE200:Market Breadth; 
V7 = CLOSE(C3) > 60;
V8 = CLOSE(C3) < 40;
V9 = SWITCH(V7,V8);

V3 + V6 + V9

I have tried adding 'change to 1" to the switch functions and
I also used “Getdata” function for the “C” variables. I do get values for these individual scripts in watchlists.

Thanks, Jamie

Thanks Jamie - I’m not getting any values either so we’ll have to look in to how the mutliple Switch functions are being handled in the Custom Code. However, if you use the following in a Show View it seems to calculate correctly:

//ADP (I used the Adv Dec Percent breadth function)
C1 = GETDATA(CODE=XLEADP:Market Breadth);
MA1 = MA(C1, BARS=10, STYLE=Exponential, CALC=Close);
V1 = CLOSE(MA1) > 30;
V2 = CLOSE(MA1) < -30;
V3 = SWITCH(V1,V2);

//HLP (I used the Adv Dec Percent breadth function)
C2 = GETDATA(CODE=XLEHLP:Market Breadth);
V4 = CLOSE(C2) > 10;
V5 = CLOSE(C2) < -10;
V6 = SWITCH(V4,V5);

//%200 ( I used the Percent breadth function) 
C3 = GETDATA(CODE=XLE200:Market Breadth); 
V7 = CLOSE(C3) > 60;
V8 = CLOSE(C3) < 40;
V9 = SWITCH(V7,V8);

V3 + V6 + V9

Note you can use the same formula in a custom colour scheme to be green when V3 + V6 + V9 ==3 and red for 0:

Capture