Category: Tradestation – Indicator


Description 

A technical momentum indicator invented by the technical analyst Tushar Chande. It is created by calculating the difference between the sum of all recent gains and the sum of all recent losses and then dividing the result by the sum of all price movement over the period. This oscillator is similar to other momentum indicators such as the Relative Strength Index and the Stochastic Oscillator because it is range bounded (+100 and -100).
Equation
CMO

Source Code (Easy Language)

{*******************************************************************
Description: Chande Momentum Oscillator
Provided By: Denny Imanuel. (c) Copyright 2009
********************************************************************}

Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: Diff(0.0), CMO1(0.0), CMO2(0.0), SUM1(0.0), SUM2(0.0);

Diff = Price-Price[1];
If Diff>0 then CMO1 = Diff else CMO1=0;
If Diff<0 then CMO2 = -Diff else CMO2=0;

SUM1 = Summation(CMO1, Period);
SUM2 = Summation(CMO2, Period);

If (SUM1+SUM2)<>0 then
  CMO = ((SUM1-SUM2)/(SUM1+SUM2))*100
Else
  CMO = 0;

Graph 

GrCMO

Interpretation
The security is deemed to be overbought when the momentum oscillator is above +50 and oversold when it is below -50. Many technical traders add a nine-period moving average to this oscillator to act as a signal line. Bullish signals are generated when the oscillator crosses above the signal, and bearish signals are generated when the oscillator crosses down through the signal.

Variable Moving Average

Description 

Variable Moving Average is an Exponential Moving Average that automatically adjust the smoothing constant based on the volatility of the data series. The volatility index calculation is based on the absolute value of Chande Momentum Oscillator with nine bar length calculation.
Equation
VMA
see CMO Indicator for the Equation

Source Code (Easy Language)

{*******************************************************************
Description: Variable Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 2009
********************************************************************}

Inputs: Price(NumericSeries), Period(NumericSimple), CMOPeriod(NumericSimple);
Variables: VI(0), factor(0);

factor = 2/(Period+1);

VI = AbsValue(CMO(Price, CMOPeriod)/100);

if CurrentBar <= 1 then
begin
    VMA = Price;
end
else
begin 
    VMA = (factor*VI*Price) + ((1-factor*VI)*VMA[1]);
end;

Graph

VMA
Interpretation
As shown on the picture VMA (red) will avoid the price whipsaws when trending up and trending down as compared to SMA (yellow), thus will provide better crossover entry and exit trading signal. The graph on the bottom shows CMO indicator, which measure the volatility.
Description  

Adaptive Moving Averages changes its sensitivity to price fluctuations. The Adaptive Moving Average becomes more sensitive during periods when price is moving in a certain direction and becomes less sensitive to price movement when price is volatile.
Equation
AMA

Source Code (Easy Language)

{*******************************************************************
Description: Adaptive Moving Average
Provided By: Denny Imanuel (c) Copyright 2009
********************************************************************}

Inputs: Price(NumericSeries), AvgPeriod(NumericSimple), FastMovPeriod(NumericSimple), SlowMovPeriod(NumericSimple);
Variables: DirectionConst(0), VolatilityConst(0), EffeciencyRatio(0), FastMovConst(0), SlowMovConst(0), ScaledMovConst(0), Const(0);

DirectionConst = Price-Price[AvgPeriod];
VolatilityConst = Summation(AbsValue(Price-Price[1]),AvgPeriod);
EffeciencyRatio = DirectionConst/VolatilityConst;

FastMovConst = 2/(FastMovPeriod+1);
SlowMovConst = 2/(SlowMovPeriod+1);
ScaledMovConst = EffeciencyRatio * (FastMovConst – SlowMovConst) + SlowMovConst;
Const = ScaledMovConst*ScaledMovConst;

AMA = AMA[1] + Const * (Price – AMA[1]);

Graph

image

Interpretation
The AMA (purple) has a slow response when the market volatility low, and suddenly ahs a fast response when the market volatility increases. See the SMA (cyan) as comparison.

Description 

Modified Moving Average is an algebraic tool which makes averages more amenable to price shifts. The first point of the modified moving average is calculated precisely as the first point of the simple moving average is calculated. However, all following points are measured by adding the new price and afterwards subtracting from the resulting sum the last average.
Equation
MMA

Source Code (Easy Language)

{*******************************************************************
Description: Modified Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 2009
********************************************************************}

Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: PriceSum(0), counter(0);

PriceSum = 0;

for counter = 0 to Period-1
begin
    PriceSum = PriceSum + ((Period-(2*counter+1))/2 * Price[counter]);
end;

MMA = SMA(Price,Period) + (6*PriceSum)/((Period+1)*Period);

Graph

image

Interpretation
As you can see that MMA (magenta) is a very responsive type of moving average as compared to SMA (cyan).

Description 
Smoothed Moving Average is a method of smoothing the moving average by addition of price summation and the simple moving average.
Equation
SMMA

Source Code (Easy Language)

{*******************************************************************
Description: Smoothed Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 2009
********************************************************************}
Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: PriceSum(0);

if CurrentBar <= 1 then
begin
  PriceSum = Summation(Price, Period);
  SMMA = PriceSum/Period;
end
else
begin
  PriceSum = Summation(Price, Period);
  SMMA = (PriceSum[1] – SMMA[1] + Price)/Period;   
end;   

Graph

image

Interpretation
The smoothing process causes the SMMA (cyan) performs sluggishly as compared to SMA (red)

Description 
Hull  Moving Average basically a Weighted Moving Average that dampen the smoothing effect and resulting a lag by using a square root of period. It reacts more quickly on the price changes as compared to typical WMA.
Equation

HMA 

Source Code (Easy Language)

{*******************************************************************
Description: Hull Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 2009
********************************************************************}
Inputs: Price(NumericSeries), Period(NumericSimple);

HMA = WMA(2*WMA(Price, Period/2) – WMA(Price,Period), IntPortion(SquareRoot(Period)));

Graph
image 
Interpretation
The HMA (magenta) response to the price changes rapidly as compared to standard SMA (red).

Description
Sine Weighted Moving Average has a characteristic of sine wave which are smoother as compared to other type of moving average calculation.
Equation

SWMA

Source Code (Easy Language)

{*******************************************************************
Description: Sine Weighted Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 2009
********************************************************************}

Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: NumSum(0), DenomSum(0), counter(0);

NumSum = 0;
DenomSum = 0;

for counter=1 to 5
begin
    NumSum = NumSum + Sine((counter+1)*180/(Period+1))*Price[counter];
    DenomSum = DenomSum + Sine((counter+1)*180/(Period+1));
end;

SWMA = NumSum/DenomSum;

Graph
image
Interpretation
The SWMA (magenta line) shows better conformity toward the price trend changes as compared to SMA (red line).

Description
Triangular Moving Average is actually a method of reaveraging a Simple Moving Average to make it smoother.
Equation

TMA

Source Code (Easy Language)

{*******************************************************************
Description: Triangular Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: TPeriod(0);

TPeriod = Ceiling((Period+1)/2);

TMA = SMA(SMA(Price,TPeriod), TPeriod);

Graph
image
Interpretation
The TMA (yellow line) shows a smoother ripple as compared to SMA (red line).

Description 
Wilder Moving Average is a special moving average which actually developed for RSI, ATR, ADX indicators. So it will have sluggish performance if directly implemented for price.
Equation

WiMA

Source Code (Easy Language)

{*******************************************************************
Description: Wilder Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 2009
********************************************************************}

Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: factor(0);

if currentbar <= 1 then
begin
    WiMA = Price;
end
else
begin
    WiMA = (Price + (Period-1)*WiMA[1])/Period;
end;

Graph

image

Interpretation
WiMA (magenta line) has more sluggish movement as compared to EMA (blue line).

Description
Zero Lag Exponential Moving Average tries to removes the lagging characteristic of Exponential Moving Average so it provide better price trend averaging and more responsive toward price swinging.
Equation

ZLEMA

Source Code (Easy Language)

{*******************************************************************
Description: Zero Lag Exponential Moving Average
Provided By: Denny Imanuel, Inc. (c) Copyright 2009
********************************************************************}

Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: factor(0), lag(0);

if CurrentBar <= 1 then
begin
    ZLEMA = Price;
    factor = 2/(Period+1);
    lag = (Period-1)/2;
end
else
begin
    ZLEMA = factor*(2*Price-Price[lag]) + (1-factor)*ZLEMA[1];
end;

Graph
image
Interpretation
ZLEMA (red line) gives better prices conformation as compared to EMA (blue line).

Follow

Get every new post delivered to your Inbox.