Hyperbolic Tangent SuperTrend
Sep 22, 2024

The Hyperbolic Tangent SuperTrend indicator is a trend-following tool that utilizes a non-linear smoothing technique to identify market direction while minimizing the impact of short-term volatility.
Usage
The Hyperbolic Tangent SuperTrend can be used to identify trend reversals and establish market bias. When the price is above the SuperTrend line and the line is green, an uptrend is indicated; conversely, when the price is below the red line, a downtrend is indicated.
The indicator features two primary display modes:
- Overlay: Plots the SuperTrend and optional Hyperbolic Tangent Moving Average (HTMA) directly on the price chart for real-time trend analysis.
- Backtest Mode: Displays an equity curve in a separate pane to evaluate how the indicator would have performed historically compared to a simple Buy and Hold strategy.
Details
The core of this tool is the Hyperbolic Tangent Moving Average (HTMA). Unlike standard moving averages, the HTMA uses the hyperbolic tangent function (tanh) to "squash" price deviations relative to a Simple Moving Average (SMA). This non-linear transformation reduces the influence of extreme price outliers while maintaining a smooth response to persistent trends.
The SuperTrend calculation itself is derived from the Average True Range (ATR). By applying the ATR-based bands to the smoothed HTMA output rather than raw price, the indicator aims to filter out "noise" and provide more stable trend signals. Note that due to the mathematical properties of the tanh function, this indicator is optimized for assets with lower price ratios; extreme values (e.g., assets priced over 1,000,000) may lead to calculation inaccuracies.
Settings
General Settings
- Display Mode: Choose between "Overlay" for chart analysis or "Backtest Mode" for performance tracking.
- Allow Intra-day Updating: When enabled, signals update within the bar. If disabled, signals only confirm on bar close.
- Plot Calculation Source: Toggles the visibility of the specific price source used for the SuperTrend logic.
- Color Bars: Colors the price bars based on the current trend direction.
Hyperbolic Tangent Moving Average Settings
- HTMA Length: The lookback period for the internal smoothing calculation.
- Source: The price input used (e.g., Close, HL2, OCC3).
- Hyperbolic Tangent Multiplier: Adjusts the sensitivity of the tanh "squashing" effect.
- Plot HTMA: Toggles the visibility of the underlying smoothed moving average.
ATR Settings
- ATR Length: The lookback period for calculating market volatility.
- ATR Multiplier: Determines how far the SuperTrend bands are placed from the HTMA.
Backtest Mode
- Allowed Signals: Filters the backtest to show "Long & Short", "Long Only", or "Short Only" results.
- Backtest Start Date: Sets the historical point where the equity calculation begins.
- Plot Buy & Hold equity: Displays a benchmark line to compare strategy performance against holding the asset.
FAQ
How do I use the Backtest Mode effectively?
To use Backtest Mode, change the "Display Mode" setting to "Backtest Mode" and move the indicator to a new pane. This allows you to see the strategy equity and trade metrics tables clearly without cluttering the price action.
Why does the indicator look different on very high-priced assets?
The hyperbolic tangent function used for smoothing can reach mathematical limits on assets with very high nominal prices (e.g., above 100,000). It is best suited for assets with lower price denominations or ratios.
How can I access this indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.