Article explaining the list of Technical Indicators available, along with calculation logic and trading signal strategy implemented in the Technical Analysis Pro Excel Template


1. Simple Moving Average (SMA)

Parameters


1) Length of the moving average – how many periods to use for calculating average. Default provided is 9. 


If the length is greater, the smoothing effect is greater and the indicator is less impacted by sudden price fluctuations.


2) Source – what value are we averaging. Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well.


Calculation Logic


Let’s take a simple example where we have closing price of a stock for each trading day.


To calculate the moving average of 5 periods, for March 26th, we average the price of 5 days (Mar 22nd to 26th).

To calculate the moving average of 5 periods, for March 25th, we average the price of 5 days (Mar 19th  to 25th).


Signals

  • If the closing price moves from below the Moving Average line to above the Moving average line, then a Buy signal is generated.
  • If the closing price moves from above the Moving Average line to below the Moving average line, then a Sell signal is generated.



2. Weighted Moving Average (WMA)


Parameters


1) Length of the moving average – how many periods to use for calculating average.  Default used is 9.


If the length is greater, the smoothing effect is greater and the indicator is less impacted by sudden price fluctuations.


2) Source – what value are we averaging.  Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well.


Calculation Logic


Weighted Moving Average gives more weight to the recent data points.


Let’s take a simple example where we have closing price of a stock for each trading day.


To calculate the weighted moving average of 5 periods, for March 26th,


We calculate the weight * price for each of the 5 days (Mar 22nd to 26th).

Weights are assigned as 5 for the 5th (most recent day), 4 for the 4th day, and so on.

Sum that result for all 5 days

Divide the sum by total weight (15) which is the sum of the weights (5,4,3,2,1)


This is how we calculate the 5 period weighted moving average.


Signals


  • If the closing price moves from below the WMA line to above the WMA line, then a Buy signal is generated.
  • If the closing price moves from above the WMA line to below the WMA line, then a Sell signal is generated.


3. Exponential Moving Average (EMA)


Parameters


1) Length of the moving average – how many periods to use for calculating average.  Default used is 9.


If the length is greater, the smoothing effect is greater and the indicator is less impacted by sudden price fluctuations.


2) Source – what value are we averaging.  Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well.


Calculation Logic


To calculate the EMA of 12 periods, for March 26th,



  • We calculate the Multiplier first.
    • Multiplier = Smoothing / (1+ Length)
    • Most used Smoothing is 2
    • For a 12 period EMA, this multiplier is 0.154 (rounded)
  • EMA = (Today’s Value * Multiplier) + Yesterday’s EMA * (1-Multiplier)
    • You can see that today’s value is given 15.4% weight but yesterday’s EMA is given 84.6%  (100-15.4%) weight
    • Yesterday’s EMA will depend on the day before yesterday’s EMA. This keeps going on. This is how the entire price history is considered when we arrive at today’s EMA. Thus this addresses the downside of the Weighted Moving Average.
    • In the example,  ($232.34 * 0.154) + $234.98 (1-0.154) = $232.98


Signals


  • If the closing price moves from below the EMA line to above the EMA line, then a Buy signal is generated.
  • If the closing price moves from above the EMA line to below the EMA line, then a Sell signal is generated.


4. Exponential Moving Average Envelope (EENV)

Parameters


  1. Length: You can type in a length in periods. For example, in the above screenshot, we have entered 21 periods.
  2. Source: Choose from the drop down list of the 5 options for source values. Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well. 
  3. Envelope: Type in a % value to create an envelope


Calculation Logic


Envelope is a region or channel surrounding the Moving Average on both (above and below) sides. Instead of just relying on whether the price is above or below the Moving Average, we can allow for a certain tolerance on both sides, to accommodate certain variations or fluctuations.


Example, a 3% envelope will create a upper envelope of EMA + 3% (EMA) and lower envelope of EMA – 3% (EMA)


Note: The envelope can also be calculated based on Other types of moving averages like SMA (Simple Moving Average) and WMA (Weighted Moving Average). We are using EMA in this template.


In the above screenshot, you can see the envelope as a shaded region or area. The blue line is the Closing price.


How wide or narrow the envelope is, depends on the envelope %. In the screenshot above, we are using a 10% envelope. So, the upper envelope is (EMA + 10% EMA) and the lower envelope is (EMA – 10% EMA).

Signals

  • If the closing price moves from above the lower envelope to below the lower envelope, then a Buy signal is generated.
  • If the closing price moves from below the upper envelope to above the upper envelope, then a Sell signal is generated.
  • If neither is true, no signal will be generated.


5. Exponential Moving Average Crossover (EMAC)


The Crossover method uses multiple EMA lines and allows creating trading strategy based on whether and how one EMA line crosses over another EMA line.


Parameters


3 EMA length/Periods: Typically, the EMAs would be of different lengths. In a triple crossover strategy, there would be a Fast EMA (short length), Medium EMA (medium Length)and Slow EMA (Long length).


Defaults are 4, 9 and 18 periods


Source: Though Closing price is the most used, you can also use High, Low, Open, and Volume as well. 


Calculation Logic


We calculate EMA as explained previously, but we calculate three of them.


Signals

  • IF (EMA 1> EMA 2) AND (EMA 2 > EMA 3) then BUY
  • IF (EMA 1< EMA 2) AND (EMA 2 < EMA 3) then SELL



6. Exponential Moving Average Crossover (SMAC)


The Crossover method uses multiple SMA lines and allows creating trading strategy based on whether and how one SMA line crosses over another SMA line.


Parameters


3 SMA length/Periods: Typically, the SMAs would be of different lengths. In a triple crossover strategy, there would be a Fast SMA (short length), Medium SMA (medium Length)and Slow SMA (Long length).


Defaults are 4, 9 and 18 periods


Source: Though Closing price is the most used, you can also use High, Low, Open, and Volume as well. 


Calculation Logic


We calculate SMA as explained previously, but we calculate three of them.


Signals

  • IF (SMA 1> SMA 2) AND (SMA 2 > SMA 3) then BUY
  • IF (SMA 1< SMA 2) AND (SMA 2 < SMA 3) then SELL


7. Bollinger Bands (BB)


Parameters


Three parameters in this calculation are


1) Length of the moving average – how many periods to use for calculating average. Commonly used SMA length is 20.


2) Source – what value are we averaging. In the example we used the closing price of the stock.


Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well.


3) STD DEV  – Standard Deviation


Example, a 2 Std Deviation will create a upper band line of SMA + (2*STD DEV) and lower envelope of SMA –(2* STD DEV)


Calculation Logic


While the Moving Average Envelope allows a fixed % variation on either side of MA, the Bollinger Bands take into account the standard deviation of the data points.


Upper Band line is SMA + (2 * STD DEV)


Lower Band line is SMA – (2* STD DEV)


Signals


  • If the closing price moves from above the lower band line to below the lower band line, then a Buy signal is generated.
  • If the closing price moves from below the upper band line to above the upper band line, then a Sell signal is generated.


8. Donchian Channels (DC)


Parameter


Only input parameter for this indicator is the Length which defines the number of periods to look in history. 

A 20-day period is the most used and here is how the three channel lines are calculated for each day.


Calculation Logic


  • Upper Channel = 20 Day High price
    • Highest High price for the past 20 days including today
  • Lower Channel = 20 Day Low price
    • Lowest Low price for the past 20 days including today
  • Middle Channel = (20 Day High Price + 20 Day Low Price)/2


Signals

  • If the High price moves touches the Upper channel Line, then a Buy signal is generated.
  • If the Low price moves touches the Lower Channel line, then a Sell signal is generated.


9. Keltner Channels (KC)


Parameters


Source: Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well.

EMA length: Default is 20

ATR length: Default is 10



Calculation Logic


Upper Envelope = EMA + 2*ATR

Lower Envelope = EMA – 2*ATR


Signals


  • Buy when the Closing Price crosses from above the lower envelope to below the lower envelope
  • Sell when the Closing Price crosses from below the upper envelope to above the lower envelope


10. Supertrend Indicator (STI)

Supertrend is a trend-following indicator based on Average True Range (ATR). 


Parameters

ATR length: 10 is the default

Factor: 3 is the default



Calculation Logic

First we calculate the ATR using the running moving average method. 


Then we calculate basic bands (Basic Upper Band and Basic Lower Band) 

Basic Upper Band UB =  (high + low)/2   + (Factor× ATR)

Basic Lower Band LB = (high + low)/2   - (Factor × ATR)


Then we calculate Final UB and FInal LB


Final UB = IF OR( basicUpperBand < prev Final upperBand,  prev close > prev Final upperBand ) 

THEN basicUpperBand 

ELSE  prev Final upperBand



Final LB = IF OR( basic Lower Band > prev Final lower Band, 

prev close < prev Final lower Band ) 

THEN basic Lower Band 

ELSE prev Final lower Band


Supertrend STI Value = 


If AND( prev STI value = Prev Final UB, Current close <= Final UB) THEN Final UB

If AND( prev STI value = Prev Final UB, Current close >= Final UB) THEN Final LB

If AND( prev STI value = Prev Final LB, Current close >= Final LB) THEN Final LB

If AND( prev STI value = Prev Final LB, Current close <= Final LB) THEN Final UB


Signals


  • If AND( prev close < prev STI, current close > current STI) then BUY
  • If AND( prev close > prev STI, current close < current STI) then SELL


11. Parabolic SAR (PSAR)


Parabolic SAR (SAR) is a time and price technical analysis tool primarily used to identify points of potential stops and reverses. In fact, the SAR in Parabolic SAR stands for "Stop and Reverse". The indicator's calculations create a parabola which is located below price during a Bullish Trend and above Price during a Bearish Trend.


TradingView.com



Parameters

Start: 0.02 is default


Increment: 0.02 is default


Max value: 0.2 is default



Calculation Logic

TradingView.com



Signals


  • If AND(PSAR value < Close, Prev PSAR value > prev close) then BUY
  • If AND(PSAR value > Close, Prev PSAR value < prev close) then SELL



12. Momentum (MOM)


Parameters


MOM length: Default is 10


Source: Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well.


Calculation Logic


Current Source value - source value (MOM length) periods ago. 



Signals


  • IF MOM value > 0 and MOM value > prev MOM value, then BUY
  • IF MOM value < 0 MOM value < prev MOM value then SELL


13. Rate of Change (ROC)


Parameters


ROC length: Default is 9


Source: Though Closing price is the most used for calculating simple moving average, you can also use High, Low, Open, and Volume as well.


Calculation Logic


(Current Source value / source value (MOM length) periods ago. )*100



Signals


  • IF ROC value > 0 and ROC  value > prev ROC value, then BUY
  • IF ROC value < 0 and ROC value < prev ROC  value then SELL



14. Awesome Oscillator (AO)


Parameters


SMA length 1: Default is 5


SMA length 2: Default is 34



Calculation Logic


It calculates the difference between a 34 period and 5 period Simple Moving Averages. The Simple Moving Averages are calculated using the midpoints (between high and low) of each period’s price.


Awesome Oscillator = Simple Moving Average (Midpoint, 5) – Simple Moving Average (Midpoint, 34)


where Midpoint = (High + Low) /2


Signals


  • If current AO value > 0 and prev AO value <=0 then BUY
  • If current AO value < 0 and prev AO value >=0 then SELL


15. Moving Average Convergence Divergence (MACD)


MACD is used by a lot of traders, since it captures multiple aspects of stock performance. It not only helps identify trends, but it can also measure momentum. 


Parameters


SMA length 1: Default is 5


SMA length 2: Default is 34



Calculation Logic



First, we calculate two different Moving Averages (one fast and one slow). Then, we take the difference in values between those two Moving Averages and that is called the MACD Line.


We then calculate an EMA of the MACD line and that is called Signal line. Signal line is thus an indicator of an indicator.

Finally, we calculate difference between MACD and Signal line and display as a MACD histogram which oscillates above and below zero.

Three different elements are shown on the chart typically when you view MACD indicator.


  1. MACD Line = (12-day EMA – 26-day EMA)
  2. Signal Line = 9-day EMA of MACD Line
  3. MACD Histogram = MACD Line – Signal Line

The MACD histogram values are plotted as red and green bars. A bar is green when the MACD histogram value is greater than 0. A red bar indicates that its value is lesser than 0.




Signals


  • If MACD value > Sig value and prev MACD value <= Prev sig value then BUY
  • If MACD value < Sig value and prev MACD value >= Prev sig value then SELL



16. Relative Strength Index (RSI)


Parameters


Source: Close, or Open, High, Low, Volume.

RSI Length : 14 is default

RSI Minimum: 30 is default

RSI Maximum: 70 is default



Calculation Logic


Let’s say we use a 14 day RSI. On Day 14 of our data, we can calculate the first RSI.


How RSI (Relative Strength Index) indicator is calculated

Calculations for the first RSI – On Day 14


On Day 14, we calculate Avg. Gain of 14 days using a simple average of gain on each of the 14 days. A gain is measured as Closing Price – Closing Price on Previous Day. If there is no gain, it is measured as 0 gain. 

Similarly, on Day 14, we calculate Avg. Loss of 14 days using a simple average of gain on each of the 14 days. A gain is measured as Closing Price – Closing Price on Previous Day. If there is no gain, it is measured as 0 gain.

Relative Strength RS = Avg Gain/Avg Loss

Relative Strength RSI = 100 – 100(1+RS)

Calculations for all subsequent RSIs – from Day 15


On Subsequent days (from Day 15), the calculations for Avg. Gain and Avg. Loss change as below.


Avg. Gain is measured as  (Prev Day Avg Gain * 13) + Current Day Gain

Avg. Loss is measured as  (Prev Day Avg Loss * 13) + Current Day Loss

Relative Strength RS = Avg Gain/Avg Loss

Relative Strength RSI = 100 – 100(1+RS)

Due to the nature of the calculations, depending on your starting point, the RSI values may differ slightly. For example, if you start with a 5 year historical data for a stock, your RSI may be different from your RSI if you start with 1 year historical data.


RSI is represented as a line on the chart and its values range from 0 to 100. Lower the RSI, the weaker the price momentum. Higher the RSI, the stronger the price momentum.


Signals


  • IF RSI value > RSI Max and prev RSI value <= RSI MAX then SELL
  • IF RSI value < RSI Min and prev RSI value >= RSI MIN then BUY


17. Average True Range (ATR)


Parameters


Length: Default is 14



Calculation Logic


True Range TR = max [ (high – low), ABS(high – previous close), ABS (low – previous close)]


ATR = Average of True Range


Calculate ATR based on Running Moving Average Method


((Prev ATR * 13) + Current True Range TR) /14


Signals


  • No signals generated for ATR


18. Williams % R (WIL)


Williams %R is a momentum-based oscillator to identify overbought and oversold conditions.


%R Oscillates between 0 and -100. When the value is closer to zero, it indicates overbought conditions and when closer to -100 indicates oversold conditions.


Parameters


Length: Default is 14


Lower: -80 is default


Upper: -20 is default



Calculation Logic


Highest High = Highest High for the look-back period.


Lowest Low = Lowest Low for the look-back period.

Most commonly used period is 14.


%R = (Highest High – Current Close) / (Highest High – Lowest Low) x -100


Signals


  • Buy when the %R drops below the Minimum threshold (-80 by default)
  • Sell when the %R exceeds above the Maximum threshold (-20 by default)



19. Stochastic Indicator (STO)


“Stochastics measures the momentum of price. If you visualize a rocket going up in the air – before it can turn down, it must slow down. Momentum always changes direction before price”


Stochastics is made of two lines %K and %D.


%K measures the current closing price against the range of prices (highest high and lowest low) within a certain period.

%D is the Simple moving average of the %K line.



Parameters


K: Default is 14


D: 3 is default


Smooth: 1 is default



Calculation Logic


%K = SMA ( (Current Close – Lowest Low) / (Highest High – Lowest Low) x 100, Smooth K)


SMA is the Simple Moving Average

Smooth K is the length or the number of periods to use in calculating the Highest Highs SMA



%D = SMA(%K, Period D)


Period D is the number of periods used for calculating the simple moving average. 


Signals


  • Buy when the %D drops below the Minimum threshold (20 by default)
  • Sell when the %D exceeds above the Maximum threshold (80 by default)


20. On Balance volume (OBV)


The basic theory behind the On Balance Volume indicator is that volume precedes price. Buying and Selling pressure precede actual price changes, and this indicator measures the buying and selling pressure by using volume.


When volume on PRICE UP days is greater than volume on PRICE DOWN days, OBV increases.

When volume on PRICE DOWN days is greater than volume on PRICE UP days, OBV decreases.



Parameters


None



Calculation Logic


  • If Current Closing Price > Previous Closing Price, then Prev OBV + Current Volume
  • If Current Closing Price < Previous Closing Price, then Prev OBV – Current Volume
  • If Current Closing Price = Previous Closing Price, then Prev OBV


Since it is a cumulative type indicator with current value depending on previous value, it makes a difference when you start calculating this indicator.


If you start calculating with price history data of 1 years, versus 5 years, you will have a different OBV value today.



Signals


  • None


21. Commodity Channel Index (CCI)


Parameters


Length: 20 is default


Upper Bound/Band: 100 is the default


Lower Bound/Band: -100 is the default



Calculation Logic


  • Typical Price (TP) = (High + Low + Close)/3
  • CCI = (Typical Price TP - 20 Period SMA of TP) / (.015 x Mean Deviation) 



Signals


  • IF current CCI Value < Lower bound LB, and Previous CCI value >= prev LB Then BUY
  • IF current CCI Value > Upper bound UB, and Previous CCI value <= prev UB then SELL


22. Average Directional Index (ADX)


Parameters


ADX Smoothing : 14 is default


DI Length:  14 is the default



Calculation Logic



Signals


  • If AND( pos DI < neg DI, Prev Pos DI > Current neg DI) then SELL
  • If AND( pos DI > neg DI, Prev Pos DI < Current neg DI) then BUY



23. Ultimate Oscillator(UO)


Parameters


Short Length: 7 is default


Medium Length: 14 is default


Long Length: 28 is default



Calculation Logic

 

TradingView.com



Signals


  • IF UO Value > 70 Then SELL
  • IF UO Value < 30 then BUY



24. Chaikin Money Flow (CMF)


Parameters


Length: 20 is default



Calculation Logic


  • Money Flow Multiplier =  [(Close  -  Low) - (High - Close)] /(High - Low)
  • Money Flow Volume  = Money Flow Multiplier x Volume for the Period


Signals


  • If AND(current CMF value > 0 , Prev CMF value < 0) then BUY
  • If AND(current CMF value < 0 , Prev CMF value > 0) then SELL


25. Balance of Power (BOP)


Parameters


None



Calculation Logic


  • BOP = (Close - Open) / (high - low)


TradingView.com


Signals


  • If AND(BOP value >0, Prev BOP value <0) then BUY
  • If AND(BOP value <0, Prev BOP value >0) then SELL