OPEN-SOURCE SCRIPT

Exponential Trend [AlgoAlpha]

7 591
OVERVIEW

This script plots an adaptive exponential trend system that initiates from a dynamic anchor and accelerates based on time and direction. Unlike standard moving averages or trailing stops, the trend line here doesn't follow price directly—it expands exponentially from a pivot determined by a modified Supertrend logic. The result is a non-linear trend curve that starts at a specific price level and accelerates outward, allowing traders to visually assess trend strength, persistence, and early-stage reversal points through both base and volatility-adjusted extensions.

CONCEPTS

This indicator builds on the idea that trend-following tools often need dynamic, non-static expansion to reflect real market behavior. It uses a simplified Supertrend mechanism to define directional context and anchor levels, then applies an exponential growth function to simulate trend acceleration over time. The exponential growth is unidirectional and resets only when the direction flips, preserving trend memory. This method helps avoid whipsaws and adds time-weighted confirmation to trends. A volatility buffer—derived from ATR and modifiable by a width multiplier—adds a second layer to indicate zones of risk around the main trend path.

FEATURES

  1. Exponential Trend Logic: Once a directional anchor is set, the base trend line accelerates using an exponential formula tied to elapsed bars, making the trend stronger the longer it persists.
    snapshot
  2. Volatility-Adjusted Extension: A secondary band is plotted above or below the base trend line, widened by ATR to visualize volatility zones, act as soft stop regions or as a better entry point (Dynamic Support/Resistance).
    snapshot
  3. Color-Coded Visualization: Clear green/red base and extension lines with shaded fills indicate trend direction and confidence levels.
    snapshot
  4. Signal Markers & Alerts: Triangle markers indicate confirmed trend reversals. Built-in alerts notify users of bullish or bearish direction changes in real-time.


USAGE

Use this script to identify strong trends early, visually measure their momentum over time, and determine safe areas for entries or exits. Start by adjusting the *Exponential Rate* to control how quickly the trend expands—the higher the rate, the more aggressive the curve. The *Initial Distance* sets how far the anchor band is placed from price initially, helping filter out noise. Increase the *Width Multiplier* to widen the volatility zone for more conservative entries or exits. When the price crosses above or below the base line, a new trend is assumed and the exponential projection restarts from the new anchor. The base trend and its extension both shift over time, but only reset on a confirmed reversal. This makes the tool especially useful for momentum continuation setups or trailing stop logic in trending markets.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.