TradingView
hajixde
25. Jun. 2021 23:15

Hodrick-Prescott (HP) filter 

Bitcoin / United States DollarCoinbase

Beschreibung

This indicator is an implamentation of Hodrick-Prescott (HP) filter
This filter is a mathematical model the can remove cyclical components from the price signal to get the trend components.
  • "Lambda" is the smoothing factor and can have a value between 1 and infinity.
  • "Length" is the number of previous prices that are included in the filter.

The default values of lambda and length work well for almost all time frames.

Versionshinweise

Converted to v5
Kommentare
loxx
My man, powerful, good work! This is a nice detrender.
willkm3
Thanks for sharing this. Great tool to detrend data. I have seen the following formula for determining Lambda.

# Normal Rule of thumb is Lambda = 100*(number of periods in a year)^2
# For Quarterly Data = 100 * 4^2 = 1600
# For Monthly Data = 100 * 12^2 = 14400

Following this calculation would make Lambda for weekly data 270,400, and 13,322,500 on daily data. Thoughts?

Thanks again...
Mehr