Hi Eric
I suggest that you take a slightly different approach when creating your indicator. I always include the full pathname when I use the security function. This means that the security called will be found even when I have a chart from a different folder open. Beware, though, because a tiny mistake in the pathname will cause the indicator to fail.
The second thing I suggest is to assign a variable name to each security call, as in the example below. This makes it much easier to check that each security call is working properly. In my example I can change the line that reads...
S1:=Security("C:\Equis\Stocks\World Indices\$DJ",C); {DJIA}
to
S1:=Security("C:\Equis\Stocks\World Indices\$DJ",C); {DJIA} S1;
This then plots the "S1" variable and tells me that either the expression works correctly or it doesn't work. This method of breaking a complex expression into simpler blocks usually makes finding a fault much easier. Once each building block (forex Security() call) has been check and is working correcly you can move on to creating and checking the main calculation.
Whatever calculations are included in the Security() function (outside " ") relate to prices or indicators from the called security, which is probably not the currently active chart.
My thinking is that a complex formula that's broken down into small and simple steps is easier to troubleshoot than a formula that's just one big unnamed variable. Hope this helps you solve your problem (do not try to make the indicator below plot unless the pathename for each security is changed first).
Roy
{Alpha Updated}
{Roy Larsen, 2009}
{User settings}
N:=Input("Alpha Updated, periods",1,100,21);
X:=Input("Index, 1=DJIA 2=US$ 3=FTSI 4=HS 5=SPX",1,5,1);
{Referenced index options}
S1:=Security("C:\Equis\Stocks\World Indices\$DJ",C); {DJIA}
S2:=Security("C:\Equis\Stocks\World Indices\$DX",C); {US Dollar}
S3:=Security("C:\Equis\Stocks\World Indices\$FT",C); {FTSI 100}
S4:=Security("C:\Equis\Stocks\World Indices\$HS",C); {Hang Seng}
S5:=Security("C:\Equis\Stocks\World Indices\$SP",C); {S&P 500}
I:=If(X=1,S1,If(X=2,S2,If(X=3,S3,If(X=4,S4,S5))));
{Beta}
P1:=N*Sum(ROC(C,1,%)*ROC(I,1,%),N);
P2:=Sum(ROC(C,1,%),N)*Sum(ROC(I,1,%),N);
P3:=N*Sum(Pwr(ROC(I,1,%),2),N)-
Pwr(Sum(ROC(I,1,%),N),2);
B:=(P1-P2)/(P3+(P3=0));
{Alpha}
(Sum(ROC(C,1,%),N)-B*Sum(ROC(I,1,%),N))/N;