Magister Mentis
How It Truly Works
There’s a elementary distinction between constructing a buying and selling robotic and constructing a choice engine.
Most Knowledgeable Advisors are procedural. They await a situation — an indicator cross, a threshold breach, a sample completion — they usually execute a predefined response. They’re deterministic. They react to guidelines.
Magister Mentis was not designed as a rule executor. It was designed as a probabilistic inference system.
As a substitute of asking, “Did RSI cross 30?”, it asks:
Given the present multidimensional state of the market, what’s the likelihood distribution of future directional bias?
All the pieces that follows stems from that single query.
The Market as a Classification Drawback
At its core, Magister Mentis treats every closed candle as a function vector. The mannequin doesn’t try to forecast value magnitude. It performs classification.
For every resolution cycle, it outputs three values:
The impartial class shouldn’t be ornamental. It’s important. It acts as a structural uncertainty absorber. Markets usually are not binary techniques, and forcing them into up/down logic typically results in overtrading in ambiguous zones.
The system trades solely when one directional class meaningfully dominates the distribution.
The 17-Dimensional Function Area
Each inference begins with a 17-feature vector derived from the final closed candle.
These options usually are not uncooked values. Virtually all are volatility-normalized to cut back regime bias. This was a deliberate design resolution throughout mannequin coaching to mitigate overfitting to particular volatility environments.
The function teams embody:
-
Candle construction asymmetry (wick imbalance)
-
EMA directional relationship (50 vs 200), normalized by ATR
-
EMA displacement from value
-
RSI
-
ADX
-
ATR
-
Greenback index delta (actual image if obtainable, inverse proxy in any other case)
-
Quantity delta normalized
-
Structural stability rating derived from Singular Worth Decomposition
-
Brief-term normalized returns (1, 3, 6 bars)
-
Normalized candle vary
-
Cyclical encodings of hour and weekday utilizing sine/cosine transforms
The SVD-based stability metric deserves particular point out. Somewhat than relying solely on momentum or oscillation, the system analyzes current candle construction coherence. A secure singular worth distribution signifies structural consistency; instability signifies regime fragmentation.
This function engineering layer is the place most robustness is created. The mannequin is simply nearly as good because the area it observes.
Regime Detection: The Macro Filter
Earlier than the system decides route, it decides context.
A secondary mannequin evaluates whether or not the present market is trending or ranging. It outputs a likelihood:
P(pattern)
This isn’t used instantly as a buying and selling sign. As a substitute, it determines routing.
To stop flip-flopping between regimes on marginal likelihood shifts, hysteresis thresholds are utilized:
This ensures structural stability in mannequin choice.
Specialist Routing
As soon as regime is decided, inference could also be routed to a specialist:
Every mannequin has its personal calibration fixed. This structure permits specialization with out fragmenting execution logic.
AUTO mode routes dynamically. Guide override is feasible.
Likelihood Calibration
Uncooked mannequin outputs are not often well-calibrated. Machine studying classifiers are usually overconfident.
Magister Mentis applies temperature scaling:
Every mind can use a distinct temperature fixed decided throughout validation.
This improves threshold reliability and prevents systematic bias from overconfident outputs.
This calibration step is likely one of the causes the EA behaves extra constantly throughout datasets.
Entry Logic: Dominance and Thresholds
A commerce shouldn’t be triggered just because a likelihood is excessive.
Two circumstances have to be glad:
-
The directional likelihood should exceed its confidence threshold.
-
It should dominate competing lessons by no less than a configurable margin.
Formally:
Purchase requires:
Promote requires the symmetric situation.
This eliminates ambiguous distributions corresponding to:
P(Up)=0.62, P(Down)=0.59, P(Impartial)=0.05
Which could look robust however are structurally unstable.
Moreover, just one motion is permitted per candle. This prevents intra-bar churn and overreaction.
Threat as a Operate of Confidence
Place sizing can function in two modes:
In risk-based mode, lot measurement is derived from:
The scaler will increase place measurement reasonably if likelihood exceeds the brink considerably. It’s bounded and capped by:
-
Dealer quantity limits
-
Free margin constraints
-
A tough most lot cap
There isn’t a martingale logic. There isn’t a geometric publicity improve. Loss doesn’t set off measurement growth.
Adaptive Cease Logic
Stops and targets could also be ATR-based:
SL = ATR × multiplier
TP = ATR × multiplier
This ensures volatility-adjusted danger management, notably necessary for devices corresponding to XAUUSD the place static stops turn out to be structurally inconsistent throughout regimes.
Commerce Administration Layer
Impartial of entry logic, the system can apply:
These mechanisms function after commerce entry and are decoupled from Sensible Exit (RSI exhaustion).
Institutional Shields
Two arduous safety techniques exist:
If both is breached:
-
All positions are closed
-
The EA locks till reset
Gentle filters embody:
-
Unfold filter
-
Latency filter
-
Buying and selling hour window
-
Non-obligatory Friday shut
These filters stop structurally poor execution environments from degrading long-term efficiency.
Coaching and Overfitting Management
The mannequin pipeline consists of:
-
Multi-year information
-
Separate coaching, validation, and holdout check units
-
Optuna-based hyperparameter optimization
-
Likelihood calibration on validation
-
Function normalization
-
Regime specialization
The target was not most backtest revenue. The target was secure likelihood conduct throughout unseen information.
Overfitting was addressed by way of:
No grid logic was launched to artificially clean fairness curves.
Execution Mannequin
All inference is executed regionally inside MT5 through ONNX runtime.
There may be:
The EA operates autonomously as soon as connected.
Beta Tester Program
Magister Mentis is at the moment in staged analysis.
For the primary two analysis phases, a structured beta testing window might be obtainable.
On roughly the twenty sixth day of every month, one designated “Beta Testing Day” might be introduced.
For that day solely:
-
The value might be decreased by 50%.
-
Entry is granted in alternate for structured suggestions.
-
Beta individuals are anticipated to:
-
Ahead check responsibly.
-
Present written suggestions.
-
Go away an sincere evaluation reflecting actual expertise.
-
Participation is restricted and manually dealt with.
merchants might ship a personal message on that day to use for the beta window.
This method permits real-world suggestions with out compromising long-term product positioning.
Magister Mentis shouldn’t be designed to commerce continuously.
It’s designed to judge, filter, and act solely when likelihood alignment and structural affirmation intersect.
It waits.
Then it executes.

