DonovanWall

Resampling Filter Pack [DW]

This is an experimental study that calculates filter values at user defined sample rates.
This study is aimed to provide users with alternative functions for filtering price at custom sample rates.

First, source data is resampled using the desired rate and cycle offset. The highest possible rate is 1 bar per sample ( BPS ).
There are three resampling methods to choose from:
-> BPS - Resamples based on the number of bars.
-> Interval - Resamples based on time in multiples of current charting timeframe.
-> PA - Resamples based on changes in price action by a specified size. The PA algorithm in this script is derived from my Range Filter algorithm.
The range for PA method can be sized in points, pips, ticks, % of price, ATR, average change, and absolute quantity.

Then, the data is passed through one of my custom built filter functions designed to calculate filter values upon trigger conditions rather than bars.
In this study, these functions are used to calculate resampled prices based on bar rates, but they can be used and modified for a number of purposes.
The available conditional sampling filters in this study are:
-> Simple Moving Average ( SMA )
-> Exponential Moving Average ( EMA )
-> Zero Lag Exponential Moving Average ( ZLEMA )
-> Double Exponential Moving Average ( DEMA )
-> Rolling Moving Average (RMA)
-> Weighted Moving Average ( WMA )
-> Hull Moving Average ( HMA )
-> Exponentially Weighted Hull Moving Average (EWHMA)
-> Two Pole Butterworth Low Pass Filter (BLP)
-> Two Pole Gaussian Low Pass Filter (GLP)
-> Super Smoother Filter ( SSF )

Downsampling is a powerful filtering approach that can be applied in numerous ways. However, it does suffer from a trade off, like most studies do.
Reducing the sample rate will completely eliminate certain levels of noise, at the cost of some spectral distortion. The lower your sample rate is, the more distortion you'll see.
With that being said, for analyzing trends, downsampling may prove to be one of your best friends!
從常用腳本中移除 新增至常用腳本

評論

thanks for sharing this great work! it would be very interesting to combine novel moving averages together with filters ;)
+3 回覆
This publication is now featured in our Editors' Picks. In the name of all TradingView traders, thank you for your valuable contribution to the TradingView community, and congrats!
+2 回覆
What setting do you set it to so that alerts trigger a buy or sell-off of the changing green/red line?
+1 回覆
@mbver, For color switch alerts, all you need to do is set up a couple alert conditions using the filter_dir variable in the code. This holds the direction state that powers the color scheme.

Simply take this snippet and paste it to the bottom of your code.

https://0bin.net/paste/GB9hgCli#GfJQSNaNmM4g2HcYB7DgRmJkH0nsX86Cq8j51IJvvuB

Then you'll be able to access the conditions from your alert creation interface using the conditions "Bullish Switch" and "Bearish Switch", or whatever you choose to name them.
+1 回覆
mbver DonovanWall
@DonovanWall, Thank you! really appreciate the help. Does the color switching repaint at all also?
+1 回覆
@mbver, Nope. Once closed, the colors will remain constant.
+2 回覆
thansk for this inc, is this work at 1D and 15 mint chart
+1 回覆
DonovanWall tapandave
@tapandave, Yes, this script is not timeframe specific. You can use it on any chart you'd like.
+1 回覆
tapandave DonovanWall
@DonovanWall, thanks for reply, keep going , post more amazing indicators.
+1 回覆
Still learning support/resist levels.
+1 回覆
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 如何運作 圖表功能 價格 推薦朋友 網站規則 幫助中心 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 部落格 & 新聞 推特
概覽 個人資料設定 賬戶和賬單 推薦朋友 代幣 我的客服工單 幫助中心 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出