MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 

Phase Calculation by John Ehlers
For the complete text of this article and sidebar, please refer to the November 1996 issue
of Technical Analysis of STOCKS & COMMODITIES magazine.


Type : Indicator, Name : Phase Calculation

inputs:
DomCycle(15);
vars:
RealPart(0),
ImagPart(0),
Weight(0),
Phase(0),
J(0);

for J = 0 to DomCycle -1 Begin
weight = close[J];
If DomCycle <>0 then Begin
RealPart = RealPart + Cosine(360 * J / DomCycle) * Weight;
ImagPart = ImagPart + Sine(360 * J / DomCycle) * Weight;
end;
end;

If AbsValue(RealPart) > .001 Then Begin
Phase = ArcTangent(ImagPart/RealPart);
end
else Begin
Phase = 90 * Sign(ImagPart);
end;

If RealPart < 0 then Phase = Phase +180;
Phase = Phase + 90;
If Phase < 0 then Phase = Phase + 360;
If Phase > 360 then Phase = Phase - 360;

plot1(Phase, "Phase");

 

t-i-Phase_Calculation.gif
Excerpted from an article originally published in the November 1996 issue of Technical Analysis of STOCKS & COMMODITIES magazine.
Source / From: TOP
http://www.traders.com

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!