NHS Trend Biased Probabilities
- Uzmanlar
- Sürüm: 1.0
- Etkinleştirmeler: 20
A trend-following EA. By default every in-trend setup is taken (100/100 probabilities), so it is fully deterministic — same history and settings give same trades, every time. Lower the probabilities for weighted random draws. Exits are fully mechanical.
- With the default seed (42 = fixed), runs are repeatable — the same backtest always takes the same trades. Set the seed to 0 = random for different random numbers on every start, so every backtest, optimisation pass and live week takes different trades.
- Two backtests of the same period will show different results. That is normal and expected. Never judge this EA from a single backtest.
- To get a repeatable backtest, set a fixed seed number (any positive integer) in the settings. Same seed + same history + same settings = same trades, every time. The seed in use is shown on the on-chart panel as FIXED or random.
- To judge robustness, run the same period with several different seeds and look at the range of outcomes, not one number. Optimise only with a fixed seed, then confirm the winner on other seeds.
How it trades
- Trend regime: a moving-average model classifies the market as Bull, Bear or Neutral. Neutral means no trade. The classification needs a minimum volatility-normalised gap held for 2 bars, which filters out directionless chop.
- Higher-timeframe confirmation (on): the H4 trend must agree with the trade direction, or the setup is skipped.
- Optional structure filter (off): can additionally require a confirmed break of swing structure aligned with the trend.
- The draw: every in-trend setup is taken at the default 100/100 (adjustable per side, follow or fade, three trend calculation methods). Lower the probabilities for random draws. Sideways markets never trade unless you explicitly allow flat-regime flips.
- Exits: 1.25x-volatility stop and a 36-bar time stop; trailing stop on, break-even and fixed take-profit off by default. All exit decisions use closed-bar prices.
- Stacking (off): optional averaging into running trades with spacing and counter-signal rules.
- Risk governance: 1% risk per trade, daily loss cap, max trades per day, losing-streak pause — each with its own action (pause a day/week, require manual restart, or close everything). Optional session, weekly, volatility and news filters.
Settings (defaults ready to run)
- Trading: trades XAUUSD by default (base name; suffix auto-detected) on the H1 chart, 100/100 deterministic probabilities, trend-following mode, neutral regime enabled.
- Confirmation: higher-timeframe gate on (H4, must align); structure filter off.
- Exits: 1.25x-volatility stop, trailing on, break-even off, fixed take-profit off, 36-bar time stop.
- Safety: 1% risk, 3% daily loss cap (closes all), 5 trades/day and 3-loss streak pauses.
- Randomness: seed 42 = fixed repeatable runs; set 0 for random every start; shared number stream across symbols, or independent streams per symbol for baskets.
- Display: on-chart status panel on (can be hidden from the settings).
On-chart display
A read-only status panel (dark steel theme) shows the seed with its FIXED/random badge, news state, trend method and bias mode, neutral-zone settings, number-stream mode, stacking, higher-timeframe and structure states, weekly window, then per symbol: volatility, moving averages, structure label, trend, last coin-flip description, open trades with profit and time in trade, lifetime wins/losses and win rate, daily count and streak usage, and any limit pause with reason and resume time. No buttons — display only. Each copy of the EA draws its own panel, so several instances can share a chart without overwriting each other.
Getting started
- Copy the.mq5 file and the icon file into MetaTrader 5 (File → Open Data Folder → MQL5 → Experts) and compile. The icon must sit next to the source or compilation fails.
- Drag the EA onto an XAUUSD H1 chart (higher-timeframe history is also needed for the confirmation gate) and tick Allow Algo Trading.
- Backtests are repeatable out of the box (fixed seed 42); set the seed to 0 for random draws. Use a unique trade ID per instance and a low-spread account given the trade frequency.
Good to know
- Why do two backtests differ? — Only if the seed is 0 (random mode). With the default fixed seed, runs are identical; fix the seed to compare settings, vary seeds to judge robustness.
- Why is it not trading? — Neutral market (most common), higher-timeframe/structure veto, spread, session, news, or a daily/streak/count pause. The panel names the state; the log names the blocker.
- Why paused for the day/week? — a risk rule fired; the panel shows the reason and resume time. Week/manual pauses need Monday or a re-attach.
- Can I copy someone's backtest? — With their exact settings on the same broker history. Defaults are deterministic, so they reproduce; with seed 0 your run will differ.
- It only touches its own trades (tracked by its trade ID). Manual trades and other EAs are never modified or closed.
- Frequent trading means costs matter. Start on a demo account and never risk money you cannot afford to lose.
Requirements
MetaTrader 5 hedging account with history for the chart symbol/timeframe (plus the higher confirmation timeframe). No extra files, libraries or subscriptions needed.
