Awesome Oscillator (AO)
get_awesome(quotes, fast_periods=5, slow_periods=34)
Parameters
| name | type | notes |
|---|---|---|
quotes | Iterable[Quote] | Iterable of the Quote class or its sub-class. • See here for usage with pandas.DataFrame |
fast_periods | int, default 5 | Number of periods (F) for the faster moving average. Must be greater than 0. |
slow_periods | int, default 34 | Number of periods (S) for the slower moving average. Must be greater than fast_periods. |
Historical quotes requirements
You must have at least S periods of quotes to cover the warmup periods.
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.
Returns
AwesomeResults[AwesomeResult]
- This method returns a time series of all available indicator values for the
quotesprovided. AwesomeResultsis just a list ofAwesomeResult.- 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 period
S-1periods will haveNonevalues since there’s not enough data to calculate.
AwesomeResult
| name | type | notes |
|---|---|---|
date | datetime | Date |
oscillator | float, Optional | Awesome Oscillator |
normalized | float, Optional | 100 × oscillator ÷ (median price) |
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_historical_quotes("SPY")
# calculate
results = indicators.get_awesome(quotes, 5, 34)
About Awesome Oscillator (AO)
Created by Bill Williams, the Awesome Oscillator (aka Super AO) is a measure of the gap between a fast and slow period modified moving average. [Discuss] 💬
