log in     sign up for free
 
To be a money master, you must first be a self-master.
J. P. Morgan
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Phase Calculation

Formula for: TradeStation

indicator


 

 

Views:  1507

Added: July 18, 2008
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: TradeStation, indicator
 
Your Ad Here
For the complete text of this article and sidebar, please refer to the November 1996 issue of Technical Analysis of STOCKS & COMMODITIES magazine.
Excerpted from an article originally published in the November 1996 issue of Technical Analysis of STOCKS & COMMODITIES magazine.

 

 



Code:

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");

 






Author: John Ehlers
Source: http://www.traders.com

 

View similar (indicator for TradeStation):

Macd RS Ratio
Adaptive Moving Average
Pivotal Trading
Honey Baked
Preferred (Slow) Oscillator
Cosine IFM
NLR Indicator
Simple Futures MA Indicator
Moving Average Adjuster
Mov Avg X 2_20
...
 
 
all formulas for TradeStation
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012