[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Function Help



PureBytes Links

Trading Reference Links

I'm trying to create a function based upon a paper I read by Cynthia Kase.
This is my first attempt at using a loop. The idea is to find the highest
value5, which is the KSDIu, over a range of cycle lengths. I found a
function in the archives and modified it to the following. My question is,
does this function return the highest value for value5, which becomes KSDIu?
The original function is below it.

		vars: mlval(0);
mlval = 0;

for value99 = 5 to 70 begin
   value5 = (high - low[value99])/(StdDev(log(C[1]/C),9)*SquareRoot(252));
   if value5> mlval then mlval = value5;
end;

KSDIu = mlval;

{****************************************}

{Function:HIrwi}
{ This function is equal to Kase' Function XL.  IT is the RWI indicator
written about by Mile Poulos in TASC.  The indicator uses 0 as a minimum
value althouhg the RWI can be negative.}


vars: mlval(0);
mlval = 0;

for value99 = 8 to 65 begin
   value5 = ( high  - low [value99] )  / SquareRoot( value99 ) ;
   if value5> mlval then mlval = value5;
end;

value6 =average(TrueRange,34);

if  value6 > 0 then
HIrwi = mlval / value6 else HIrwi =HIrwi [1];