alexgrover

Multi Poles Zero-Lag Exponential Moving Average

Introduction

Based on the exponential averaging method with lag reduction, this filter allow for smoother results thanks to a multi-poles approach. Translated and modified from the Non-Linear Kalman Filter from Mladen Rakic 01/07/19 www.mql5.com/en/code/24031

The Indicator

length control the amount of smoothing, the poles can be from 1 to 3, higher values create smoother results.

Difference With Classic Exponential Smoothing

A classic 1 depth recursion (Single smoothing) exponential moving average is defined as y = αx + (1 - α)y which can be derived into y = y + α(x - y)

2 depth recursion (Double smoothing) exponential moving average sum y with b in order to reduce the error with x, this method is calculated as follow :

  • y = αx + (1 - α)(y + b)
  • b = β(y - y) + (1-β)b

The initial value for y is x while its 0 for b with α generally equal to 2/(length + 1)

The filter use a different approach, from the estimation of α/β/γ to the filter construction.The formula is similar to the one used in the double exponential smoothing method with a difference in y and b

  • y = αx + (1 - α)y
  • d = x - y
  • b = (1-β)b + d
  • output = y + b

instead of updating y with b the two components are directly added in a separated variable. Poles help the transition band of the frequency response to get closer to the cutoff point, the cutoff of an exponential moving average is defined as :

Cf = F/2π acos(1 - α*α/(2(1 - α)))


Also in order to minimize the overshoot of the filter a correction has been added to the output now being output = y + 1/poles * b

While this information is far being helpful to you it simply say that poles help you filter a great amount of noise thus removing irregularities of the filter.

Conclusion

The filter is interesting and while being similar to multi-depth recursion smoothing allow for more varied results thanks to its 3 poles.

Feel free to send suggestions :)

Thanks for reading

Check out the indicators we are making at luxalgo: www.tradingview.com/u/LuxAlgo/
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?