Hello everyone,
I decided to start this topic as I’ve been experimenting with native machine learning (ML) logic within a few custom indicators, and I figured it might be valuable for others as well.
While learning MQL4 coding, I ran into several limitations—especially when it came to building smarter, more dynamic tools. That led me to switch to MQL5, which offers far more flexibility, especially for handling ML-style logic natively within the indicator itself.
Some of you may have seen my earlier attempt to create a more “intelligent” version of the SuperTrend indicator in MQ4. Although it worked to some extent, it hit a ceiling quickly. So, I fully converted it to MQ5 and started adding useful enhancements.
Rather than using traditional ML systems like MALE5 (which typically require offline training and external models), I wanted to explore lightweight, native, and live ML approaches—ones that adapt in real-time without complex training pipelines.
So I took SuperTrend again as a base and started layering in:
• Live ML scoring based on price behavior
• Adaptive logic using recent candle structures and volatility
• Noise filtering and pattern-snap logic to reduce fakeouts
My goal is to evolve a version that feels “smart out of the box,” without sacrificing performance or stability.
So here’s my first attempt, based on a SuperTrend by none other than mladen:
SuperTrend ML Adaptive – Smart Trend Detection with live Market Learning
SuperTrend ML Adaptive is a custom indicator that enhances the classic SuperTrend (CCI-based) logic with live, native machine learning-inspired intelligence – all running directly inside MT5, with zero external models or training.
⸻
ML-Inspired Candle Scoring
Each candle is scored in real-time using body size, wick ratio, volatility (ATR), and CCI strength. The result: a dynamic MLScore per candle, reflecting how “strong” or “significant” a move really is.
Adaptive ATR Sensitivity
Instead of using a fixed ATR value, the indicator adapts its volatility buffer using recent candle behavior. This means:
• Strong trends trigger faster trend switches
• Weak/noisy moves are filtered out
• The SuperTrend line becomes more intelligent and stable
Noise & Pattern Filtering
With optional filters:
• Suppresses trend flips caused by minor candle noise
• Snaps breakout logic to only allow trend changes when candles show clear strength[/color]
⸻
Inputs Overview
• Enable or disable adaptive logic
• Candles to study (default = 5 to study and give the last nr of candles extra weight for current decision)
• Filter micro movements (noise filter)
• Detect breakout pattern (a check to determine if a breakout could be false or not)[/color]
⸻
No Repainting, No Recalculation, No Hype. All calculations are native, live, and stable. There’s no repainting, no machine learning training phase, and no external dependencies. It’s smart by design – not by buzzwords. Please test this version with caution. If you notice some flaws or errors, please let me know. Enjoy!
PS in the picture you see 2 instances of the indicator. One with all smart things turned on (candles) and one with the standard SuperTrend settings as is (lines).