TradingView
yatrader2
2021年8月16日午後6時54分

FIR Hann Window Indicator (Ehlers) 

SPDR S&P 500 ETF TRUSTArca

詳細

From Ehlers' Windowing article:

"A still-smoother weighting function that is easy to program is called the Hann window. The Hann window is often described as a “sine squared” distribution, although it is easier to program as a cosine subtracted from unity. The shape of the coefficient outline looks like a sinewave whose valleys are at the ends of the array and whose peak is at the center of the array. This configuration offers a smooth window transition from the smallest coefficient amplitude to the largest coefficient amplitude."

Ported from: { TASC SEP 2021 FIR Hann Window Indicator } (C) 2021 John F. Ehlers
Stocks & Commodities V. 39:09 (8–14, 23): Windowing by John F. Ehlers
Original code found here: traders.com/Documentation/FEEDbk_docs/2021/09/TradersTips.html
FIR Chart: traders.com/Documentation/FEEDbk_docs/2021/09/images/TT-Tradestation1.gif
ROC Chart: traders.com/Documentation/FEEDbk_docs/2021/09/images/TT-Tradestation1.gif

Ehlers style implementation mostly maintained for easy verification.
Added optional ROC display.

Style and efficiency updates + Hann windowing as a function coming soon.

Indicator added twice to chart show both FIR and ROC.
コメント
hdzavalanche
Thank you for this script, yatrader2. However, it contains a significant operator precedence bug.

ROC = (Length / 2*math.pi)*(Filt - Filt[1])
should be:
ROC = (Length / (2*math.pi))*(Filt - Filt[1])
apdusp
@hdzavalanche, actually ROC = (Length / (2*math.pi))*(Filt - Filt[1])
詳細