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

Re: "Normalized" Linear Regression Slope



PureBytes Links

Trading Reference Links

Looks like this does what I want:

Period:=Input("LinRegPeriod",2,200,20);
Nrml:= (LinRegSlope(C, Period) *C)/C;
Nrml;
0;

Any thoughts/comments still welcome.

TIA
Ron

Ron wrote:

> Hi folks -
>
> I'm using the following code trying to get the slope of the % change 
> in price (close).
>
>
> I'm using:
> Period:=Input("Periods",3,200,10);
> ZeroKiller:=If(C=Ref(C,-1),0,C/(C-Ref(C,-1)));
> NormalSlope:=LinRegSlope(ZeroKiller,Period);
> NormalSlope;
> 0;
>
> I think I want this or else a change of  $1 for a $10 stock and a $100 
> stock would be the same. Is that correct?
> I'm using ZeroKiller to get rid of the div by 0 error message that 
> shows up. (Although the plot still is drawn.) .
> I'd appreciate any help y'all have to offer.
>
> TIA
> Ron
>
>