Hilbert Transform Instantaneous Trendline
get_ht_trendline(quotes)
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? |
Historical quotes requirements
You must have at least 100
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.
Return
HTTrendlineResults[HTTrendlineResult]
- This method returns a time series of all available indicator values for the
quotes
provided. -
HTTrendlineResults
is just a list ofHTTrendlineResult
. - 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
periods will haveNone
values forsmooth_price
since there’s not enough data to calculate.
Convergence warning: The first
100
periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.
HTTrendlineResult
name | type | notes |
---|---|---|
date |
datetime | Date |
trendline |
float, Optional | HT Trendline |
smooth_price |
float, Optional | Weighted moving average of (H+L)/2 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_history_from_feed("SPY")
# Calculate HT Trendline
results = indicators.get_ht_trendline(quotes)
About Hilbert Transform Instantaneous Trendline
Created by John Ehlers, the Hilbert Transform Instantaneous Trendline is a 5-period trendline of high/low price that uses signal processing to reduce noise.
[Discuss]