Top MQL4 and MQL5 source codes based on user ratings - 23

Submit your code

Before the Friday close: estimates how much your open positions could lose if the market reopens with a gap, and compares it with the room left under the daily loss limit of the next trading day. For prop firm and funded accounts. It only reads the account.

Draws the fair value gaps (three-candle imbalances) that price has not filled yet, follows how much of each gap is filled and ends the box when it is. Closed candles only, no repaint. Alerts and buffers for EAs.

Market structure in the way of Smart Money Concepts: swing highs and lows with HH / HL / LH / LL labels, BOS (break of structure) and CHoCH (change of character) lines. Swings count only after their right candles close, so nothing repaints. Alerts and a trend buffer for EAs.

Non-repainting three-bar Fair Value Gap detector for MetaTrader 5. Closed-bar detection, the 50% Consequent Encroachment level, mitigation as an explicit state machine, incremental scanning, and a built-in self-audit that re-checks the stored gap levels against the closed-bar series on attach. Pure native MQL5, no DLLs, no external dependencies.

Closes all trades and blocks new ones when your prop firm daily loss or maximum drawdown limit is reached.

Reads your closed trades, converts each to an R-multiple and simulates many future runs at a chosen risk per trade. Reports the probability of hitting a drawdown floor, the probability of ending profitable, the median ending balance and the 95% range. Read-only.

Read-only panel showing per-magic net P/L, account drawdown, daily-loss breaker progress and freeze/liquidate thresholds. Does NOT trade.

Highlights potential buy zones in uptrends and sell zones in downtrends on closed candles (no repainting), with automatic lot size for your balance and a daily loss guard.

Measures, on the chart's own history, how often a bar takes out the prior high or the prior low after bullish and after bearish bars, at up to five levels spaced by the average range. Each level carries a probability bar, and a table scores the favored side over all bars and over the last 200.

Read-only panel that shows the distance to margin call and stop out in money, percent of equity and points, plus adverse price and equity shock scenarios. Hedge-aware, does not trade.

Short description (for the "Short description" field) Shows economic news events directly on your chart as colour-coded vertical lines with tooltips, plus a draggable event panel with upcoming and recent releases. Works on every symbol and timeframe, with filters for impact level and instrument groups (Gold & Silver, Forex Majors, Indices, Oil & Gas).

Automated checks of an Expert Advisor on a live demo chart (restart, second copy, server history, chart button) with a PASS/FAIL report.

Educational Expert Advisor: moving average crossover with clean, commented MQL5 code – margin, volume, stop level and spread checks, order retries. Demo accounts and Strategy Tester only.

Educational Expert Advisor: Bollinger Bands return to the mean with an optional RSI filter and trading hours. Clean, commented MQL5 code with margin, volume and stop level checks. Demo and Strategy Tester only.

Educational Expert Advisor: daily range breakout with BuyStop/SellStop pending orders, risk-reward take profit and trading days. Clean, commented MQL5 code with margin and stop level checks. Demo and Strategy Tester only.

Line Master is a trend-following indicator for MetaTrader 5 that displays fast and slow dynamic price lines to help traders identify market direction and potential trend changes. Blue represents a bullish trend, while red represents a bearish trend. Visual markers highlight changes in the indicator's trend state. The indicator includes adjustable Fast Length and Slow Length parameters, allowing traders to customize its sensitivity. It can be used on forex, gold (XAUUSD), indices, and other MT5-supported markets. For better results, combine its signals with price action, support and resistance levels, and proper risk management. Signals are not guaranteed and should be confirmed before entering a trade.

Risk tool for prop firm accounts: closes all positions and blocks new trades when the daily loss or max loss limit is reached. Never opens trades on a live chart.

Single-header account lock for MT5 EAs: licensed account numbers, optional demo allowance, expiry date, tester bypass. Licence compiled in with #define. No DLL.

On-chart panel that calculates the lot size for a given risk (% of balance, % of equity or fixed money) and stop-loss distance, using the broker's tick size and tick value. Works on forex, metals, indices and crypto.

Shows the current spread next to its recent average and maximum and compares it with ATR, so you can see at a glance when trading costs are too high relative to the symbol's normal movement.

Expert Advisor template that shows safe execution practices: closed-bar signals once per bar, no duplicate entries after an MT5 or VPS restart, spread and stop-level checks, normalised volume and a log line for every decision.

Detects the ICT model on closed bars (killzone liquidity sweep, MSS with displacement or inverted FVG, retrace entry with SL and TP) and follows every setup to its result with worst-case statistics. It never trades and never repaints; EA-ready buffers.

Marks daily and weekend opening gaps on any chart, tracks when each gap is filled, alerts on new gaps, logs one CSV line per gap and exposes the gap to iCustom.

Read-only watchdog for MT5: alerts on unknown magic numbers, duplicate positions after reconnects, missing SL, stop outs and what happened while it was off. Never trades.

The indicator identifies price waves, marks their peaks and troughs with arrows at three levels, and automatically plots resistance and support lines based on them.

Highlights the Asia, London and New York sessions and the London/New York overlap using real local time and daylight saving rules, so the session boxes are correct on any broker.

Fits GARCH(1,1), GJR-GARCH and EGARCH with normal, Student t or GED shocks by maximum likelihood, with robust standard errors and variance forecasts.

Include for EAs running 24/7 on an MQL5 VPS or PC: run-where switch, order send with OK/FAIL/UNKNOWN result (no duplicate orders after a timeout), restart-safe counters, positions closed while the EA was off, append-only log and optional Telegram. No trading logic inside.

Holidays and early halts of the CME equity index futures (S&P 500, Nasdaq-100, Dow, Russell 2000, E-mini and Micro), computed from the US holiday rules for any year, with a script that checks the calendar against your broker's own M1 history.

Is the best of many strategies really better than the benchmark? Hansen's SPA test, White's Reality Check, Romano-Wolf StepM and the model confidence set.

Five tests to tell a random walk from a mean-reverting series: KPSS, Phillips-Perron, DF-GLS, Zivot-Andrews with the break date, and the variance ratio.

Range boxes that are drawn when market trend strength weakens

Tick Scalper Helper is a manual trading utility for traders who work on very short time frames and want to see every price change.

Market structure indicator for Gold (XAUUSD), EURUSD and any symbol: swing highs and lows with HH HL LH LL labels, BOS and CHoCH drawn on closed candles, alerts and 4 buffers for EAs. Open source code.

A clean Heikin Ashi indicator that draws on the main chart window. It also adds one horizontal line at the average price, (Open + High + Low + Close) / 4, of the last closed candle of a chosen timeframe. By default this is H1, and the line uses the normal candles, not Heikin Ashi.

CBrokerTime converts server time, UTC, New York, London, Sydney and Tokyo with the real summer time of every year and finds your broker's clock from the history (also in the tester). The indicator draws session lines and a clock panel.

Drag the stop-loss line and read the lot size that risks exactly your money or percent. The CRiskSizer class does the same in an EA: lot rounded down, minimum lot never forced, max lot, volume limit, stop level and margin checked.

Closes all open positions and optionally deletes pending orders with one click. Filter by symbol and magic number.

Parkinson, Garman-Klass, Rogers-Satchell and Yang-Zhang estimators, daily realized and bipower variance from intraday bars, and HAR volatility forecasts.

Exact maximum likelihood of an Ornstein-Uhlenbeck spread and Bertram's optimal entry and exit levels for a given cost, with the expected length of a trade cycle.

1...161718192021222324252627282930...221