Category: Tradestation – Indicator


Description
End Point Moving Average is the ending of linear regression value plus its slope. Regression Line performs better as compared to Moving Average due to its zero lag characteristic.
Equation

EPMA
Source Code (Easy Language)

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

Inputs: Price(NumericSeries), Period(NumericSimple);
Variables: PriceSum(0), counter(0);
for counter=0 to Period-1

PriceSum = 0; 
begin
    PriceSum = PriceSum + Price[counter]*(3*counter-Period+1);
end;

EPMA = PriceSum/(2/(Period*(Period+1)));

Graph
image
Interpretation
EPMA (magenta line) is very responsive toward the price changes as compared to SMA (red line). However the major drawback is that the price lag is very wide.

Description
Weighted Moving Average is another method of calculating moving average by giving more weight factor to the most current price.
Equation

WMA

Source Code (Easy Language)

{*******************************************************************
Description: Weighted 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 + Price[counter]*(Period-counter);
end;

WMA = PriceSum/(Period*(Period+1)/2);

Graph
image
Interpretation
The WMA (cyan line) shows more responsive toward the price latest trend as compared to SMA (red line).

Description
Exponential Moving Average is another enhancement calculation of simple averaging where the exponential ratio is incorporated. The equation as shown below is coming from the derivation of exponential factor inside the calculation and it made the computation easier.
Equation

EMA
Source Code (Easy Language)

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

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

if currentbar <= 1 then
begin
    EMA = Price;
    factor = 2/(Period+1);
end
else
begin
    EMA = factor * Price + (1 – factor)* EMA[1];
end;

Graph
GrEMA
Interpretation
The graph shows that EMA (red line) is more responsive toward the price trend as compared to SMA (yellow line).

Description
Simple Moving Average is a simple price averaging formula over a short period of time in the past. Moving Average is a lagging indicator which means the data behind the price trend.
Equation

SMA
Source Code (Easy Language)

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

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

PriceSum = 0;

for counter=0 to Period-1
begin
    PriceSum = PriceSum + Price[counter];
end;

if Period>0 then SMA = PriceSum/Period
else SMA=0;

Graph
GrSMA
Interpretation
n.a.

See full size image Before you build your own trading strategy you must understand how the current trading theories which are built by many mathematician are correlated each other. Here are the general explanation of how this big picture are developed.

Trading strategy is based on trading indicators. There are thousands of indicators available today and each indicator has their own underlying theory. Based on this indicators actually you can create your own unlimited of a combination of trading strategy. You can customized your trading strategy based your own preference. However make sure that all the strategy are backtested before you enter the trade.

In order to use the indicator properly for your trading strategy you must first understand the concept behind this indicator, the equation related the indicator, the underlying algorithm or pseudo code or flowchart, and the programming code, and the interpretation of the indicator and finally implementation. So based on these understanding you can do some modification necessary for enhancement purpose and then do some pairs up the usage with other indicators to create a new trading strategy based on your own understanding. Finally comes to the testing and some modification and the addition of non technical procedure inside your strategy development necessary before your strategy are ready to be traded.

Basically here are the major classification of the indicators that available today:

1. Chart Pattern Indicator – these indicator are based on the study of chart shape and pattern, there are hundreds of chart pattern available today, and it has correlation with the trading movement. 

2. Market Breadth Indicator – these indicators are based on the measurement on advancing and declining movement of the stock market data. There are hundred of indicator under this classification.
 
3. Momentum Based Indicator – these indicators try to quantify the swinging movement of the stock market data with some mathematical transformation.

4. Volatility Based Indicator – these indicators try to measure the market volatility on order to understand whether the market is stagnant or moving faster.

5. Trend Indicator – these indicators try to transform price data toward a trend following chart that easy to quantify with simple trend line.

6. Confirmation Indicator – these indicators try to quantify the market condition with some mathematical information.

And with the advance mathematical study today there are a lot of others theory that can be implemented to build the trading algorithm, such as:
 
1. Optimization Theory: these study is based on the fact that optimization calculation is necessary in order to produce best performance algorithm.

2. Adaptive Theory: these study is based on the adaptive algorithm which can adapt to a different market condition, and thus producing a flexible algorithm.

3. Time Series Theory: these study based on the study that stock data is actually a sequence data point measure at a successive time space at uniform time interval.

4. Transformation Theory: these study based on the fact that the stock data can be transform into another domain of calculation. For example: Fourier Transforms converts the stock data from time domain to frequency domain, and Wavelet theory converts the stock data from time domain to frequency and phase domain.

5. Pattern Recognition: these study based on the fact that stock data is contains a collection of repetitive pattern or periodical pattern that can be recognized.

6. Neural Network: based on the study on the neural network system which has the auto learning capability.

7. Genetic Algorithm: based on the implementation of the survival of the fittest theory on the genetic computation to produce the best optimization procedure.

OK, it’s a long way to learn all these stuff. But you must learn it if you want to let your money work “smartly” for you!

Copyright 2009 Denny Imanuel
Follow

Get every new post delivered to your Inbox.