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/
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?