SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus -- Ignore unavailable to you. Want to Upgrade?


To: TechTrader42 who wrote (9083)3/21/1999 1:44:00 PM
From: TechTrader42  Respond to of 11149
 
In other words, we need a way to find the maxium high of these values
below, for example. "Where there's a dll, there's a way," as they say.

DELL 03/19/1999 AIQ Volatility Indicator: 53.90
DELL 03/18/1999 AIQ Volatility Indicator: 51.45
DELL 03/17/1999 AIQ Volatility Indicator: 59.22
DELL 03/16/1999 AIQ Volatility Indicator: 58.28
DELL 03/15/1999 AIQ Volatility Indicator: 72.10
DELL 03/12/1999 AIQ Volatility Indicator: 73.18
DELL 03/11/1999 AIQ Volatility Indicator: 73.00
DELL 03/10/1999 AIQ Volatility Indicator: 74.90
DELL 03/09/1999 AIQ Volatility Indicator: 76.35
DELL 03/08/1999 AIQ Volatility Indicator: 76.04
DELL 03/05/1999 AIQ Volatility Indicator: 74.53

//AIQ Volatility Indicator,
//translated by Brooke
//from Jan Robert Wolensky's Metastock version
//with Square Root and Log formulas by Jeff Grover, Bob Jagow
//100*(Sqrt(12.5*
//(Sum((Log(C/Ref(C,-1))*Log(C/Ref(C,-1))),21)-
//((Sum(Log(C/Ref(C,-1)),21)*Sum(Log(C/Ref(C,-1)),21)))/21)))
//100*(Sqrt(12.5*
//(Sum((Log(C/Ref(C,-1))*Log(C/Ref(C,-1))),21)-
//((Sum(Log(C/Ref(C,-1)),21)*Sum(Log(C/Ref(C,-1)),21)))/21)))
//AIQ Volatility Indicator, translated for QP2 by Brooke
input="volvol.lst";
output="volatility.lst";
daystoload=500;
float x,xx,n,n3,n5,n7,n9,n11,n13,n15,lnx,sumlnx,sumlnxlnx,
sumlnxsumlnx,formula1,in,out,fx,xxx,period,formula2;
integer i,j,k;
period:=21;

for k= 0 to 10 do
sumlnx:=0;
sumlnxlnx:=0;

for i=-(period-1) to 0 step 1 do
//Jeff Grover's log formula
//for k= 0 to 1 do
x:=close(i-k)/close((i-1)-k);
if x >= 100000 then xx := x /100000; else
if x >= 10000 then xx := x / 10000; else
if x >= 1000 then xx := x / 1000; else
if x >= 100 then xx := x / 100; else
if x >= 10 then xx := x / 10; else
xx := x; endif; endif; endif; endif; endif;
n :=(xx-1)/(xx+1); n3 :=n*n*n; n5 :=n3*n*n;
n7 :=n5*n*n; n9 :=n7*n*n; n11 :=n9*n*n;
n13 :=n11*n*n; n15 :=n13*n*n;
lnx := 2*(n+n3/3+n5/5+n7/7+n9/9+n11/11+n13/13+n15/15);
if x >= 100000 then lnx := lnx + 11.51293; else
if x >= 10000 then lnx := lnx + 9.21034; else
if x >= 1000 then lnx := lnx + 6.90776; else
if x >= 100 then lnx := lnx + 4.60517; else
if x >= 10 then lnx := lnx + 2.30258;
endif; endif; endif; endif; endif;
//next k;
sumlnx:= sumlnx+lnx;
sumlnxlnx:=sumlnxlnx+(lnx*lnx);
next i;
sumlnxsumlnx:=sumlnx*sumlnx;
formula1:=12.5*(sumlnxlnx-(sumlnxsumlnx/period));
//Square root formula by Jeff Grover, Bob Jagow
in := formula1;
xxx := 1.0;
fx := 1.0;
for j = 0 to 9 step 1 do
xxx := xxx - fx/(2*xxx);
fx := xxx*xxx - in;
next j;
out := xxx;
println symbol:-5, " ", date(-k), " ", "AIQ Volatility Indicator: ", " ", 100*out:6:2;
next k;



To: TechTrader42 who wrote (9083)3/23/1999 9:59:00 AM
From: unixgeek  Read Replies (1) | Respond to of 11149
 
Re: square roots. I didn't see this actual algorithm in your post,
so I thought I'd forward it to the group in case anyone else wanted
to play around with square roots. I can generalize this into any
arbitrary root (cube, 4'th, whatever) if anyone really wants it, but
I've never seen anyone need anything like that for TA use.

I'm typing this in from memory, so excuse the inevitable syntax
errors, but I did try this and it works fine. This should spit out
today's close and its square root. Season to taste...

output = "root.lst";

float ans, guess, num, eps;

eps := 0.0001; // reduce this to get "closer" to the actual root.

float num; // the number you need the root of.

num := close(0);
guess := num / 2.0; // first guess.
ans := num / guess;

integer i;
for i = 1 to 100 do // most will only take 5 to 12 iteratons.
if (abs(guess - ans) >= eps) then // are we too far away?
guess := (guess + ans) / 2; // average to refine guess...
ans := num / guess; // ...for a more refined answer
else
i := 100; // we're done. Get out of loop
endif;
next i;

println symbol, " ", num, " ", ans;