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 https://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
ลบออกจากสคริปส์โปรด เพิ่มเข้าไปในสคริปส์โปรด
Patreon: https://www.patreon.com/alexgrover

Become a Patreon and get access to exclusive technical indicators!

You can also check out some of the indicators I made for luxalgo : https://www.tradingview.com/u/LuxAlgo/#published-scripts

ความคิดเห็น

Thank you @alexgrover for creating and publishing this Awesome Script !!! :)
I have put 7 of them on my chart @ lengths :5,15,30,60,90, 180 , and 360 (hlc3)
I have no idea how it works but I have used it every day for over 6 months now
and I have to say I really like the indicator
this is an underrated gem in my view

Thank you for being an inspiration to new pinescript enthusiasts

in my view your "Multi Depth Zero-Lag Exponential Moving Average" is the best thing since the classic "EMA" ribbon
I would also have to shout out the McGinley Dynamic as it is a favourite of my as well
and I all most for got the Vwap

after a bit of poking and prodding I was able to modify the script to be V4 compatible
when I get a bit better than I am now
I hope to have a ribbon of many lengths of this indicator in one script :)

Thank you kindly
+1 ตอบกลับ
alexgrover iamthree
@iamthree, Thanks a lot for your comment :) I am glad to hear your are using the indicator and that I could inspire others with my code, it means a lot ^^
+1 ตอบกลับ
iamthree alexgrover
@alexgrover, absolutely :)

I think i saw you do this once and now I cant stop

//----------------------------------------------------------------------------

or //----

its the small things in life (hahahahahaha lol ) + :)

seriously though just looking though your scripts is an education :)

I just play with the code untill I find a synergy or harmony with my other indicators
that way they play of each other

I like this one because like it says on the description "LAG REDUCTION"
some times quicker is better !!! .... :)
ตอบกลับ
Very nice creations, thanks for your efforts and generosity =D
+1 ตอบกลับ
@ICEKI, Thank you for your support as always (how many times did i said that ?) :)
ตอบกลับ
ICEKI alexgrover
@alexgrover, LOL you're welcome no problem =D
+1 ตอบกลับ
Thank you for this line.
+1 ตอบกลับ
alexgrover aaahopper
@aaahopper, You are welcome :)
ตอบกลับ
หน้าแรก ตัวช่วยคัดกรองหุ้น ตัวคัดกรองฟอเร็กซ์ ตัวคัดกรองคริปโต ปฏิทินเศรษฐกิจ มันทำงานได้อย่างไร ฟีเจอร์ของชาร์ต อัตราค่าบริการ แนะนำเพื่อน กฎระเบียบการใช้งาน ศูนย์ช่วยเหลือ โซลูชั่นสำหรับเว็บไซต์ & โบรกเกอร์ วิดเจ็ต ชาร์ตโซลูชั่น Lightweight ชาร์ตไลบรารี บล็อก & ข่าว Twitter
โปรไฟล์ ตั้งค่าโปรไฟล์ บัญชีและการเรียกเก็บเงิน เพื่อนที่ชวนมา เหรียญ ตั๋วการขอความสนับสนุนของฉัน ศูนย์ช่วยเหลือ ไอเดียที่เผยแพร่ ผู้ติดตาม ติดตาม ข้อความส่วนตัว แชท ออกจากระบบ