Setting-Less Trend-Step Filtering


Indicators settings have been a major concern in trading strategies, in order to provide the best results each indicators involved in the strategy must have its settings optimized, when using only 1 indicator this task can easily be achieved, but an increasing number of indicators involve more slower computations, lot of softwares will use brute force for indicators settings optimization, this involve testing each indicator settings and see which setting/combination maximize the equity, in order to fasten this process softwares can use a user defined range for the indicator settings. Nonetheless the combination that maximize the equity at time t might be different at time t+1...n.

Therefore i propose an indicator without any numerical setting that aim to filter small price variations using the architecture of the T-step lsma , such indicator can provide robust filtering and can therefore be used as input for other indicators.

Robustness Vs Non Robustness

Robustness is often defined as the ability of certain statistical tools to be less affected by outliers, outliers are defined as huge variations in a data-set, high volatility movements and large gaps might be considered as outliers. However here we define robustness as the ability of an indicator to be non affected by price variations that are not correlated with the main trend, which can be defined in technical analysis as pullbacks.

Some small pullbacks in INTEL , the indicator is not affected by them, which allow the indicator to filter the price in a "smart" way.

This effect is made possible by using exponential averaging in the indicator, exponential averaging is defined as y = sc*x + (1-sc)*y, with 1 > sc > 0. Here sc is calculated in a similar way as the kalman gain, which is in the form of a/(a + b), in our case this is done with :

sc = abs(input - nz (b))/(abs(input - nz (b)) + nz (a))

Non Robust Version Of The Indicator

The user is allowed to use the non robust version of the indicator by unchecking "robust" in the setting panel, this allow a better fit with the price at the cost of less filtering.

robust checked

robust unchecked


I proposed a technical indicator that aim to filter short frequencies without the use of parameters, the indicator proven to be robust to various pullbacks and therefore was able to follow the main trend, although using the term trend for such small price variations might be wrong. Removing high frequencies is always beneficial in trading, noisy series are harder to manipulate, this is why you'll see a lot of indicators using median price often defined as hl2 instead of the closing price.

Like previous settings-less indicators i published this one can behave differently depending on the time frame selected by the user, lower time frames will make the indicator filter more. I'll try to make more setting-less indicators that will correct this effect.


The support and interest of the community is only thing that allowed me to be where i'am today, i'am thankful. Special thanks to the tv staff, LucF, and my family who may not have believed in this project but are still proud of their son.

Keluarkan daripada Skrip Pilihan Tambah kepada Skrip Pilihan
« Je suis las des cruautés de mes semblables, qui ne sont pas mes pareils.

« Je prendrai l’essor et je m’envolerai vers la mer.

« Je connaîtrai le goût des brises du large. J’entendrai les grands cris de la tempête.


It's excellent. Well done.
+2 Balas
alexgrover ashleylemmer
@ashleylemmer, Glad to hear it :) Thanks for your support.
I've been playing around with this indicator a while now alex, and i gotta say it's really powerful and impressive, so I tried to put it ontop of a kaufman adaptive moving average.Have you tried mixing adaptive moving averages with step filtering?
+1 Balas
alexgrover CharlesVein7777
@CharlesVein7777, Hi and thx for your comment, I don't think I have mixes between adaptive moving averages and step filtering, that could be an idea for a future indicator.
great work alex.I like it so much. your explanation is very helpful. I'm interested in the subject (frequency and filtering ...). could you please introduce a source for that?
Thank you so much...!!!
+1 Balas
+1 Balas
what does code "cum(1)" means???
read pine script doc file can not understand.
+1 Balas
alexgrover XIAOMEIXW
@XIAOMEIXW, cum(1)-1 is just a sequence of numbers 1,2,3..., i use it instead of bar_index because bar_index has repainting issues.
+1 Balas
XIAOMEIXW alexgrover
@alexgrover, now I know, Thank you for your dedication.
+1 Balas
Thanks Alex for sharing!!!!! Vow!!!!!! It is Great!!!!! Love it!!!!!
+1 Balas
Laman Utama Penyaring Saham Penyaring Forex Penyaring Kripto Kalendar Ekonomi Bagaimana ia berfungsi Ciri-ciri Carta Harga Rujuk rakan Peraturan Dalaman Pusat Bantuan Laman web dan Penyelesaian Broker Widget Penyelesaian Pencartaan Perpustakaan Pencartaan yang Ringan Blog & Berita Twitter
Profil Tetapan Profil Akaun dan Pengebilan Kawan-kawan yang dirujuk Coin Tiket Sokongan Saya Pusat Bantuan Idea yang diterbitkan Pengikut Mengikuti Mesej Peribadi Sembang Daftar Keluar