OPEN-SOURCE SCRIPT

Torus Trend Bands — Windowed Hamming

40
Torus Trend Bands — Windowed Hamming

This TradingView indicator creates dynamic support and resistance bands on your chart. It uses the mathematical model of a torus (a donut shape) to generate cyclical and responsive channel boundaries. The bands are further refined with an advanced smoothing method called a Hamming window to reduce noise and provide a clearer signal.

How It Works

  • The Torus Model: The indicator maps price action onto a geometric torus shape. This is defined by two key parameters:
  • Major Radius (a): The distance from the center of the torus to the center of the tube. This controls the overall size and primary cycle.
  • Minor Radius (b): The radius of the tube itself. This controls the secondary, faster "breathing" motion of the bands.
  • Dual-Phase Engine: The behavior of the bands is driven by two different cyclical inputs, or "phases":
  • Major Rotation (φ): A slow, time-based cycle (φ period) that governs the long-term oscillation of the bands.
  • Minor Rotation (q): A fast, momentum-based cycle derived from the Relative Strength Index (RSI). This makes the bands react quickly to price momentum, expanding and contracting as the market becomes overbought or oversold.
  • Standard Technical Core: The torus model is anchored to the price chart using standard indicators:
  • Midline: A central moving average that acts as the baseline for the channel. You can choose from EMA, SMA, HMA, or VWAP.
  • Width Source: A volatility measure that determines the fundamental width of the bands. You can choose between the Average True Range (ATR) or Standard Deviation.
  • Hamming Window Smoothing: This is a sophisticated weighted averaging technique (a Finite Impulse Response filter) used in digital signal processing. It provides exceptionally smooth results with less lag than traditional moving averages. You can apply this smoothing to the RSI, the midline, and the width source independently to filter out market noise.


How to Interpret and Use the Indicator
  • Dynamic Support & Resistance: The primary use is to identify potential reversal or continuation points. The upper band acts as dynamic resistance, and the lower band acts as dynamic support.
  • Trend Identification: The color of the bands helps you quickly see the current trend. Teal bands indicate an uptrend (the midline is rising), while red bands indicate a downtrend (the midline is falling).
  • Volatility Gauge: When the bands widen, it signals an increase in market volatility. When they contract, it suggests volatility is decreasing.
  • Alerts: The indicator includes built-in alerts that can notify you when the price touches or breaks through the upper or lower bands, helping you stay on top of key price action.


Key Settings


  • Torus Parameters: Adjust Major radius a and Minor radius b to change the shape and cyclical behavior of the bands.
  • Phase Controls:
  • φ period: Controls the length of the main, slow cycle in bars.
  • RSI length → q: Sets the lookback for the RSI that drives the momentum-based cycle.
  • Midline & Width: Choose the type and length for the central moving average and the volatility source (ATR/StDev) that best fits your trading style.


Width & Bias Shaping:

*Min/Max width ×: Control how much the bands expand and contract.
*Bias ×: Shifts the entire channel up or down based on RSI momentum, helping the bands better capture strong trends.
*Hamming Controls: Enable or disable the advanced smoothing on different parts of the indicator and set the Hamming length (a longer length results in more smoothing).


This indicator provides a unique and highly customizable way to visualize market cycles, volatility, and trend, combining geometry with proven technical analysis tools.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.