MQL5 Algo Trading
579K subscribers
4.64K photos
7 videos
4.65K links
The best publications of the largest community of algotraders.

Subscribe to stay up-to-date with modern technologies and trading programs development.
Download Telegram
Trade Manager Utility is a position management EA for MT5 that runs on both ticks and a timer, with a shared minimum cycle interval. It only modifies and closes existing positions and never opens trades.

Core functions include adding missing initial SL/TP anchored to entry, break-even moves with optional lock points, and trailing stops with points or ATR modes. Stop updates only tighten protection and are skipped when invalid under current price, broker limits, freeze distance, or spread filters.

Scope controls cover magic number filtering (-1 all, 0 manual, >0 specific), single-symbol vs all-symbols management, and a position-count monitor with optional alerts and newest-first excess closes.

Daily account protection can pause management and attempt closes after configurable equity/balance gain or loss thresholds. State is stored in terminal globals using ...

πŸ‘‰ Read | Calendar | @mql5dev
❀5🀩1
Outlier filters based on global thresholds fail when the market shifts by session or volatility regime. Local Outlier Factor (LOF) addresses this by comparing a bar’s neighbourhood density to the densities of its nearest neighbours, allowing quiet and volatile regimes to be β€œnormal” at the same time.

An MQL5 implementation is built from scratch using native matrix/vector types. Each closed bar becomes a 5D point; the last 500 bars are the reference cloud. The newest bar is scored against the cloud without being added. The trigger is a quantile (default 97.5%) of reference LOF scores, so it adapts per symbol/timeframe.

Architecture uses a refit lane every 4 bars and a query lane on each close. Features: log return, range/ATR, log(1+volume), spread, close location in range. The LOF score gates entries of a simple EMA-cross EA; tests focus on which t...

πŸ‘‰ Read | Signals | @mql5dev
❀8🀩3
A grid EA for XAUUSD that starts each basket from an RSI reversal on a closed candle. Buy when RSI crosses back above oversold, sell when it crosses back below overbought. A Reverse switch flips both signals. One-direction mode prevents a new basket in the opposite direction while one is active.

When price moves against an open basket, new grid levels are added every N points, using a lot multiplier up to a maximum level count. The initial lot can be fixed or sized from a percent of balance or equity. No per-trade stop loss is used.

The basket exits as a group via a money target or points from the average price, with optional basket stop loss and optional trading-hours filter. Margin usage increases with each level; disabling the basket stop allows deep drawdowns during sustained adverse moves. Strategy Tester validation and conservative sizing are required; ...

πŸ‘‰ Read | Docs | @mql5dev
❀6πŸ”₯4
This MQL5 workflow closes the gap between analysis and execution by treating trade actions as proposals, not immediate commands. Read-only tools run instantly, while order placement/close/modify/delete calls are queued and blocked behind a single human approval step.

Each proposed action is rendered as an approval card describing the exact operation, volume, stops/targets, and affected tickets. The tool loop pauses mid-turn until approve/reject, then resumes so the assistant can react to the outcome.

Execution is centralized in one dispatcher + validated executors: typed JSON argument readers prevent crashes, a safety gate enforces symbol/lot/position limits, lots are normalized to broker steps, and ownership scoping restricts bulk actions to allowed trades. Broker-specific constraints are left to the trade server, with refusals reported back for iterative corr...

πŸ‘‰ Read | VPS | @mql5dev
❀10πŸ‘5πŸ”₯3✍2🀩2
Terminal deal history is not position history. Partial closes often appear as multiple lines, and netting reversals can collapse close and open into a single deal. This exporter reconstructs positions from deals and writes one CSV row per closed position for external analysis.

Each row includes ticket, symbol, magic, comment, side, opened volume, entry/exit time and volume-weighted prices, duration, initial SL/TP (only if set on the opening order), and aggregated P&L components (gross, commission, swap, net). Risk metrics include risk_money and R-multiple when an initial SL exists.

Optional MFE/MAE are computed from M1 bars between entry and exit (Bid high/low), producing points and account-currency excursions plus bar count, session/weekday tags, and close reason. Limits: bar-based estimates, empty excursions if M1 history is missing, no export of open position...

πŸ‘‰ Read | NeuroBook | @mql5dev
πŸ‘5❀3πŸ”₯2🀩2πŸŽ‰1
Most EAs treat calendar releases as categories and block trading by importance and time window. That ignores what drives price: actual versus forecast, scaled so surprises are comparable across indicators.

MqlCalendarValue supports actual/forecast/previous, but forecast history starts May 2017. Central bank rate decisions and most speeches have no forecasts, so surprise-based models cannot cover them. Large currency-wide CalendarValueHistory calls can timeout; querying per event avoids silent zero-row returns.

Standardizing surprise with mean/stdev fails due to mis-scaled forecasts. Median and MAD (1.4826 scaled) with expanding history avoids look-ahead bias, plus a hard gate (10 robust sigma) removes impossible rows.

Release timestamps often miss the bar that moved due to startup GMT/server-time flips and DST shifts. Offsets can be recovered from price by...

πŸ‘‰ Read | Signals | @mql5dev
❀9🀩5πŸ‘3πŸ†2
An MT4/MT5 indicator processes only closed bars and flags five candle patterns: bullish/bearish engulfing, bullish/bearish pin bar, and inside bar. Pin bars are defined by configurable wick and body percentages, inclusive at the limits. Inside bar direction follows the mother bar; doji mother bars are skipped. Signals require a minimum bar range expressed as a multiple of Wilder ATR, with an optional EMA trend filter.

Each signal opens a case at the signal bar close. Take and adverse levels are set at entry Β± X*ATR and βˆ“ Y*ATR using the signal bar ATR. Resolution is the first subsequent bar to hit either level; a bar touching both counts as a miss. Unresolved cases after a fixed wait are discarded.

A panel reports rolling hit rate per pattern over the last N resolved cases, plus sample size. Values are non-repainting and deterministic, with iCustom b...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀6πŸ‘2✍1