+1 888 340 6572 GET STARTED

Cycle Analysis > Phase Calculation

Article/Author: "Stay In Phase", John F. Elders, Stocks&Commodities magazine, 11/1996

Download: phascalc.ela

File Includes: Indicator - Phase calculation

Category: Indicator > Cycle Analysis

Description:

A cycle is one market characteristic that can be scientifically measured. Although they can be measured, they are still maddening because they are in essence ephemeral; they come and they go. Our recent research, however, indicates there is a fundamental cycle parameter that leads us to the correct trading strategy for any current market mode. To find out more, we must start by defining two possible market modes, the trend mode and the cycle mode. In the trend mode, the correct strategy is to buy (or sell, for downtrends) and hold. In the cycle mode, the correct strategy is to buy and sell on the cyclic valleys and peaks.

The parameter we use is the phase of the cycle. The measured phase tells us with great sensitivity when we are in the trend mode, enabling the capture of a large fraction of the trend movement. Typically, this capture range is far larger than can be obtained with a crossing moving average or other usual trend identification techniques. In the cycle mode, the measured phase pinpoints the cyclic turns in advance, with the further advantage that the false whipsaw signals of typical oscillator signals are avoided.

NOTES: This Indicator includes the correction mentioned in the 01/1997 issue of Stocks&Commodities.

Usage:

The most popular method of using a cycle is to accurately predict events in nature: bird migrations, the tides, planetary movements, etc. One can also use cycle analysis to predict changes in financial markets, although not always with the accuracy found in nature.

The prices of many commodities reflect seasonal cycles. Due to the agricultural nature of most commodities, these cycles are easily explained and understood. However, for some securities, the cyclical nature is more difficult to explain. Theories as to why certain securities exhibit cyclical patterns range from weather and sun spots, to planetary movement and basic human psychology.

Everybody knows that prices are a consensus of human expectations. These expectations are always changing, shifting the supply/demand lines, and causing prices to oscillate between overbought and oversold levels. Fluctuations in prices are a natural process of changing expectations and lead to cyclical patterns.




Inputs:

Domcycle - the sine of the phase angle

EasyLanguage Code:
INPUTS: DOMCYCLE(15);

VARS: REALPART(0), IMAGPART(0), WEIGHT(0), PHASE(0), J(0);

REALPART = 0;
IMAGPART = 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");