Inside a Self-Learning MT5 EA's 8-Factor SMC Confidence Score (and a Learning Engine Bug)

Inside a Self-Learning MT5 EA's 8-Factor SMC Confidence Score (and a Learning Engine Bug)

Most MT5 Expert Advisors make a binary decision: the conditions are met, so it trades. There is no in-between. A modular self-learning EA built around Smart Money Concepts (SMC) takes a different approach — every potential trade is scored on a 0-100 confidence scale across eight separate categories, and the trade only fires once that combined score clears a configurable threshold. This article breaks down how that scoring system works, and a real distortion bug that came up when a fast-exit feature was added later.

The Eight-Factor Confidence Score

Instead of a single indicator trigger, every potential entry is evaluated across eight weighted categories before a trade is allowed:

  • Trend (weight 18) — higher-timeframe directional bias
  • Structure (weight 18) — swing highs/lows, Break of Structure (BOS), Change of Character (CHoCH), liquidity sweeps, equal highs/lows
  • Momentum (weight 13) — EMA/RSI/MACD/ADX confirmation across timeframes
  • SMC (weight 18) — order blocks, breaker/mitigation blocks, fair value gaps, premium/discount zone positioning
  • Volatility (weight 8) — ATR-based filtering
  • Statistics (weight 13) — rolling win rate, profit factor, and expectancy fed back from the EA's own trade history
  • Session (weight 6) — Asian/London/New York session detection
  • News (weight 6) — high-impact economic calendar filtering

All eight weights, and the minimum score required to trade (70 by default), are configurable inputs rather than hard-coded values — so the balance between, say, SMC confirmation and raw momentum can be tuned without touching the underlying logic.

A Four-Timeframe Stack, Not a Single Chart

The analysis runs across four separate timeframes simultaneously: a higher-timeframe trend read (H4), a lower-timeframe trend read (H1), a confirmation timeframe (M15), and the actual execution timeframe (M5). Structure and SMC analysis (order blocks, BOS/CHoCH, fair value gaps) are checked against this full stack, not just the entry chart — the idea being that a M5 setup that contradicts the H4 trend context should score lower even if the M5 pattern itself looks clean.

Why the Learning Engine Is Rules-Based, Not a Black Box

The self-learning component doesn't use a machine-learning model in the opaque sense. Instead, it's an auditable, rules-based adjustment layer: a statistics engine tracks rolling win rate, profit factor, expectancy, streaks, and best/worst performing sessions and symbols from a CSV trade log, and those numbers feed back into the Statistics category of the confidence score. Every adjustment the EA makes to its own future decisions can be traced back to a specific, readable statistic — there's no hidden weight matrix to reverse-engineer if something looks off.

A Real Bug: Quick-Exit Trades Poisoning the Learning Feedback Loop

A later feature added a "quick profit close" option — any open trade closes immediately once floating profit lands within a small fixed dollar range, overriding the normal R-multiple take-profit and partial-close logic entirely. This is useful for scalping tiny, fast profits, but it created a side effect nobody had accounted for at first: those quick-exit trades were still being written into the same CSV log that feeds the Statistics Engine and the Learning Engine's score adjustments.

The problem is that a trade closed after a few seconds for a $2 profit doesn't reflect the same thing as a trade that played out to a real 1R, 2R, or 3R target. Mixing the two distorts the rolling win rate and expectancy numbers the Learning Engine relies on — a strategy could look artificially more (or less) successful than it actually is, purely because of how many quick-exit trades happened to fire in a given window.

The fix: any trade closed via the quick-profit exit reason is now excluded from every Learning Engine and Statistics Engine calculation — win rate, profit factor, expectancy, streak tracking, and session/symbol pattern-matching all skip those rows. The trades still get written to the raw CSV log for the trader's own manual review, but they no longer feed back into the score-adjustment loop that influences future trade decisions.

Key Takeaway for Anyone Building a Similar Self-Learning System

Any time an EA (or any automated system) feeds its own historical outcomes back into future decisions, every new exit path added later needs to be checked against that feedback loop — not just against the trade logic itself. A feature that works perfectly in isolation can quietly corrupt a learning system's statistics if it isn't explicitly excluded or categorized correctly in the data the learning layer consumes.

Post a Comment

0 Comments