A technical indicator is a series of data points that are derived from mathematical calculations based on prices (open, high, low and close), volume and/or open interest. There are a vast number of technical indicators which a trader can adopt.
- Acceleration Deceleration Oscillator (ACO)
- Accumulation/Distribution
- Accumulation Swing Index (ASI)
- Average Directional Movement Index (ADX)
- Average True Range (ATR)
- Bollinger Bands
- Commodity Channel Index (CCI)
- DeMarker
- Directional Movement Indicator (DMI)
- Elliott Wave
- Envelopes
- Fibonacci Numbers
- Ichimoku Kinko Hyo (Ichimoku)
- Linear Regression Channel
- Median Price
- Momentum
- Money Flow Index (MFI)
- Moving Average (MA)
- Moving Average Convergence-Divergence (MACD)
- Parabolic SAR
- Pivot Points
- Rate of Change (ROC)
- Relative Strength Index (RSI)
- Stochastic Oscillator
- Williams Percent Rate (%R)
Acceleration Deceleration Oscillator (ACO)
Acceleration/Deceleration Oscillator (ACO) is designed to measure current driving force of acceleration and deceleration. This indicator is used as a signal of earlier warning as it changes direction before any changes in the driving force, which, in its turn, will change its direction before the price. In ACO there is a zero/nought line which is where the driving force is at balance with the acceleration. Should the AC indicator be above the nought, then the likelihood that the acceleration continues the upward movement. To enter, one has to take note of the colour indication of the column. As a general rule, one cannot buy with the help of AC when the current column is coloured red. Similarly, cannot sell when the current column is green.
If one enters the market in the direction of the driving force (the indicator is higher than nought, when buying, or it is lower than nought, when selling), then only two green columns are needed as confirmation to buy (two red columns to sell). If the driving force is directed against the position to be opened (indicator below nought for buying, or higher than nought for selling), an additional column is required for confirmation. In this case the indicator is to show three red columns over the nought line for a short position and three green columns below the nought line for a long position.
Accumulation/Distribution
Accumulation/Distribution is a momentum indicator to ascertain the supply and demand by determining whether the market is generally 'accumulating' (buying) or 'distributing' (selling) the underlying asset. This study is undertaken by identifying divergences between the price of the underlying asset and the volume flow. Divergences between the Accumulation/Distribution indicator and the price of the underlying asset indicate the upcoming change of prices. As a rule, in case of such divergences, the price tends to move in the direction in which the indicator moves. Thus, if the indicator is growing, and the price of the security is dropping, a turnaround of price should be expected.
Formula
The Accumulation Distribution Index is calculated as follows:
- Closing Price is compared to Opening Price:
- And compared to the day's range:
- The result is multiplied by Volume for the day:
- The Accumulation Distribution Index is calculated as a cumulative total of each day's reading.
Close - Open
(Close - Open) / (High - Low)
(Close - Open) / (High - Low) * Volume
Accumulation Swing Index (ASI)
Swing Index seeks to isolate the "real" price of an underlying asset by comparing the relationships between the current prices (i.e., open, high, low, and close) and the previous period's prices. As such accumulation swing index (ASI) is the cumulative total of the Swing Index.
An upside breakout is indicated when the ASI exceeds its value on the day when a previous significant high swing point was made. A downside breakout is indicated when the value of the ASI drops below its value on a day when a previous significant low swing point was made. Confirmation of trendline breakouts can be performed by comparing trendlines on the ASI to trendlines on the price chart. A false breakout is indicated when a trendline drawn on a price chart is penetrated, but a similar trendline drawn on the ASI is not penetrated.
Formula
SI(i) = 50 * (CLOSE(i-1) - CLOSE(i) + 0,5 * (CLOSE(i-1) - OPEN(i-1)) + 0,25 * (CLOSE(i) - OPEN(i)) / R) * (K / T)
ASI(i) = SI(i-1) + SI(i)
Where:
SI(i) - current value of Swing Index technical indicator;
SI(i-1) - stands for the value of Swing Index on the previous bar;
CLOSE(i) - current close price;
CLOSE(i-1) - previous close price;
OPEN(i) - current open price;
OPEN(i-1) - previous open price;
R - the parameter we get from a complicated formula based on the ratio between current close price and previous maximum and minimum;
K - the greatest of two values: (HIGH(i-1) - CLOSE(i)) and (LOW(i-1) - CLOSE(i));
T - the maximum price changing during trade session;
ASI(i) - the current value of Accumulation Swing Index.
Average Directional Movement Index (ADX)
Average directional movement index (ADX) allows traders to significantly improve their odds of finding good markets and avoiding bad ones. ADX is derived from directional movement indicator (DMI) which is adopted by traders to determine the strength of a trend.
As explained in the DMI study, both +DI and -DI will need to be generated to establish the market direction. In ADX study the +DI and -DI are each averaged for a period of days and then divided by the average 'true range'. The results are normalised (multiplied by 100) and displayed as oscillators. The ADX is measured on a scale from 0 to 100. Generally a reading below 20 will indicate a weak trend and above 40 will indicate a strong trend. The higher the ADX, the more directional the market movement has been. The lower the ADX, the less directional the market movement has been.
Average True Range (ATR)
Average True Range (ATR) is the average of true price ranges over a period of time. True range is the greatest distance from today's high to today's low, yesterday's close to today's high, or yesterday's close to today's low. ATR is a direct measurement of market volatility. If the ATR is increasing, the market is becoming more volatile. Conversely, if the ATR is decreasing, the market is becoming less volatile. ATR is based on the principle that a breakout or price spike outside of the average true range is significant and should be used as a point at which to enter the market.
Formula
True range is the greatest distance from
- Today's high to today's low
- Yesterday's close to today's high
- Yesterday's close to today's low
ATR is the moving average of values of the true range.
Bollinger Bands
Bollinger bands are statistically defined bands around short-term moving average. Bollinger bands have two standard deviations above and below the moving average, which is usually 20 days. In theory, having two standard deviations will contain the majority of subsequent data. Additionally the standard deviation calculations are responsive to short-term price changes which make the bands sensitive to recent market action. The Bollinger bands will expand and contract with market volatility. As a rule, prices are considered to be overextended on the upside (overbought) when they touch the upper band. They are considered overextended on the downside (oversold) when they touch the lower band.
Usually Bollinger bands are used with other technical studies to detect trend reversals. If the prices touch the lower band and another technical study confirms the trend reversal, it should be an opportunity to buy.
Formula
TP = (high + low + close) / 3
MidBand = SimpleMovingAverage(TP)
UpperBand = MidBand + F x σ(TP)
LowerBand = MidBand - F x σ(TP)
Where:
TP = Typical price
F = Standard deviations
Commodity Channel Index (CCI)
Commodity Channel Index (CCI) measures the variation of the price of an underlying asset from its statistical means. High values show that the prices are unusually high compared to average price whereas low values indicate that the prices are unusually low. If prices have moved far enough, a trend is assumed to have established and a trading signal is generated. CCI is calculated by first determining the difference between the mean price of an underlying asset and the average of the means over a given period. The oscillator values is then normalised by using a divisor based on mean deviation. As a result the CCI fluctuates in a constant range from +100 on the upside to -100 on the downside. Long positions are recommended with values over +100 while short positions for values below -100.
Formula
The are four steps to calculate CCI:
- Compute today's average price, using high, low and close:
- Compute a moving average of the n most recent average prices:
- Compute the mean deviation of the n most recent typical prices:
- Compute the Commodity Channel Index:
X1 = 1/3 (High + Low + Close)
X = 1/n
X1
MD = 1/n
|X1 - X|
CCI = (X1 - X) / (0.015*MD)
Where:
n = number of periods in data base
X1 = current typical price
X2 = prior typical price
Xn = oldest typical price in the data base
stands for the sum of items following the symbol, starting with 1 and ending with n, e.g.
X1 = X1 + X2 + X3 ... + Xn
symbol, starting with 1 and ending with n, e.g. | | signifies "absolute value"; difference should be added as if all were positive numbers.
DeMarker
DeMarker indicator is used to measure the demand of the underlying asset through comparing the most recent price action with the previous price. It is used to identify price exhaustion as well as market tops and bottoms. DeMarker is expressed as an oscillator with a scale of -100 to +100.
Directional Movement Indicator (DMI)
The Directional Movement Indicator (DMI) is a useful and versatile technical study that has two significant functions. First, the DMI is an excellent indicator of market direction. Second, one of the DMI’s derivatives is the important average directional movement index (ADX) which not only allows us to identify markets with trends but also gives us a means to quantify the strength of the trends.
The directional movement calculation (DI) is based on the assumption that, when the trend is up, today’s high price should be above yesterday’s high. On the other hand, when the trend is down, today’s low price should be lower than yesterday’s low. The difference between today’s high and yesterday’s high is the “up” directional movement, or +DI. The difference between today’s low and yesterday’s low is the “down” directional movement, or –DI. Inside days, when today’s high or low does not exceed yesterday’s, are essentially ignored.
Elliott Wave
Elliott Wave Principle measures investor psychology
Elliott Wave Theory interprets market actions in terms of recurrent price structures obedient to the Fibonacci sequence. Basically, Market cycles are composed of two major types of Wave: Impulse Wave and Corrective Wave. For every impulse wave, it can be sub-divided into 5 - wave structure (1-2-3-4-5), while for corrective wave, it can be sub-divided into 3 - wave structures (a-b-c). An important feature of Elliott Wave is that they are fractal in nature. 'Fractal' means market structures are built from similar patterns on a larger or smaller scale. Therefore, we can count the wave on a long-term yearly market chart as well as short-term hourly market chart.
Based on the market pattern, we can identify ' where we are' in term of wave count. Nevertheless, as the market pattern is relatively simplistic, there are several rules for valid counts:
- Wave 2 should not break below the beginning of Wave 1;
- Wave 3 should not be the shortest wave among Wave 1, 3 and 5;
- Wave 4 should not overlap with Wave 1, except for wave 1, 5, a or c of a higher degree.
- Rule of Alternation: Wave 2 and 4 should unfold in two different wave forms.
There are three major types of wave form in Impulse Wave:
- Extended Wave: Among Wave 1, 3 and 5, only one should unfolded into extended wave. 'Extension' means the wave is elongated in nature and sub-waves are conspicuous in relation to waves of higher degree.
- Diagonal Triangle at Wave 5: Sometimes, the momentum at Wave 5 is so weak that the 2nd and 4th sub-waves overlap with each other and evolved into diagonal triangle.
- 5th Wave Failure: In some other circumstances, the Wave 5 is so weak than it even cannot surpass the top of the wave 3, causing a double top at the end of the trend.
Corrective Wave forms are rather complicated, but basically we can categorize them into six major wave forms:
- Zig-Zag : abc pattern composed of 5-3-5 sub-wave structure.
- Flat : abc pattern composed of 3-3-5 sub-wave structure, with b equals a.
- Irregular : abc pattern composed of 3-3-5 sub-wave structure, with b longer than a.
- Horizontal Triangle : 5-wave triangular pattern composed of 3-3-3-3-3 sub-wave structure.
- Double Three : abcxabc pattern composed of any two from above, linked by x wave.
- Triple Three : abcxabcxabc pattern composed of any three from above, linked by two x waves.
Envelopes
Envelopes are lines placed at fixed percentages above and below a moving average line. These lines act as bands which are intended to contain and define the price action within a trading range. Any breakout beyond either of the bands should signal the beginning of a trend as the prices are no longer moving within the envelope. Envelopes help determine when a market has travelled too far from its moving average and is overextended.
Formula
EnvHi = input1 + input2 x pct
EnvLo = input1 + input2 x pct
Fibonacci Numbers
Fibonacci Numbers are a sequence of numbers where each successive number is the sum of the two previous numbers. e.g. 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, etc. It is the ratio of the Fibonacci sequence that is significant, rather than the actual numbers in the sequence. The quotient of the adjacent terms in the series possesses an amazing proportion, roughly 1.618, or its inverse 0.618. This proportion is known by many names: the golden ratio, the golden mean, PHI, and the divine proportion. The dimensional properties that adhere to the ratio of 1.618 occur repeatedly in nature including “trading”.
Trading prices will inherently pull back or retrace a percentage of the previous movement before reversing again and then proceeding in the direction of the overall long-term trend. Historical observations demonstrate that these retracement percentages seem to follow a Fibonacci ratio pattern. By carefully plotting these retracement possibilities on a historical price chart, a trader improves his or her probability towards successful trading. Fibonacci ratios describe the interaction between trend and countertrend markets – 38.2%, 50% and 61.8% retracements form the primary pullback levels. Apply these percentages after a trend in either direction to predict the extent of the countertrend swing.
In order to use Fibonacci retracements, it is important to identify relative high and low prices on a historical chart. The longer the term that is utilized, the more likely the Fibonacci retracement lines plotted will identify significant levels of support and resistance. Between these two extremes, one can plot the most significant Fibonacci percentage plot lines of 38.2%, 50%, and 61.8% which will act as support/resistance.
Ichimoku Kinko Hyo (Ichimoku)
A multi-faceted indicator designed to give support/resistance levels, trend direction, and entry/exit points of varying strengths. The most basic theory of this indicator is that if the price is above the cloud, the overall trend is bullish while below the cloud is bearish. When the price is above the cloud, then the top of the cloud will act as a general support level, and when price is below, the cloud base will act as resistance. Since the cloud has thickness, and thus resistance does as well, which by making the cloud thicker reduces the risk of a false breakout. Since support has many layers deep from the offers/bids, a cloud is created to represent the past levels of support/resistance. The cloud is composed of the two Senkou Span lines (A&B or 1&2) which are pushed forward in time, and when the area between them is shaded in, it makes a cloud-like shape. There are also moving averages (the Tenkan and Kijun lines) which act like the MACD crossover signals with the Tenkan crossing from underneath the Kijun as a bullish signal, while crossing overhead giving a bearish signal.
Tenkan & Kijun Lines: The Tenkan Line and the Kijun Line, which are 9 and 26 day moving averages (exponential). The Tenkan Line is really the conversion line which happens when it crosses the Kijun line from underneath, is indicative of a bullish signal or when it crosses over the Kijun line from above pointing downward, it becomes indicative of a bearish signal.
Chikou Span: Chikou Span is representative of today's price moved back 26 periods ago. This is where the strength of the signal comes in. If you have a bearish signal (downward crossover of the Tenkan over the Kijun) and the Chikou Span is below the base, then the signal strength increases. If you have a bullish crossover (Tenkan crosses the Kijun from underneath) and the Chikou Span is above the cloud top, then the signal strength increases.
If the crossover of the two lines (Tenkan & Kijun) occurs above the cloud, then the bullish signal strength increases and is further confirmation. If the crossover occurs below the cloud, then the bearish signal intensifies and is further confirmation. Medium buy/sell signals occur when the crossover takes place in the cloud, and weak occurs when the bullish crossover is below the cloud, while a weak bearish signal occurs above the cloud.
Formula
- Tenkan Line; (highest high + lowest low)/2 calculated over last 9 periods
- Kijun Line; (highest high + lowest low)/2 calculated over last 26 periods.
- Chikou Span; (most current closing price plotted 26 time periods back.
- Senkou Span A; (Tenkan line + Kijun Line)/2 plotted 26 time periods ahead
- Senkou Span B; (highest high + lowest low)/2 calculated over past 52 time periods, sent 26 periods ahead.
Linear Regression Channel
Linear regression channel is created by drawing parallel lines above and below the linear regression trendline using two standard deviations. A linear regression trendline is a straight line drawn through a chart of the underlying asset using the least squares method. This linear regression trendline is displayed as the median line of changing prices which acts as the equilibrium price line. Prices extend above the linear regression trendline, it will attract buyers. On the other hand, if prices extend below the linear regression trendline, it will attract sellers. The bottom channel line indicates support while the top channel line indicates resistance level of the underlying asset. Prices extending outside of the channel would signal a trend reversal. Typically, linear regression is used as a statistical tool to predict the future from past data. It is used to determine when prices are overextended.
Formula
Regression Equation(y) = a + bx
Slope(b) = (NΣXY - (ΣX)(ΣY)) / (NΣX² - (ΣX)²)
Intercept(a) = (ΣY - b(ΣX)) / N
Where:
x and y are the variables
b = The slope of the regression line
a = The intercept point of the regression line and the y axis
N = Number of values or elements
X = First Score
Y = Second Score
ΣXY = Sum of the product of First and Second Scores
ΣX = Sum of First Scores
ΣY = Sum of Second Scores
ΣX² = Sum of square First Scores
Median Price
Median price is the mid-point of the trading range for each period. Using the median price indicators, a line will be plotted on the price chart and can be used as a filter for trend indicator.
Formula
MP = (High + Low) / 2
Momentum
Formula
Mt = Pi - Pi-n
Where:
Mt = current momentum value
Pi = current price
Pi-n = price n periods ago
Money Flow Index (MFI)
Money Flow Index (MFI) is a momentum indicator that is used to ascertain the current trend through analysing the price and volume of the underlying asset. MFI provides measurement of the market’s strength of money going in and out of the underlying asset as well as predicts a trend reversal. MFI is expressed on a scale of 0 to 100 with reading near 0 indicates that a market is oversold, while a reading near 100 indicates a market is overbought.
Formula
Typical Price = ((Day High + Day Low + Day Close) / 3)
Raw Money Flow = (Typical Price) x (Volume)
Positive Money Flow = Sum of Raw Money Flow for the specified number of periods where Typical Price increased
Negative Money Flow = Sum of Raw Money Flow for the specified number of periods where Typical Price decreased
Money Ratio = (Positive Money Flow / Negative Money Flow)
Finally, the MFI can be calculated directly from the Money Ratio:
Money Flow Index = 100 - (100 / (1 + Money Ratio)
The fewer number of days used to calculate the MFI, the more volatile it will be.
Moving Average (MA)
Moving Average (MA) is a trend following indicator used to identify that a new trend has begun or that an old trend has ended or reversed. Moving averages smooth out market fluctuations and short-term volatility. There are 3 major types of moving averages, namely: simple, linearly weighted and exponentially smoothed.
Simple MA
Simple MA is calculated by adding and then averaging a set of numbers representing market action over a given time. It gives equal weight to each price it uses in the data series. The calculation usually involves closing prices but highs, lows or an average of all three can also be used. The oldest data point is dropped as a new one appears. Hence the average “moves” and follows the market. Among the 3 types of MA, simple MA is the most commonly used for its simplicity and effectiveness.
Linearly Weighted MA
Linearly weighted MA is adopted to react quickly to recent data and slowly to older data. It assigns greater importance to more recent data by weighting each day’s data differently. This is usually done by multiplying the most recent data point by a given number (for example, the number of data points used in the MA), adding the result to the overall calculation, then multiplying the next most recent point by a lesser number and so on. The resulting line will be more responsive to recent market activity than the simple MA.
Exponentially Smoothed MA
Exponentially smoothed MA is similar to a linearly weighted MA which assigns greater importance to the more recent data. It also includes in its calculation all of the data in the life of the underlying asset. Hence exponentially smoothed MA is considered the most sophisticated among the three.
Formula
Simple
MAt = P1 + Pt-1 + Pt-2 + ... + Pt-n / n
Where:
MAt = current moving average value
P1, Pt-1, etc = prices t-n periods ago
n = number of periods in the calculation
Weighted
The most common method of weighting a moving average simply multiplies each day's price by the number of days ago the price occurred. In a 10-day weighted moving average, the price today is given 10 times more weight than the price 10 days ago.
WMAt = W1Pt + W2Pt-1 + W3Pt-2 + ... WnPt-n / n
Where:
WMAt = current moving average value
W = the number of periods ago the price occurred
Pt, Pt-1, etc = prices t-n periods ago
n = number of periods in the calculation
Exponential
EMAt = EMAt-1 + (SF * (Pt - EMAt-1))
Where:
EMAt = present EMA value
EMAt-1 = prior EMA value
SF = smoothing factor. The most common smoothing factor is SF = 2/n + 1, where n is the number of periods in the calculation.
Moving Average Convergence-Divergence (MACD)
Moving Average Convergence-Divergence (MACD) is best used in a trending market. MACD is an oscillator technique which uses 3 exponential moving averages though only 2 lines are plotted on the chart. MACD comprises of the MACD line and the signal line. MACD line is the faster line which is the difference between two exponentially smoothed moving averages (usually the last 12 –period and 26-period). The signal line is the approximate exponential equivalent of a 9-period moving average of MACD line. The actual buy and sell signals are generated when both MACD line and the signal line crosses. A crossing by the faster MACD line above the slower signal line is a buy signal. A crossing by the MACD line below the signal line is a sell signal. Additionally the MACD values fluctuate above and below a zero line which resemble an oscillator. An overbought condition is present when the lines are way above the zero line. An oversold condition is present when the lines are way below the zero line. As such the best buy signals occur below the zero line while the best sell signals occur above the zero line.
Formula
MACD consists of a first line that is the difference between two exponential moving averages, and a second "signal" line which is an exponential moving average of the first list.
The first line is computed as follows:
MACD1t = (EMA1 - EMA2)
Where:
MACD1t = current MACD
EMA1 = an exponential moving average
EMA2 = an exponential moving average
The signal line is computed as follows:
SIGT = SIGt-1 + (SC * (MACD1t - SIGt-1))
Where:
SIGT = current signal line value
SIGt-1 = previous signal line value
MACD1t = current MACD value
SC = smoothing constant. This is derived from the number of days in the exponential calculation (see Moving Average section)
Parabolic SAR
Parabolic SAR is a trend following technical study as well as a time/price reversal system. SAR is the abbreviation for ‘Stop and Reverse’ which when used in this context means that the position is reversed when the protective stop is hit. Parabolic SAR helps to tighten stops at an accelerating rate whenever a new high or low is reached. Additionally Parabolic SAR allows stop to remain distant for a brief period and then relentlessly moving it closer, regardless of the price action. As such the prices must continue to move in the direction of the trend or the position will be stopped out.
Parabolic SAR is commonly used as a method of setting stops. The Parabolic calculation results in a series of trailing stops that if hit indicate a trend reversal. The SAR numbers are recalculated everyday (or every time period) and get tighter as the trend progresses. If the trend fails to continue, the moving stop will reverse the position and a new time period begins.
Formula
The first ParabolicSAR (Stop and Reverse) point in a data series is the extreme price of the prior Prabolic trade; thus SARt = EPprior. Subsequent SARs are calculated as follows:
SARt = SARt-1 + (AF * (EPprior - SARt-1))
Where:
SARt = current SAR
SARt-1 = prior SAR
EP = extreme price
AF = acceleration factor. The AF normally starts at 0.02 and steps up in increments of 0.02 to a maximum of 0.20.
Pivot Points
Pivot points are mainly used by daytraders to forecast today’s support and resistance levels using previous day’s high, low and close levels. It is used as a predictive indicator and the calculation is fairly simple. First derive the average price of the previous day’s high, low and close. To find today’s pivot point high, use previous day’s average price, multiply it by two, and then subtract the previous day’s low. This will be today’s resistance level. Similarly to find today’s pivot point low, use previous day’s average price, multiply it by two, and then subtract the previous day’s high. This will be today’s support level. As these are calculated numbers and not chart points, they may not be reliable and accurate at most times.
Formula
Pivot Point = 1/3(Previous day’s High + Low +Close)
Support level 1 = Pivot Point x2 – Previous day’s High
Support level 2 = Pivot Point – Previous day’s High + Previous day’s Low
Resistance level 1 = Pivot Point x2 – Previous day’s Low
Resistance level 2 = Pivot Point + Previous day’s High – Previous day’s Low
Rate of Change (ROC)
Rate of Change (ROC) is similar to the momentum oscillator with the only difference in the formula. To measure the ROC, a ratio is constructed of the most recent closing price to a price a certain number of days in the past. For ROC, the 100 level is equivalent to the zero line on the momentum graph. Unlike momentum, ROC does not have negative number. If the latest price is higher than the price a certain number of days ago, the resulting ROC value will be above 100. If the latest price is lower than the price a certain number of days ago, the ROC ratio will be below 100.
Formula
ROCt = (Pi/Pi-n) * 100
Where:
ROCt = current rate of change value
Pi = current price
Pi-n = price n periods ago
Relative Strength Index (RSI)
The Relative Strength Index (RSI) is a popular countertrend oscillator which gives overbought and oversold signals of the market condition. RSI also produces long-term divergence patterns, which can be used to give timely indications of major tops and bottoms. The RSI calculates the ratio of up closes to down closes over the time period selected and expresses the result as an oscillator with a scale of 0 to 100. Most often RSI is calculated on a 14 day period. The shorter the time period, the more sensitive the oscillator becomes and the wider its amplitude. Readings near 0 indicate when a market is oversold, readings near 100 indicate overbought.
Formula
The RSI calculation is a two-step process. First, calculate the Close-to-Close price differences as follows:
Ut = (UP1 + UP2 + ... + UPn) / n
Dt = (DN1 + DN2 + ... + DNn) / n
Where:
Ut = the Up average for the n period
Dt = the Down average for the n period
UP1 = the first upwards Close-to-Close price differences in the data series, UP2 the second, etc
DN1 = the first downward Close-to-Close price differences in the data series, DN2 the second, etc
n = the number of periods in the calculation
Then:
RSIt = (Ut/(Ut + Dt)) * 100
Stochastic Oscillator
Stochastic oscillator is a tool that is best suitable in non-trending or broad trading ranges markets. Stochastic is based on the observation that as prices increase, closing prices tend to be closer to the upper end of the price range. In downtrends, the closing price tends to be near the lower end of the range. In this technical study, two lines are used – the %K line and the %D line.
%K is today’s close minus the low of the last n days, divided by the high of the last n days minus the low of the last n days. This formula measures on a percentage basis of 0 to 100, where the closing price is in relation to the total price range for a selected time period. A reading of over 80 would imply that the closing price is near the top of the range, while a reading of below 20 would imply near the bottom of the range.
%D is a three-day moving average of %K which produces a so-called fast stochastic, which is rarely used as it is overly sensitive. By taking another 3 period average of %D, a smoother version called slow stochastic is computed and more commonly used because of its more reliable signals.
The above formulae produce two lines that oscillate between a scale of 0 to 100. The K line is a faster line and the D line is a slower line. The major signal to watch for is a divergence between the D line and the price of the underlying market when the D line is in an overbought or oversold area. The upper and lower extremes are the 80 and 20 values. A bearish divergence occurs when the D line is over 80 and forms two declining peaks while prices continue to move higher. A bullish divergence is present when the D line is under 20 and forms two rising bottoms while prices continue to move lower. The actual buy or sell signal is triggered when the K line and D line crosses.
Formula
Slow stochastics are derived from fast stochastics, which in turn are derived from the basic stochastic calculation for raw %K, which is:
%K rawt = ((Closet - Lown) / (Highn - Lown)) * 100
Where:
%K rawt = current raw %K
Closet = current close
Highn = the high of the past n periods
Lown = the low of the past n periods
n = number of periods
Then
%Kt = ((%Kt - 1 * 2) + %K rawt) / 3
Where:
%Kt = current fast %K
%Kt-1 = prior fast %K
%Kt-1 = prior fast %K
%K rawt = current raw %K
2 = a smoothing constant
%D is a three-period moving average of %K, thus:
%Dt = ((%Dt-1 * 2) + %Kt) / 3
Slow stochastics are derived as follows:
%K slow = %D fast
%D is again a three-period moving average of %K.
%D slowt = ((%D slowt-1 * 2) + %K slowt-1) / 3
Where:
%D slowt = current slow %D
%D slowt-1 = slow %D for the prior period
%K slowt-1 = slow %K for the prior period
Williams Percent Rate (%R)
Percent Rate (%R) is designed to identify overbought and oversold areas in a non-trending market. It is the originator of Stochastic Oscillator. %R is calculated by subtracting today’s close from the price high of the range for a given number of days and the difference is divided by the total range for the same period. Since %R is subtracted from the high, it is plotted on a reverse scale of 0 to minus 100. When the closing price is in the upper portion of the range, the market is considered to be overbought. When the close is in the lower portion of the range, the market is considered to be oversold.
Formula
%Rt = ((Highn - Closet) / (Highn - Lown)) * 100
Where:
%Rt = current %R
Highn = the highest price for the past n trading periods
Lown = the lowest price for the past n trading periods
Closet = current close
n = number of periods in the calculation

