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

Re: Ehler's Instantaneous Trendline & Sinewave Indicator - S&C issue May 2000



PureBytes Links

Trading Reference Links

Mohan,
As I see you keep degs in following calculations, so it would be 
better
to change p1 once.
Instead of 
p1 = atan( abs(quad+Ref(quad,-1) ) / abs(inphase+Ref(inphase,-1) ) ); 

you may write

pp1=atan( abs(quad+Ref(quad,-1) ) / abs(inphase+Ref(inphase,-1) ) ); 
p1=180*pp1/(4*atan(1));

[where atan(1) is equal to pi/4, hence pi=4*atan(1)]
Now the new p1 is in degs and will not disturb following calculations.
Dimitris Tsokakis

--- In amibroker@xxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> wrote:
> Mohan
> In
> p1 = atan( abs(quad+Ref(quad,-1) ) / abs(inphase+Ref(inphase,-
1) ) ); 
> you calculate p1 in radians.
> then you begin with
> phase = IIf(inphase<0 AND quad>0, 180-p1, 
> where you subtract 180 degs minus p1 radians.
> This will introduce a mistake to the whole thing.
> Dimitris Tsokakis
> --- In amibroker@xxxx, Mohan Yellayi <yellayi@xxxx> wrote: