NHS Trend LIne Matrix
- Experts
- Versione: 1.0
- Attivazioni: 20
An automated trendline system. It continuously fits statistical trendlines through recent swing points, scores them for quality, and trades breakouts and bounces with volatility-based stops and targets that adapt to calm vs volatile conditions.
How it trades
- Line detection: trendlines are fitted across recent price history and filtered by touch quality, slope, goodness-of-fit and candle-shape checks. The best support/resistance lines are drawn on your chart.
- Market regime: trend strength, volatility ranking and volume ranking classify each symbol as trending, ranging or volatile, shaping which entries and targets apply.
- Entries: trendline breakouts and bounces (plus range bounces), each requiring a minimum quality score, minimum reward-to-risk, spread check and cooldown between trades.
- Advanced entries (optional, off by default): breakout-retest entries, false-breakout fades and parallel-channel continuation — enable only after forward-testing, as they change behaviour significantly.
- Exits: volatility-scaled stops (capped at 1.2x high-ATR percentile), profit targets and trailing stops (wider in volatile markets, tighter in calm ones), break-even, staged partial profits (TP1 at 1.5R closes 60%), structure-break exits and an optional maximum holding time.
- Sizing: 2% risk per trade with optional performance-adaptive sizing that gently scales up line types that have been working and down those that have not.
- Portfolio tools: optional per-symbol setting profiles, correlation-aware sizing across pairs, portfolio-wide risk cap and volatility shutdown, plus daily loss, equity-lock and global-halt guards.
Settings (defaults ready to run)
- Setup: trades USDJPY on the chart timeframe (H1). One trade per symbol at a time, max 6 portfolio-wide.
- Quality: wide-open quality gates by default — tighten the confluence score and reward:risk minimums for fewer, pickier trades.
- Exits: adaptive volatility stops/targets/trails, break-even on, partial profits on, structure exit on.
- Safety: 5% daily loss limit, equity locks, 30% global halt, weekly/daily session windows and news blackout available (news on by default).
- Advanced: retest, fade and channel modules off; adaptive sizing off; portfolio engine passive unless configured.
- Display: trendline drawing and on-chart status panel on (each can be hidden separately).
On-chart display
Support/resistance lines with touch and break markers are drawn and maintained live, plus a read-only status panel (dark steel theme) with a guard-state banner, one row per symbol (regime, bias arrow, trend strength, volatility, best lines, position and profit/loss) and a risk footer. Display only — no buttons. It can share a chart with other instances; each copy draws only its own objects.
Getting started
- Copy the.mq5 file into MetaTrader 5 (File → Open Data Folder → MQL5 → Experts) and compile it.
- Drag it onto the chart matching your intended timeframe (it follows the chart by default) and tick Allow Algo Trading.
- Edit the symbol list if your broker uses a different suffix than the default, and make sure enough chart history is loaded.
- Give each copy its own trade ID number in the settings if you run multiple instances.
Good to know
- Why no trades for days? — quality score, reward:risk, spread, session, news, cooldown and portfolio gates all stack. The log names the exact blocker.
- What do the extra entry toggles do? — retest, fade and channel entries add new trade types on top of base breakouts/bounces. Off by default; forward-test before combining.
- Why did a position close quickly? — structure-break exit, holding-time limit, break-even, trail or a portfolio cap can all exit early by design.
- It only touches its own trades (tracked by its trade ID). Manual trades and other EAs are never modified or closed. A FIFO mode is included for US accounts.
- Pattern strategies are regime-dependent and drawdowns near 20% are normal for this setup — halve the risk if that is uncomfortable. Start on a demo account and never risk money you cannot afford to lose.
Requirements
MetaTrader 5 hedging account with sufficient chart history. No extra files (setting profiles optional), libraries or subscriptions needed.
