XAUUSD RegimeShift Startegy

MQL5 Experten

Spezifikation

Yes. The final “world-class” RegimeShift concept we converged on is an adaptive hybrid EA, not a single trend EA and not a pure recovery EA.

The key idea is:

Classify the market first → select the correct engine → size dynamically → stop using that engine when its market thesis is invalid.

That is the part I would preserve as the final architecture.

RegimeShift — Final Strategy Architecture

Layer Final role
H1 Macro context / large directional pressure
M15 Primary regime classification
M5 Structure, breakout and pullback geometry
M1 Execution timing, shocks and microstructure
M3 Optional fast trend-danger monitor, especially for Range/recovery baskets
Tick data Spread, velocity, shock, execution quality

The EA maintains persistent states rather than switching on every candle:

RANGE → BREAKOUT_READY → TREND_UP / TREND_DOWN → TRANSITION → SHOCK/COOLDOWN.

TrendScore and RangeScore are independent scores, not opposites. Volatility, execution quality and shock risk are additional independent dimensions.

1. RANGE engine

Only operate when there is credible range structure and no accepted breakout.

The range engine uses small initial exposure and bounded same-direction recovery, but no longer follows a blind fixed martingale ladder.

After every fill it recalculates:

\[ Q_{next}=f( RangeQuality,\ Overshoot,\ ReversalEvidence,\ Volatility, TrendRisk,\ Spread,\ Margin,\ BasketStress) \]

Therefore the next layer can be:

increase / same size / smaller / skipped entirely.

The latest safety direction was:

Stage Behaviour
P1–P2 Normal
P3 Begin enhanced observation
P4 Final normal recovery layer / conditional rescue zone
P5 equivalent Risk-management state, not another automatic layer
P6+ No blind progression

This is one of the most important changes from original Latex.

The historical P14-style sequence:

0.01 → .02 → .03 → .05 → .08 → .13 → .22 → ...

must never remain an automatic progression.

2. P4/P5 risk router

When a range basket deteriorates, the EA doesn't simply keep averaging.

At P3 it starts measuring velocity, trend persistence and rebound quality.

At P4, it becomes eligible for a conditional rescue/controlled exit.

If the market continues to deteriorate toward what would previously have been P5/P6, the range thesis is considered damaged.

Then RegimeShift chooses among:

natural rebound exit, small-loss exit, one directional rescue, or hard bounded exit.

The rescue is not a recurring martingale. At most one rescue campaign is allowed.

For the OCO-rescue research, our better region was around:

  • rescue trigger roughly $0.30
  • desired rescue continuation roughly $0.75–$1.00
  • one rescue only
  • strict maximum rescue lot
  • close the entire campaign when liquidation P/L reaches the required BE/small-profit target.

A $0.25 recovery target was rejected because required rescue leverage became excessive.

3. BREAKOUT / TREND engine

Once an actual range breakout is accepted, the EA stops behaving like a mean-reversion system.

The final trend sequence was:

structure → breakout → sustained acceptance → pullback → reacceptance → entry.

Not:

price crosses level → immediately chase .

A trend campaign uses a structural stop and splits exposure into approximately:

Core + Anchor Runner.

The intended allocation is roughly:

\[ 65\% \ Core + 35\% \ Runner \]

subject to broker-valid lot increments.

Core takes the nearer structural/R target.

Anchor stays with the trend and is managed by structural/staged trailing.

Only after profits are secured can the EA pyramid.

4. Trend pyramiding

Pyramiding is profit-funded, never loss-funded.

Each additional layer must be supported by:

  • realized profit from earlier positions;
  • broker-protected open profit;
  • continued structural trend acceptance;
  • adequate remaining room;
  • acceptable execution/spread.

Maximum conceptually around four additional decreasing-risk layers, but the EA may add fewer or none.

The crucial rule:

No averaging down inside the Trend engine.

If the trend thesis fails, reduce or exit.

Do not turn a failed trend trade into a recovery basket.

5. Engine switching

This is what makes RegimeShift different from combining two unrelated EAs.

A campaign has one market thesis at a time.

For example:

RANGE → accepted upside breakout

does not mean:

keep SELL recovery + start BUY trend positions .

Instead:

freeze new range risk → evaluate/flatten damaged range exposure → require transition confirmation → then allow fresh TREND_UP campaign.

Likewise:

TREND → range

means harvest/exit the trend campaign before a new range campaign begins.

No uncontrolled strategy overlap.

6. TRANSITION and SHOCK

These are genuine NO-NEW-RISK states.

In TRANSITION:

  • no fresh range basket;
  • no fresh trend campaign;
  • pending orders may be cancelled/recentered;
  • existing exposure is managed defensively.

In SHOCK:

  • cancel unfilled pending risk;
  • freeze recovery additions;
  • do not pyramid;
  • concentrate on existing-risk reduction.

Actual XAU movement velocity is important here, not just indicators.

Our forensic work showed that very fast adverse moves are disproportionately associated with deep baskets. So RegimeShift should continuously measure:

\[ \Delta P_{3s},\Delta P_{10s},\Delta P_{30s},\Delta P_{60s} \]

along with ATR-normalized versions.

7. Scheduled-news protection

News is a separate risk dimension, not part of TrendScore.

The architecture supports two set-file profiles.

Conservative: curated major USD events can block the whole trading day.

Typical Tier-A events:

NFP/main jobs report, CPI/Core CPI, FOMC rate decision, FOMC Minutes, PCE/Core PCE, GDP and major Fed Chair events.

Medium: use configurable pre/post blackout windows instead.

The original trend build used approximately 60/45 minutes for Tier-1 and 30/25 for other high-impact events, while the later Latex research showed why whole-day blocking may be preferable for the conservative profile.

Existing exposure before news is handled independently: small exposure can be flattened, pending orders cancelled, and damaged baskets prevented from adding new risk.

8. Sessions

The EA must not interpret every hour as equivalent.

The original trend research used approximately:

07:00–12:00
12:30–17:00

with first-session minutes blocked and rollover around:

23:45–00:45

excluded.

But these remain set-file parameters, not buried logic.

Session profile, news profile and risk profile should be selectable without changing strategy code.

9. Risk model

The final Trend architecture used approximately:

\[ 0.25\% \text{ planned event risk} \]

with a source hard ceiling around:

\[ 0.50\% \]

For the hybrid version, risk should be campaign-based rather than “risk per order”.

Before any new exposure:

\[ ProjectedWorstLoss = CurrentLiquidationLoss+ NewPositionRisk+ SlippageBuffer+ Commission+ GapStress \]

and:

\[ ProjectedMarginLevel > MinimumSafeMargin \]

must both pass.

The EA also needs independent:

basket hard loss, campaign hard loss, daily soft loss, daily hard loss, weekly hard loss, max time underwater, margin floor, spread guard, execution-fault guard and shock guard.

A hard daily loss means:

flatten managed exposure when required → delete pending risk → lock trading until next configured risk-day reset.

A soft loss means:

stop initiating new campaigns → manage the current one → restart only after defined stabilization criteria.

10. Restart after soft protection

This should not simply use:

wait 30 minutes → start again .

Restart should require time + market evidence.

For example:

\[ Restart = CooldownComplete \land SpreadNormal \land ShockCleared \land RegimeStable \land NoExecutionFault \]

and for Range specifically:

\[ RangeScore > Threshold \land TrendRisk < Threshold \land StructureStable \]

for several completed observations.

Likewise a Trend engine restart requires a fresh structural event, not reuse of the failed setup.

11. Profit protection

Campaign profit protection is monotonic.

Once a campaign earns and secures profit:

future risk cannot be allowed to convert a meaningfully secured campaign into an uncontrolled loss.

Trend pyramids are funded from secured profit.

Range rescue cannot exceed a predefined campaign-risk allowance.

Newest/additional positions are generally reduced first; strategic anchor exposure survives longest when the structure remains valid.

12. Reversal

No instant “BUY → SELL → BUY” flipping.

A reversal sequence is:

invalidate old thesis → close old campaign → verify flat/reconciled state → fresh opposite confirmation → new campaign ID.

This is especially important for rescue logic. We rejected repeated OCO/rescue flipping because it can turn into a high-volume whipsaw machine.


The final state machine

Conceptually, this is the clean version:

FLAT │ REGIME CLASSIFIER │ ┌────────────────┼─────────────────┐ │ │ │ RANGE BREAKOUT_READY TRANSITION/SHOCK │ │ │ Range Engine wait/confirm NO NEW RISK │ │ P1/P2 accepted breakout │ │ P3 ↓ Observe Pullback + Reaccept │ │ P4 TREND CAMPAIGN │ │ Risk Router Core + Anchor / | \ │ rebound rescue exit profit funded │ │ │ pyramids └──────┴─────┘ │ │ Harvest/Exit FLATTEN │ └──────────→ FLAT ←──┘

Machine learning / deep learning

We deliberately did not make ML the live decision-maker for version 1.

The production engine should remain explainable and deterministic.

ML can run in shadow mode, initially something like an HMM/regime model or calibrated classifier, taking features such as:

\[ TrendScores,\ RangeScores,\ ATR,\ ER,\ ADX,\ velocity, spread,\ session,\ news,\ depth,\ basket MAE,\ rebound \]

and predicting things such as:

\[ P(\text{trend continuation}) \]\[ P(\text{return to basket BE before next adverse level}) \]\[ P(\text{P8-style tail} \mid current state) \]

Only after strong walk-forward evidence would ML be permitted to alter live routing. Initially it merely logs:

RULE_DECISION versus ML_SHADOW_DECISION .

That protects us from building a sophisticated overfit model.


The two set files I would ultimately maintain

RegimeShift_CONSERVATIVE.set would use full-day Tier-A blocking, stricter Range acceptance, P4 as the last normal recovery layer, smaller campaign/daily risk, stronger stabilization requirements and no discretionary deeper recovery.

RegimeShift_MEDIUM.set would use narrower news windows, allow slightly broader Range participation, possibly permit one rigorously qualified rescue/extra recovery action, and use somewhat less restrictive regime thresholds.

The strategy code remains identical. Only the risk envelope changes.

So, in one sentence, the final RegimeShift philosophy is:

Exploit mean reversion only while the market demonstrably remains a range; switch to structural continuation only after a breakout proves itself; when neither thesis is reliable, do nothing; and never allow recovery sizing to substitute for an invalidated market thesis.

That is the architecture I would use as the master design for the world-class RegimeShift EA.


Bewerbungen

1
Entwickler 1
Bewertung
(286)
Projekte
358
29%
Schlichtung
37
27% / 65%
Frist nicht eingehalten
10
3%
Arbeitet
2
Entwickler 2
Bewertung
(400)
Projekte
518
24%
Schlichtung
61
57% / 25%
Frist nicht eingehalten
60
12%
Arbeitet
3
Entwickler 3
Bewertung
(436)
Projekte
645
53%
Schlichtung
35
63% / 20%
Frist nicht eingehalten
6
1%
Beschäftigt
4
Entwickler 4
Bewertung
(73)
Projekte
94
56%
Schlichtung
6
67% / 17%
Frist nicht eingehalten
2
2%
Beschäftigt
5
Entwickler 5
Bewertung
(182)
Projekte
196
46%
Schlichtung
4
50% / 25%
Frist nicht eingehalten
1
1%
Beschäftigt
6
Entwickler 6
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
7
Entwickler 7
Bewertung
(1)
Projekte
1
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Veröffentlicht: 2 Beispiele
8
Entwickler 8
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
9
Entwickler 9
Bewertung
(42)
Projekte
112
56%
Schlichtung
2
50% / 0%
Frist nicht eingehalten
3
3%
Frei
Veröffentlicht: 1 Beispiel
10
Entwickler 10
Bewertung
(623)
Projekte
727
34%
Schlichtung
47
49% / 40%
Frist nicht eingehalten
14
2%
Beschäftigt
11
Entwickler 11
Bewertung
(2676)
Projekte
3415
68%
Schlichtung
77
48% / 14%
Frist nicht eingehalten
343
10%
Arbeitet
Veröffentlicht: 1 Beispiel
12
Entwickler 12
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
13
Entwickler 13
Bewertung
(1)
Projekte
1
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Veröffentlicht: 4 Beispiele
14
Entwickler 14
Bewertung
(16)
Projekte
30
40%
Schlichtung
3
33% / 67%
Frist nicht eingehalten
7
23%
Arbeitet
15
Entwickler 15
Bewertung
(319)
Projekte
571
35%
Schlichtung
83
31% / 45%
Frist nicht eingehalten
206
36%
Arbeitet
16
Entwickler 16
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
17
Entwickler 17
Bewertung
(211)
Projekte
274
21%
Schlichtung
25
52% / 16%
Frist nicht eingehalten
0
Beschäftigt
18
Entwickler 18
Bewertung
(59)
Projekte
93
43%
Schlichtung
4
0% / 100%
Frist nicht eingehalten
4
4%
Arbeitet
19
Entwickler 19
Bewertung
(20)
Projekte
28
39%
Schlichtung
8
25% / 38%
Frist nicht eingehalten
2
7%
Beschäftigt
Veröffentlicht: 8 Artikel, 35 Beispiele
Ähnliche Aufträge
i have indicator for Trading View, also copy for NT, i need someone to improve and check the NT version (indicator is simple is volume density koncept)…. when i put same settings on TV version and NT version i have diffrerent results, but this can be because diffrent market data or fact that TV sending tick info in blocks , not tick by tick like NT8 on both. I(ndicator base on counting volume) so besied that is it
MT5 Expert — Custom Manual Fibonacci Automation & Cycle Synchronization Project Overview I am looking for an experienced MT5 / MQL5 Expert developer to build a fully customized Expert based on my own chart cycle/engine and manual Fibonacci workflow. This is not an auto-trading robot . The Expert is designed to assist my manual trading workflow by automating the repetitive chart and Fibonacci process while keeping the
Hi, I am looking for a profitable MT5 EA,If you are interested in this job, grateful if you could provide a brief description of the strategy and one week demo trial , Thank you
I need a developer who can write me a XML file for a dbot robot to trade any deriv option instruments and trading mode A market analyser is needed. Let it automatically scan the market and choose the instrument and with the best input parameters for a given trading mode and show the predicted win rate as shown in the videos below; https://vt.tiktok.com/ ZSb14aoAA/ https://vt.tiktok.com/ ZSb1bFBkA/
Bobolink 1 30+ USD
I need a trading robot that can automatically analyse the market, identify trading opportunities, manage trades, and use clear risk controls. The robot should be reliable, easy to monitor, and suitable for testing before real trading
I am looking for an experienced MQL5 developer to research, develop, and integrate a Smart Early Exit system into my existing XAUUSD EA. The EA is already fully functional. The objective of this job is not to redesign the strategy or modify the entry logic , but to improve how losing trades are managed. The Early Exit system should identify trades that are showing signs of genuine deterioration and close them before
VEE STRATEGY ROBOT 30 - 200 USD
//+------------------------------------------------------------------+ //| M5 Trend Pullback EA | //| Exness / MT5 | //| Forex + XAUUSD | //| Risk: 0.5% per trade | //+------------------------------------------------------------------+ #property strict #property version "1.00" #property description "M5 EMA50/EMA200 + RSI + ATR Trend Pullback EA" #include <Trade/Trade.mqh> CTrade trade;
Purpose Develop a transparent and conservative Expert Advisor for MetaTrader 5. Profit is not guaranteed; acceptance is based on correct implementation, risk controls and reproducible testing. 1. Platform and instruments - Native MQL5 Expert Advisor for MetaTrader 5. - Symbols: EURUSD and USDJPY. - Working timeframe: H1. Higher-timeframe trend filter: H4. - Must support standard broker symbol suffixes/prefixes and
Please may someone assist me with the indicator attached, it has a SERIOUS BUG issue in the sense that when I load it, and activate the template (attached as well) MT4 ALWAYS freezes and then eventually disconnects automatically, ALL THE TIME. It even gets worse to an extent that after disconnecting a number of times mt4 ends up not loading anymore, UNTIL I remove the indicator. Please I WILL NEED A DEMO (FOR A DAY)
I’m looking for an experienced NinjaTrader 8 developer to build an automated strategy using the Imbalance Profile Lidar indicator by ninZa.co on MNQ DEC26 with a 3000-volume chart . Requirements: Enter Long when a blue absorption dot appears below price with an absorption value. Enter Short when a pink absorption dot appears above price with an absorption value. Stop loss: 15 ticks behind the signal dot price . Take

Projektdetails

Budget
50 - 100 USD

Kunde

Veröffentlichte Aufträge1
Anzahl der Schlichtungen0