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.

從常用腳本中移除 新增至常用腳本

Become a Patreon and get access to exclusive technical indicators!

You can also check out some of the indicators I made for luxalgo :


It's excellent. Well done.
+2 回覆
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 回覆
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 回覆
+1 回覆
what does code "cum(1)" means???
read pine script doc file can not understand.
+1 回覆
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 回覆
XIAOMEIXW alexgrover
@alexgrover, now I know, Thank you for your dedication.
+1 回覆
Thanks Alex for sharing!!!!! Vow!!!!!! It is Great!!!!! Love it!!!!!
+1 回覆
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 如何運作 圖表功能 價格 推薦朋友 網站規則 幫助中心 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 部落格 & 新聞 推特
概覽 個人資料設定 賬戶和賬單 推薦朋友 代幣 我的客服工單 幫助中心 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出