PineCodersTASC

TASC 2024.05 Ultimate Channels and Ultimate Bands

█ OVERVIEW

This script, inspired by the "Ultimate Channels and Ultimate Bands" article from the May 2024 edition of TASC's Traders' Tips, showcases the application of the UltimateSmoother by John Ehlers as a lag-reduced alternative to moving averages in indicators based on Keltner channels and Bollinger Bands®.


█ CONCEPTS

The UltimateSmoother, developed by John Ehlers, is a digital smoothing filter that provides minimal lag compared to many conventional smoothing filters, e.g., moving averages. Since this filter can provide a viable replacement for moving averages with reduced lag, it can potentially find broader applications in various technical indicators that utilize such averages.

This script explores its use as the smoothing filter in Keltner channels and Bollinger Bands® calculations, which traditionally rely on moving averages. By substituting averages with the UltimateSmoother function, the resulting channels or bands respond more quickly to fluctuations with substantially reduced lag.

Users can customize the script by selecting between the Ultimate channel or Ultimate bands and adjusting their parameters, including lookback lengths and band/channel width multipliers, to fine-tune the results.


█ CALCULATIONS

The calculations the Ultimate channels and Ultimate bands use closely resemble those of their conventional counterparts.

Ultimate channel:
  • Apply the Ultimate smoother to the `close` time series to establish the basis (center) value.
  • Calculate the smooth true range (STR) by applying the UltimateSmoother function with a user-specified length instead of a rolling moving average, thus replacing the conventional average true range (ATR). Users can adjust the final STR value using the "Width multiplier" input in the script's settings.
  • Calculate the upper channel value by adding the multiplied STR to the basis calculated in the first step, and calculate the lower channel value by subtracting the multiplied STR from the basis.

Ultimate bands:
  • Apply the Ultimate smoother to the `close` time series to establish the basis (center) value.
  • Calculate the width of the bands by finding the square root of the average of individual squared deviations over the specified length, then multiplying the result by the "Width multiplier" input value.
  • Calculate the upper band by adding the resulting width to the basis from the first step, and calculate the lower band by subtracting the width from the basis.

Tools and ideas for all Pine coders: www.tradingview.com/u/PineCoders/
Pine news broadcasts: t.me/PineCodersSquawkBox or twitter.com/PineCoders
TASC: traders.com/
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?