Maxfutures Supertrend Pro
- Indicateurs
- Khac Thanh Bui
- Version: 1.0
Maxfutures Supertrend
A SuperTrend indicator for MetaTrader 5 that uses K-Means volatility clustering to select adaptive ATR inputs, with a dual-logic signal confirmation system and a Bloomberg-style information panel.
Maxfutures Supertrend is a trend-following indicator for MetaTrader 5. It replaces the fixed ATR multiplier used in standard SuperTrend implementations with a dynamic value derived from K-Means clustering of recent ATR readings. The indicator is designed for traders who want a clearer view of trend direction and signal quality across varying market conditions.
Overview
The indicator continuously groups the last N ATR values into three volatility clusters — High, Medium, and Low — using an unsupervised K-Means algorithm. At each bar, the current ATR reading is classified into the nearest cluster, and the centroid of that cluster replaces the fixed multiplier in the SuperTrend formula. This means the SuperTrend bands automatically adapt to the current volatility regime rather than using a single constant across all market conditions.
On top of the adaptive SuperTrend, a dual-logic confirmation layer filters raw trend-flip signals before they are displayed. A confirmed Buy signal requires the SuperTrend direction to be bullish, a smoothed low above the prior tracked high-low range, and the current close above the prior bar's high. A confirmed Sell signal applies the mirror conditions on the bearish side. Traders can toggle this confirmation layer on or off depending on their preference for signal frequency versus signal quality.
The information panel on the chart displays the current signal state, the three cluster centroids with their ATR values, and a signal power indicator that reflects which volatility cluster is active at the time of the signal.
How to Read the Indicator
The SuperTrend line is drawn in two colors. A teal line below price indicates an uptrend; a red line above price indicates a downtrend. Gradient shading between the midpoint of each bar and the SuperTrend line provides a visual reference for the distance between price and the trend boundary.
Buy arrows appear below bars where a confirmed bullish signal occurs. Sell arrows appear above bars where a confirmed bearish signal occurs. Arrow size can be adjusted through the input parameters.
Numeric labels (1, 2, 3) near the SuperTrend line indicate which volatility cluster is active: 3 corresponds to High volatility, 2 to Medium, and 1 to Low. A signal generated during a High volatility cluster carries a different risk profile than one during a Low volatility cluster — this context is also reflected in the panel's signal power pips display. Label display and font size can be configured in the input parameters.
The panel shows the active cluster in the volatility table, the current signal (Buy Confirmed, Sell Confirmed, or Waiting), and three filled or empty pips representing signal power from 1 to 3.
Alerts can be configured to trigger on signal flips via desktop pop-up, push notification to mobile, or email.
Recommended Use
The indicator can be applied to any symbol and timeframe. Results observed during testing are most consistent on liquid instruments such as major forex pairs, gold (XAUUSD), and index futures. Higher timeframes (H1 and above) tend to produce fewer but more deliberate signals; lower timeframes generate more frequent signals and benefit more from enabling the dual-logic confirmation layer.
This indicator does not place trades. It is intended to support discretionary or semi-automated trading decisions. Traders are responsible for their own entry and exit execution, position sizing, and risk management.
Parameters
SuperTrend:
- ATR Length — Number of bars used to calculate ATR — Default: 10
- Factor — Multiplier applied to the cluster centroid for band width — Default: 3.0
- Arrow Width — Width of Buy and Sell arrow markers (1 to 5) — Default: 2
K-Means Clustering:
- Training Data Length — Number of recent ATR values used to build the three clusters — Default: 100
- High Volatility Percentile — Initial seed position for the High cluster (0 to 1) — Default: 0.75
- Medium Volatility Percentile — Initial seed position for the Medium cluster (0 to 1) — Default: 0.50
- Low Volatility Percentile — Initial seed position for the Low cluster (0 to 1) — Default: 0.25
Dual-Logic Confirmation:
- Enable Dual-Logic — Toggle the confirmation filter on or off — Default: true
- Amplitude — Lookback period for the smoothed high/low range used in confirmation — Default: 3
- MA Type — Smoothing method for confirmation: false uses SMA, true uses EMA — Default: false
Alerts:
- Pop-up Alert — Enable desktop alert on signal flip — Default: true
- Push Notification — Enable push notification to mobile — Default: true
- Email Notification — Enable email alert on signal flip — Default: false
Appearance:
- Fill Transparency (SuperTrend side) — Transparency of the gradient fill on the SuperTrend side (0–100) — Default: 70
- Fill Transparency (Body side) — Transparency of the gradient fill on the bar body side (0–100) — Default: 95
- Bullish Color — Color used for uptrend line, buy arrows, and bullish fill — Default: teal
- Bearish Color — Color used for downtrend line, sell arrows, and bearish fill — Default: red
- Show Power Numbers — Display cluster index labels (1, 2, 3) near the SuperTrend line — Default: true
- Power Numbers Font Size — Font size for cluster index labels — Default: 12
This indicator is a visual and analytical tool only. Past signal behavior observed in backtesting or on historical bars does not guarantee future results. All trading decisions, including risk management and position sizing, remain the sole responsibility of the trader.
