Trend King — Auto Bandit (MT4)
Trend King — Auto Bandit combines a robust 3-EMA pullback baseline with regime mapping (Volatility × Trend Strength × Autocorrelation = 18 cells) and a multi-armed-bandit selector (UCB).
The EA learns online, adapts micro-variants (EMA fine-tuning, ATR SL/TP factors, pullback target, trailing mode, ADX threshold) and persists state per symbol & timeframe.
No curve-fitting. No parameter chase. Learning from real execution.
Online learning & path-dependence: The bandit needs real, sequential tick/trade flow with spread/slippage/margin feedback.
Regime switching: 18 state cells + state-dependent arm selection/mutation → tester distorts intrabar breakouts & trailing.
Multi-parameter dynamics: Arms mutate adaptively; classic WFO/optimizers don’t represent this behavior.
Bottom line: The only meaningful “optimization” is a demo warm-up. Then go live.
Baseline: 3-EMA trend + pullback (Fast/Mid/Slow) with AO baselines (“Variant B”).
Regime mapping: ATR% (vol), ADX (trend), ACF(1) → 18 cells.
Bandit arms (per cell):
EMA fine scaling (± around baseline),
ATR-SL× / ATR-TP×,
Pullback target (Fast vs. Mid),
Trailing mode (ATR vs. Donchian),
ADX threshold factor.
Selection via UCB; weakest arms get mutated.
Risk logic: Risk% per trade (lots from stop distance), gross-risk cap across open positions per symbol/TF, spread guard, configurable positions per side.
Persistence: Learning per symbol/TF with file storage (see paths).
Leave AutoMode = true. The bandit handles the fine details. Day-to-day you only set:
AutoMode = true (autonomous mode)
RiskPerTradePct – risk per trade (%)
GrossRiskCapPct – equity-based gross risk cap
MaxOpenPositions – max concurrent positions (per symbol/TF)
MaxSpreadPoints – spread guard (optional; 0 = off)
Slippage , MagicOverride – if needed
Everything else can stay default. (ADX/ATR/Donchian etc. are auto-tuned via AO baselines + bandit.)
Copy TrendKing_AutoBandit.mq4 to ...\MQL4\Experts\ .
Restart MT4 or refresh the Navigator.
Open the symbol/TF, attach the EA.
Set only the minimal inputs above (especially RiskPerTradePct ).
Important: Do not use the MT4 Strategy Tester/Optimizer.
Let the EA run for weeks or until you have enough trades and a stable, positive equity/R curve.
During warm-up the EA learns per regime cell, mutates weak arms, adjusts EMA/ATR/trailing, and continually chooses the strongest micro-variant.
Once demo performance is stable/positive: copy the state files (see below) and attach the EA with the same settings on your live account.
Done – no classic optimization required.
The EA stores learning state in MT4 Common Files (shared by terminals under the same Windows user).
Filename (per symbol/TF):
tkbandit_<SYMBOL>_<TF>_v3601.dat
Example: tkbandit_EURUSD_60_v3601.dat
Primary folder (with subfolder; Windows):
C:\Users\<YourName>\AppData\Roaming\MetaQuotes\Terminal\Common\Files\BanditTK\
Fallback (if no subfolder exists):
...\Terminal\Common\Files\ (files in root)
Copying:
From (demo PC/user): ...\Common\Files\BanditTK\
To (live PC/user): ...\Common\Files\BanditTK\
Close both MT4s, copy, then start the live MT4.
Use the same symbol & timeframe on the live chart—otherwise a different file will load.
If demo & live run under the same Windows user, both see the same Common folder—often no copy is needed.
You can, but results are not reliable (relaxed filters, different spread/slippage, no real interaction). Only the real demo performance matters.
How do I “optimize” the EA?
You don’t. Warm-up on demo until stable positive. Then copy state and go live.
How many charts?
Multiple symbols/TFs are fine—each chart learns independently (own file). Start with 3–6 pairs/TFs, expand as you wish.
May I tweak (e.g., ADX on/off)?
You can, but in AutoMode the bandit auto-tunes fine settings. Recommendation: keep defaults, just control risk/guards.
How do I reset learning?
Delete the relevant tkbandit_*.dat for that symbol/TF (with MT4 closed). On next start it reseeds.
When is warm-up “enough”?
Practically: sufficient trades plus a smoothly positive curve on demo over your intended holding horizon (days/weeks). Stability beats any single number.
✅ Put EA in ...\MQL4\Experts\
✅ Attach to chart, AutoMode=true, set RiskPerTradePct
✅ No tester/optimizer
✅ Demo warm-up until stable positive
✅ Copy files:
...\Common\Files\BanditTK\tkbandit_<SYMBOL>_<TF>_v3601.dat
from Demo → Live (same Common folder may mean nothing to do)
✅ Start live — no further optimization
Have hundreds of bars per TF available.
Spread/slippage/margin matter—use a stable VPS/server.
Consider MaxSpreadPoints (e.g., 25–35 on 5-digit FX) to filter news spikes.
Use GrossRiskCapPct as a second safety net (e.g., 1.5–2.0%).
Trading involves risk. Use only capital you can afford to lose. Past performance is not indicative of future results.
EA: Trend King — Auto Bandit v3.6
Bandit state version: v3601 (embedded in filenames)
If for any reason you do not like the purchased program, you can request a refund within 30 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.
Simply send a request for refund or exchange with your order number by email: support@fx-market.pro.
Refund requests received more than 30 days after purchase will be rejected.