TradingView
alexgrover
6 de Out de 2019 17:21

Setting-Less Trend-Step Filtering 

Intel CorporationNASDAQ

Descrição

Introduction

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[1]))/(abs(input - nz(b[1])) + nz(a[1]))

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

Conclusion

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.

Acknowledgements

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.





Comentários
ashleylemmer
It's excellent. Well done.
alexgrover
@ashleylemmer, Glad to hear it :) Thanks for your support.
CharlesVein7777
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?
alexgrover
@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.
ronakmylove57
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...!!!
Old_tom
Thanks
XIAOMEIXW
what does code "cum(1)" means???
read pine script doc file can not understand.
alexgrover
@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.
XIAOMEIXW
@alexgrover, now I know, Thank you for your dedication.
sudhir.mehta
Thanks Alex for sharing!!!!! Vow!!!!!! It is Great!!!!! Love it!!!!!
Mais