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, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?