Tillson T3 Moving Average
get_t3(quotes, lookback_periods=5, volume_factor=0.7)
Parameters
name | type | notes |
---|---|---|
quotes | Iterable[Quote] | Iterable of the Quote class or its sub-class. • See here for usage with pandas.DataFrame |
lookback_periods | int, default 5 | Number of periods (N ) for the EMA smoothing. Must be greater than 0 and is usually less than 63. |
volume_factor | float, default 0.7 | Size of the Volume Factor. Must be greater than 0 and is usually less than 2. |
Historical quotes requirements
You must have at least 6×(N-1)+100
periods of quotes
to cover the convergence periods. Since this uses a smoothing technique, we recommend you use at least 6×(N-1)+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
T3Results[T3Result]
- This method returns a time series of all available indicator values for the
quotes
provided. T3Results
is just a list ofT3Result
.- 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
6×(N-1)
periods will haveNone
values since there’s not enough data to calculate.
⚞ Convergence warning: The first
6×(N-1)+250
periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.
T3Result
name | type | notes |
---|---|---|
date | datetime | Date |
t3 | float, Optional | T3 Moving Average |
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 5-period T3
results = indicators.get_t3(quotes, 5, 0.7)
About Tillson T3 Moving Average
Created by Tim Tillson, the T3 indicator is a smooth moving average that reduces both lag and overshooting. [Discuss] 💬