Entropy-Based Adaptive SuperTrend
Nov 1, 2024

The Entropy-Based Adaptive SuperTrend indicator is a trend-following tool that dynamically adjusts its sensitivity based on market entropy to provide more stable signals during volatile periods and responsive signals during orderly price movements. By calculating the degree of randomness in price action, the script automatically scales its ATR multiplier to filter out noise in chaotic conditions while tightening its trail in trending environments.
Usage
The indicator can be used to identify trend direction and potential entry points through visual cues on the price chart.
- Trend Identification: When the price is above the SuperTrend line and the line is colored with a bullish hue, the market bias is considered upward. Conversely, when the price is below the line with a bearish hue, the bias is downward.
- Signals: If enabled, "L" (Long) and "S" (Short) labels appear at trend transitions, marking potential entry opportunities.
- Dynamic Adaptation: Users will notice the gap between price and the SuperTrend line widening during high-entropy (chaotic) periods to avoid whipsaws, and narrowing during low-entropy periods to capture micro-trends efficiently.
Details
This script enhances the traditional SuperTrend logic by integrating a Shannon-inspired entropy calculation. It bins price data over a specified look-back period to measure the distribution and unpredictability of price movements.
- Entropy Score: The raw entropy is smoothed and compared against a dynamic threshold (based on a percentile of historical entropy) to determine the "Entropy Score."
- Adaptive Multiplier: This score modulates the ATR multiplier between a user-defined base and maximum value. High entropy leads to a higher multiplier (wider stops), while low entropy reduces the multiplier toward the base value (tighter stops).
Settings
Entropy Settings
- Price Source: Determines the price data used for entropy calculations (default is Close).
- Entropy Period: The look-back window used to calculate market randomness.
- Smoothing: The EMA length applied to the entropy value to reduce noise.
- Number of Bins: Defines the granularity of the price distribution used for entropy calculation.
Adaptive Settings
- Adaptation Period: The window used to calculate the threshold percentile for entropy comparison.
- Threshold Percentile: Sets the level at which entropy is considered "high" relative to its recent history.
- Filter Weight: Controls how aggressively the entropy score influences the multiplier adjustment.
SuperTrend Settings
- ATR Period: The look-back window for the Average True Range calculation.
- ATR Base Multiplier: The minimum multiplier used when the market is orderly.
- ATR Max Multiplier: The maximum multiplier reached when market entropy is high.
Visual Settings
- Bullish/Bearish Color: Customizes the colors for the trend lines and fills.
- Show Signals: Toggles the visibility of the "L" and "S" entry labels.
FAQ
How do I access Entropy-Based Adaptive SuperTrend?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the advantage of an adaptive multiplier over a fixed one?
A fixed multiplier often fails by being too tight during high-volatility "noise" (causing false signals) or too wide during clear trends (giving back profits). The adaptive approach optimizes the distance based on the actual quality of the price movement.
Can I use this for intraday trading?
Yes, the indicator is designed to be timeframe-agnostic. For intraday use, you may want to lower the ATR Base Multiplier or adjust the Entropy Period to respond more quickly to short-term volatility shifts.
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.