Williams Alligator

get_alligator(quotes, jaw_periods==13, jaw_offset=8, teeth_periods=8, teeth_offset=5, lips_periods=5, lips_offset=3)

Parameters

name type notes
quotes Iterable[Quote] Iterable of the Quote class or its sub-class.
See here for usage with pandas.DataFrame
jaw_periods int, default 13 Number of periods (JP) for the Jaw moving average. Must be greater than teeth_periods.
jaw_offset int, default 8 Number of periods (JO) for the Jaw offset. Must be greater than 0.
teeth_periods int, default 8 Number of periods (TP) for the Teeth moving average. Must be greater than lips_periods.
teeth_offset int, default 5 Number of periods (TO) for the Teeth offset. Must be greater than 0.
lips_periods int, default 5 Number of periods (LP) for the Lips moving average. Must be greater than 0.
lips_offset int, default 3 Number of periods (LO) for the Lips offset. Must be greater than 0.

Historical quotes requirements

You must have at least 115 periods of quotes. Since this uses a smoothing technique, we recommend you use at least 265 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.

Returns

AlligatorResults[AlligatorResult]

Convergence warning: The first JP+JO+100 periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.

AlligatorResult

name type notes
date datetime Date
jaw float, Optional Alligator’s Jaw
teeth float, Optional Alligator’s Teeth
lips float, Optional Alligator’s Lips

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 the Williams Alligator
results = indicators.get_alligator(quotes)

About Williams Alligator

Created by Bill Williams, Alligator is a depiction of three smoothed moving averages of median price, showing chart patterns that compared to an alligator’s feeding habits when describing market movement. The moving averages are known as the Jaw, Teeth, and Lips, which are calculated using specific lookback and offset periods. See also the Gator Oscillator. [Discuss] 💬

image

Sources