Gold ML Supertrend MT5
- インディケータ
-
Tsukasa Okazaki
Japanese algorithmic trader specializing in XAUUSD (Gold).
Developing automated trading systems based on price action and structural breakout strategies. Every EA I sell runs on my own live account.
No martingale. No grid. No shortcuts. - バージョン: 1.0
- アクティベーション: 5
Built specifically for Gold (XAUUSD) traders.
Gold ML Supertrend MT5 is the only Supertrend indicator on MQL5 that learns. Instead of using a fixed multiplier, it runs a K-means clustering algorithm on recent price data to find the optimal band width. Then it adapts that width per trading session (Asia/London/NY) based on what actually worked.
The result: a Supertrend that is tighter during calm markets and wider during volatile ones, automatically.
--- WHY A FIXED SUPERTREND FAILS ON GOLD ---
Gold moves differently in each session:
- Asia: low volatility, narrow ranges, frequent whipsaws
- London: institutional volume enters, real trends begin
- NY: high volatility, strong continuation or reversal
A standard Supertrend with multiplier 3.0 produces constant whipsaws during Asia and misses trends during NY. You either get too many false signals or react too late to real ones.
This indicator solves that problem. The multiplier adapts to what the market is actually doing.
--- HOW THE AI WORKS ---
[+] K-Means Clustering (Unsupervised Machine Learning) The indicator collects ATR values over a training window (default 200 bars). It groups these values into 3 clusters using the K-means algorithm. Each cluster represents a different volatility regime. The indicator then backtests which cluster's multiplier produced the most accurate trend signals, and adopts the winner.
K-means is a real machine learning algorithm used in data science, not a marketing label.
[+] Session Learning Engine After K-means selects the base multiplier, the session engine fine-tunes it independently for Asia, London, and NY. Each session tracks its own win rate. When a session produces correct signals, the multiplier tightens slightly. When it produces wrong signals, the multiplier widens. Over time, each session converges on its own optimal setting.
[+] Continuous Adaptation K-means re-runs every 50 bars. Session learning updates every bar. The indicator never stops learning.
--- WHAT YOU GET ---
[+] BUY/SELL Arrows Clear entry signals when the adaptive Supertrend flips direction. Green arrow = trend turns bullish. Red arrow = trend turns bearish.
[+] Adaptive Multiplier The panel shows the current multiplier for each session in real time. Watch how Asia, London, and NY develop different optimal values.
[+] Session Win Rates Live tracking of signal accuracy per session. See which session produces the best Supertrend signals on your timeframe.
[+] Session Filter Control which sessions generate signals. Gold scalpers may want all three. Swing traders may prefer London + NY only.
[+] DXY Dashboard The panel shows whether the US Dollar is strengthening or weakening. DXY falling = macro bullish for Gold. Informational -- does not block signals.
[+] Psych Level Tracking Counts how many signals occurred near $50/$100 round numbers. These institutional order levels often produce stronger reversals.
[+] Full Alerts Push notification, email, and sound. Alert message includes direction, price, current multiplier, session, and psych status.
--- RECOMMENDED SETTINGS ---
Best timeframe: H1 (default settings optimized for Gold H1)
Default: ATR 10, Multiplier 3.0, K-Means ON, Session Learning ON Conservative: ATR 14, Multiplier 4.0, K-Means ON Aggressive: ATR 7, Multiplier 2.0, K-Means ON
K-Means Training Window: 200 bars (default). Increase to 500 for smoother adaptation. Learning Rate: 0.15 (default). Lower = slower adaptation, more stable.
--- WHAT THE PANEL SHOWS ---
- Current trend direction (BULLISH / BEARISH)
- Active session (Asia / London / NY)
- Current adapted multiplier
- Per-session multipliers (A / L / N)
- Per-session win rates
- Total signals count
- Psych confluence count
- DXY status
--- COMMON QUESTIONS ---
Q: Does this repaint? A: No. Trend flips use confirmed bar data only. Once a signal appears, it stays.
Q: How is this different from a normal Supertrend? A: A normal Supertrend uses a fixed multiplier (e.g. 3.0) for all conditions. This one runs K-means clustering to find the optimal multiplier, then fine-tunes it per session. The result is fewer whipsaws and better trend capture.
Q: What is K-means? A: K-means is an unsupervised machine learning algorithm that groups data points into clusters. Here, it groups ATR values into volatility regimes and identifies which regime produces the best Supertrend performance.
Q: Can my EA read the signals? A: Yes. BUY and SELL buffers are available via iCustom().
Q: Works on other pairs? A: The Supertrend engine works on anything. Session learning and $50/$100 psych levels are Gold-optimized.
--- DXY SYMBOL NOTE ---
DXY symbol name varies by broker. Default is "DXY". Common alternatives: USDX, DXY.a, USDollarIndex. Update in settings if needed, or disable DXY.
--- VERSION ---
v1.00 - Initial release
- K-means clustering for ATR multiplier optimization
- Session learning engine (Asia/London/NY independent adaptation)
- BUY/SELL arrow signals
- Session filter
- DXY dashboard (informational)
- Psych level tracking
- Full alert system (push/email/sound)
- Non-repainting
