Supertrend AI
- Indicators
- Mathieu Adams
- Version: 1.0
- Activations: 5
Supertrend AI (Clustering) is a next-generation adaptive trend-following indicator built for precision trading across Forex, crypto, and indices. It uses multi-variant Supertrend calculations dynamically clustered via real-time performance feedback to identify the optimal factor in each market condition.
Features:
-
Clustering-based ATR multiplier selection
-
Non-repainting buy/sell signals
-
Bullish & bearish supertrend overlays
-
Fully buffered signals (for EA integration)
-
Clean visuals for easier decision-making
-
Optimized for intraday and swing trading
How It Works:
Each candle is evaluated across multiple Supertrend settings. These are scored by a performance-smoothing algorithm and dynamically clustered (using 3 unsupervised clusters). The best-performing cluster is selected and used to generate the trend lines and trading signals.
Inputs:
-
atrPeriod : ATR calculation period (default: 10)
-
minMult : Minimum ATR multiplier to test (default: 1.0)
-
maxMult : Maximum ATR multiplier to test (default: 5.0)
-
step : Resolution step between minMult and maxMult (e.g., 0.5 = test 1.0, 1.5, 2.0, ...)
-
perfAlpha : Smoothing factor for the performance scoring function (default: 10.0). Higher values make performance tracking more responsive to recent price action.
-
maxIter : (Reserved) Maximum iterations for clustering logic (not used in final version but reserved for future development).
-
fromCluster : Controls which cluster to select for signal generation:
-
0 = worst-performing group (for contrarian setups)
-
1 = average-performing group
-
2 = best-performing group (default and recommended for directional trend trading)
-
Developer Ready (EA Integration):
All signal logic is exposed via 4 buffers for seamless EA development:
-
Buffer[4] = Buy Signal (1 = valid buy)
-
Buffer[5] = Sell Signal (1 = valid sell)
-
Buffer[6] = Green Trend Line (value or 0)
-
Buffer[7] = Red Trend Line (value or 0)
Compatible with all symbols and timeframes.
Whether you're trading EURUSD on M5 or BTCUSD on H4, Supertrend AI adapts to market conditions with dynamic precision.