The Laguerre filter is really cool. But the evaluation of Gamma is not always obvious. I propose here a filter of my own, named for the occasion “Carnazzi filter”, which is none other than a Laguerre filter preceded by an estimation function of the Gamma parameterized by a period length. The estimation function is designed to be strongly correlated with what would be given by an ALMA.
Intuitively, I think that the calculation of the Delta correction factor can be computed more formally but this requires signal processing knowledge that I don’t have 🙂
Your comments/modifications on the Delta refinement are welcome 😉
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
//Indicateur: Filtre de Carnazzi //(c) 2021 Bruno Carnazzi // Params Length = 200 Series = CustomClose once l0 = Series once l1 = Series once l2 = Series once l3 = Series IF BarIndex = 0 THEN AFR = Series if length <= 50 then delta = 12 elsif length <= 200 then delta = 16 else delta = 16 * (200/length) endif corrlength = length + delta gamma = 2 * (1 - 1/(0.1*corrlength)) - 1 if gamma < 0 then gamma = 0 endif ELSE l0 = (1 - gamma) * Series + gamma * l0[1] l1 = -gamma * l0 + l0[1] + gamma * l1[1] l2 = -gamma * l1 + l1[1] + gamma * l2[1] l3 = -gamma * l2 + l2[1] + gamma * l3[1] AFR = (l0 + 2 * l1 + 2 * l2 + l3) / 6 ENDIF return AFR |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
how do you use carnazzi filter in a strategy : smoothing , stop ,tendance
I have completely revised the mathematical foundations of this tool and offer you the finalized version here: https://market.prorealcode.com/product/carnazzi-filter/
Very hard to beat 🙂