Hyperbolic Tangent Volatility Stop
Sep 22, 2024

The Hyperbolic Tangent Volatility Stop indicator provides a sophisticated trend-following framework by merging the smoothing properties of a non-linear moving average with a dynamic, volatility-adjusted stop mechanism. It aims to filter market noise and identify significant trend reversals while adapting to changing market conditions.
Usage
The tool is primarily used to identify trend direction and potential exit or entry points. It operates in two main modes:
- Overlay Mode: Displays the Hyperbolic Tangent Moving Average (HTMA) and the Volatility Stop directly on the price chart. When the stop is below the price, it indicates an uptrend (Green); when above, it indicates a downtrend (Red).
- Backtest Mode: Transitions the indicator to a separate pane to display an equity curve. This allows users to compare the performance of the indicator's signals against a standard buy-and-hold strategy based on historical data.
Traders can use the HTMA as a baseline for trend strength and the Volatility Stop circles as dynamic trailing stop-loss levels.
Details
The script is constructed using two core mathematical components:
- Hyperbolic Tangent Moving Average (HTMA): This uses the
tanhfunction to "squash" price deviations from a simple moving average. By applying this non-linear transformation, the average becomes less sensitive to extreme price spikes, resulting in a smoother trend line that focuses on persistent directional movement. Note that accuracy may decrease for assets priced significantly above 100,000 due to the nature of the hyperbolic tangent function. - Volatility Stop: Built using the Average True Range (ATR), this mechanism follows the HTMA. In an uptrend, the stop is calculated by subtracting a multiple of the ATR from the highest price reached. As volatility increases, the stop widens to prevent premature exits; as volatility decreases, the stop tightens to protect gains.
Settings
General Settings
- Display Mode: Switches between "Overlay" (chart view) and "Backtest Mode" (performance view).
- Allow Intra-day Updating: Enables real-time signal updates within the current bar. Disabling this waits for the bar to close to confirm signals.
- Plot Calculation Source: Toggles the visibility of the specific price source used for calculations.
- Color Bars?: When enabled, colors the price bars based on the current trend direction.
HTMA Settings
- HTMA Length: The lookback period for the Hyperbolic Tangent Moving Average.
- Source: The price input used (e.g., Close, HL2, OCC3).
- Hyperbolic Tangent Multiplier: Controls the intensity of the non-linear "squashing" effect.
- Plot HTMA?: Toggles the visibility of the HTMA line.
ATR Settings
- ATR Length: The period used to calculate market volatility.
- ATR Multiplier: Determines the distance between the stop level and the price.
Backtest Mode
- Allowed Signals: Filters the backtest results to Long & Short, Long Only, or Short Only.
- Backtest Start Date: Sets the historical point where the performance calculation begins.
- Plot Buy & Hold equity?: Toggles the comparative benchmark line.
FAQ
How do I interpret the red and green circles?
Green circles indicate a bullish regime where the volatility stop is below the price, while red circles indicate a bearish regime where the stop is above the price.
Why does the indicator look different in Backtest Mode?
Backtest Mode changes the visual output to an equity curve, allowing you to see the hypothetical growth of a portfolio using the indicator's signals compared to simply holding the asset.
How can I access the Hyperbolic Tangent Volatility Stop?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

