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

RE: Cycle Length



PureBytes Links

Trading Reference Links


> -----Original Message-----
> From: Chris Evans [mailto:evanscje@xxxxxxxxxxxxx]
> Sent: Thursday, January 08, 2004 9:48 AM
> To: Gary Funck; omega-list@xxxxxxxxxx
> Subject: Re: Cycle Length
> 
> 
> so I tried plotting this function on the Five year note with Max =25 :
> 
> Inputs:Price(numeric),Max(numericsimple);
> Vars:Len(5),Sum_Price_Chg(0),Min(100);

As a matter of style, I'd just put 0 in for Vars that are going to
be recalc'ed anyway.  Also, setting Min to only 100 might not be
high enough. To be on the safe side, let's do this instead.

Vars:Len(0),Sum_Price_Chg(0.0),Min(0.0);

For Len = 5 to Max begin
  Sum_Price_Chg = AbsValue(Summation(Price-Price[1],len));
  If Len = 5 or Sum_Price_Chg < Min then begin
    Cyclelength = len;
    Min = Sum_Price_Chg;
  end;
end;

This way, we know for sure that Cyclelength is set to some explicit value.

> 
>  but I only get a static of 20 ??
> 

Is 20 your Max cycle length above?

If the suggestion above doesn't work for you, I'd recommend adding some
print statements inside the loop, and just before returning, to see what's
going on.