Hilbert Transform Instantaneous Trendline

get_ht_trendline(quotes)

Parameters

name type notes
quotes Iterable[Quote] Iterable of the Quote class or its sub-class.
See here for usage 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]

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
dc_periods int, Optional Dominant cycle periods (smoothed)
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_historical_quotes("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] 💬

image

Sources