Chaikin Oscillator
get_chaikin_osc(quotes, fast_periods=3, slow_periods=10)
Parameters
name | type | notes |
---|---|---|
quotes |
Iterable[Quote] | Iterable(such as list or an object having __iter__() ) of the Quote class or its sub-class. • Need help with pandas.DataFrame? |
fast_periods |
int, default 3 | Number of periods (F ) in the ADL fast EMA. Must be greater than 0 and smaller than S . |
slow_periods |
int, default 10 | Number of periods (S ) in the ADL slow EMA. Must be greater F . |
Historical quotes requirements
You must have at least 2×S
or S+100
periods of quotes
, whichever is more, to cover the convergence periods. Since this uses a smoothing technique, we recommend you use at least S+250
data points prior to the intended usage date for better precision.
quotes
is an Iterable[Quote]
collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.
Return
ChaikinOscResults[ChaikinOscResult]
- This method returns a time series of all available indicator values for the
quotes
provided. -
ChaikinOscResults
is just a list ofChaikinOscResult
. - It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The first
S-1
periods will haveNone
values forOscillator
since there’s not enough data to calculate.
Convergence warning: The first
S+100
periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.
ChaikinOscResult
name | type | notes |
---|---|---|
date |
datetime | Date |
money_flow_multiplier |
float, Optional | Money Flow Multiplier |
money_flow_volume |
float, Optional | Money Flow Volume |
adl |
float, Optional | Accumulation Distribution Line (ADL) |
oscillator |
float, Optional | Chaikin Oscillator |
Warning: absolute values in MFV, ADL, and Oscillator are somewhat meaningless. Use with caution.
Utilities
See Utilities and Helpers for more information.
Example
from stock_indicators import indicators
# This method is NOT a part of the library.
quotes = get_history_from_feed("SPY")
# Calculate 20-period Chaikin Oscillator
results = indicators.get_chaikin_osc(quotes, 20)
About Chaikin Oscillator
Created by Marc Chaikin, the Chaikin Oscillator is the difference between fast and slow Exponential Moving Averages (EMA) of the Accumulation/Distribution Line (ADL). [Discuss]