Skip to content

Latest commit

 

History

History
101 lines (69 loc) · 3.75 KB

momentum_indicators.md

File metadata and controls

101 lines (69 loc) · 3.75 KB

Momentum Indicators

Momentum indicators measure the speed of movement.

Awesome Oscillator

The AwesomeOscillator function calculates the awesome oscillator based on low and high daily prices for a given stock. It is an indicator used to measure market momentum.

Median Price = ((Low + High) / 2)
AO = 5-Period SMA - 34-Period SMA.
result := indicator.AwesomeOscillator(low, high)

Chaikin Oscillator

The ChaikinOscillator function measures the momentum of the Accumulation/Distribution (A/D) using the Moving Average Convergence Divergence (MACD) formula. It takes the difference between fast and slow periods EMA of the A/D. Cross above the A/D line indicates bullish.

CO = Ema(fastPeriod, AD) - Ema(slowPeriod, AD)
co, ad := indicator.ChaikinOscillator(fastPeriod, slowPeriod, high, low, closing)

Most frequently used fast and short periods are 3 and 10. The DefaultChaikinOscillator function calculates Chaikin Oscillator with those periods.

Ichimoku Cloud

The IchimokuCloud, also known as Ichimoku Kinko Hyo, calculates a versatile indicator that defines support and resistence, identifies tred direction, gauges momentum, and provides trading signals.

Tenkan-sen (Conversion Line) = (9-Period High + 9-Period Low) / 2
Kijun-sen (Base Line) = (26-Period High + 26-Period Low) / 2
Senkou Span A (Leading Span A) = (Conversion Line + Base Line) / 2
Senkou Span B (Leading Span B) = (52-Period High + 52-Period Low) / 2
Chikou Span (Lagging Span) = Closing plotted 26 days in the past.
conversionLine, baseLine, leadingSpanA, leadingSpanB, laggingLine := indicator.IchimokuCloud(high, low, closing)

Relative Strength Index (RSI)

The Rsi function calculates a momentum indicator that measures the magnitude of recent price changes to evaluate overbought and oversold conditions.

RS = Average Gain / Average Loss
RSI = 100 - (100 / (1 + RS))
rs, rsi := indicator.Rsi(closing)

Stochastic Oscillator

The StochasticOscillator function calculates a momentum indicator that shows the location of the closing relative to high-low range over a set number of periods.

K = (Closing - Lowest Low) / (Highest High - Lowest Low) * 100
D = 3-Period SMA of K
k, d := indicator.StochasticOscillator(high, low, closing)

Williams R

The WilliamsR function calculates the Williams R based on low, high, and closing prices. It is a type of momentum indicator that moves between 0 and -100 and measures overbought and oversold levels.

WR = (Highest High - Closing) / (Highest High - Lowest Low)
result := indicator.WilliamsR(low, high, closing)

Disclaimer

The information provided on this project is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.

License

Copyright (c) 2021 Onur Cinar. All Rights Reserved.

The source code is provided under MIT License.