Andy: Here are some scanning formulas to compute Dahl(50) and the 21-day moving average of Dahl(50) in Quotes Plus. Amazingly enough, they give values identical to those in WOW.
Here's one for Dahl (it gives the most recent value and the previous value):
//Dahl by Brooke Elise Nagler
//mov(c,days,simp) - ref(mov(c,days,simp),-15)
output="dahl.lst"; //input="ibd.lst";
float a, b, c, d, dahl, prevdahl;
a := movavg(0,50,cl) ; b := movavg(-15,50,cl) ; c := movavg(-1,50,cl) ; d := movavg(-16,50,cl) ;
dahl := (a-b); prevdahl := (c-d);
println Symbol , "," , "dahl:", dahl , "," ,"prevdahl:", prevdahl;
And here is a formula to compute the 21-day moving average of Dahl:
//21-day MA of Dahl by Brooke Elise Nagler
output="dahlma.lst"; input="ibd.lst";
DaysToLoad=100;
integer j, k;
float f, i, l;
f:=0;
for j=0 to -20 step -1 do f := f + MovAvg(j,50,cl); next j;
i:=0;
for k=-15 to -35 step -1 do i := i + MovAvg(k,50,cl); next k;
l:=(f-i)/21;
println symbol , "," ,l;
And here is a loopy formula for finding when the 21-day MA of Dahl has just crossed up through 0;
//21-day MA of Dahl crossing up through 0 by Brook Elise Nagler
output="dahlup.lst"; //input="ibd.lst";
DaysToLoad=100;
integer j, k, l, o;
float f, i, m, p, dahlma, prevdama;
f:=0;
for j=0 to -20 step -1 do f := f + MovAvg(j,50,cl); next j;
i:=0;
for k=-15 to -35 step -1 do i := i + MovAvg(k,50,cl); next k;
//for previous day's dahl
m:=0;
for l=-1 to -21 step -1 do m := m + MovAvg(j,50,cl); next l;
p:=0;
for o=-16 to -36 step -1 do p := p + MovAvg(j,50,cl); next o;
dahlma := (f-i)/21; prevdama := (m-p)/21;
if dahlma>0 and prevdama<0 then println Symbol , "," , " dahlma:", dahlma , "," ," Close:", Close(0) , "," , " Vol:", vol(0) , " , " , " PE:", PE , " , " , " QRS:", QRS(0) , "," , " Sharesfloat:", Sharesfloat , "," , description; endif;
Brooke
: |