Bibliothèque de code source MQL5 pour MetaTrader 5 - 3

icon

Il s'agit de la plus grande bibliothèque de code source gratuite pour les programmes de la plateforme MetaTrader 5. Vous y trouverez des Expert Advisors, des indicateurs techniques, des scripts et des bibliothèques prêts à l'emploi. Utilisez la bibliothèque de codes lors de l'apprentissage du langage MQL5 et développez vos propres applications de trading automatisé basées sur les codes fournis.

Vous pouvez librement télécharger et tester les codes publiés, ainsi que les lancer dans MetaTrader 5. La bibliothèque est également disponible directement depuis la plateforme MetaTrader 5 et l'environnement de développement MetaEditor.

Soumettre votre code

A simple account guard: once the day's loss (equity against the balance at the start of the day) reaches your limit, it closes all positions, deletes pending orders and keeps the account flat until the next day. Works on manual trades and on any EA. Never opens trades.

Moves the stop loss of open positions to break-even plus a small locked profit once they reach a profit trigger. Works on manual trades and on trades from any other EA (magic filter). Never opens or closes trades and never moves a stop backwards.

Counts run of bars of the same color and measures what the next bar did after a run of every length: how often the run continued, how often it reversed, and how far the next bar moved in ATR. The figures are built from the history of your own symbol and timeframe, each row is compared with the share of bars of that color, and the histogram shows the length of the run at every bar. A panel gives the table and one line that can be pasted into a comment to compare symbols.

A script that sets your own margin call and stop-out levels above the broker's. It alerts when the margin level falls below your margin call level and, below your stop-out level, closes positions one at a time, the worst net result first, until the level is back up, the way a broker stop-out works.

Free MT5 dashboard comparing eight major-currency strengths and ranking up to 28 FX pairs from completed candles. Includes broker-prefix/suffix detection, synchronization checks, chart navigation and eight output buffers. Independent MIT-licensed source; no trading operations.

One include file that reads and writes JSON in MQL5. It refuses broken JSON and tells you the line and column of the mistake, keeps numbers exact, reads and writes UTF-8 files, and saves your EA's settings to a file and loads them back.

Regular and hidden divergences between price and RSI, MACD, Stochastic, CCI or Momentum. Swings confirmed on closed bars, signal on the confirmation bar, lines on oscillator and price. No repaint, buffers for EAs.

Previous day, week and month high and low, New York midnight open, period opens and the Asian range, with sweep marks and one alert per level. Day from broker or New York time. No repaint, buffers for EAs.

An include file that makes the way an EA sends its orders safe: the same signal is never traded twice. It has no trading strategy inside and comes with a small example EA.

Shows US Pacific time on the chart, with the broker's time beside it, and the Pacific time of any candle under the mouse.

Calculates the correct lot size from your risk (% of balance, % of equity or a fixed amount) and stop-loss distance. Shows actual risk and margin. Never places trades.

Shows the time left until the current candle closes and the live spread in any chart corner. Keeps counting every second, even when no ticks arrive.

Closes open positions and deletes pending orders in one run, with filters for symbol, magic number, side and profit or loss. Asks for confirmation and retries failed closes.

Un EA de scalping Supertrend doté de 14 filtres sélectionnables et d'un panneau d'auto-évaluation qui affiche le taux de réussite réel à côté du taux de réussite nécessaire pour atteindre le seuil de rentabilité après prise en compte du spread réel, ce qui vous permet de déterminer si un paramètre offre un avantage réel ou s'il ne s'agit que d'un pourcentage élevé.

Tick Scalper Helper est un outil de trading manuel destiné aux traders qui opèrent sur des horizons temporels très courts et souhaitent suivre chaque fluctuation de cours.

Range Compression Zones Breakout draws range compression zones and marks breakouts that pass a higher-timeframe high/low filter and a volume filter. Inspired by the range compression idea in Domenico D'Errico's Accumulation/Distribution study (TASC, August 2018). Independent implementation, not a literal port of the published study.

Tick-Based Spread Distribution Profiler reads historical Bid/Ask ticks via CopyTicksRange() and plots 24h spread percentiles (P50, P90, P99) in a separate subwindow.

Execution & Slippage Forensics audits MetaTrader 5 account history (Orders vs Deals) to quantify real execution quality in points and currency.

Classifies volatility on closed bars using ATR(14), with three color-coded regimes and optional alerts.

Moves the stop loss to break-even and then trails it on trades that are already open. It never opens or closes a trade.

Dynamic Volume Profile indicator for MetaTrader 5 displaying horizontal volume distribution, Point of Control (POC), and Value Area (VAH/VAL) zones. Includes a layout switcher to anchor the histogram on either the right or left side of the lookback range.

Gestionnaire de positions pour MT5 qui clôture la position la plus rentable ainsi que la plus déficitaire lorsque leur résultat combiné atteint le seuil minimum que vous avez défini. Prise de bénéfices et stop loss groupés en montant, filtre magique, interface simple. Compatible avec les stratégies « grid », « martingale » et les transactions manuelles. Code source ouvert.

La meilleure parmi plusieurs stratégies est-elle vraiment plus performante que l'indice de référence ? Le test SPA de Hansen, le « Reality Check » de White, le modèle StepM de Romano-Wolf et l'ensemble de confiance du modèle.

Script that closes positions in one click: all, only profitable, only losing, only buys or only sells, for this symbol or all symbols, with a magic filter and optional pending order delete.

Daily loss limit and daily profit target for the whole account (prop firm style). When a limit is hit it closes positions, deletes pending orders and keeps the account flat until the next daily reset.

Risk-based lot size panel: risk (% of balance, % of equity or money) and stop loss in points give the lot. Shows money at risk, reward and margin and opens BUY / SELL with SL and TP in one click.

Multi-timeframe trend table (M5, M15, M30, H1, H4, D1): price vs fast EMA vs slow EMA, RSI for each timeframe and an overall bias.

Countdown to the next important economic news from the built-in MetaTrader 5 calendar, with a vertical line and a before/after zone for every event.

Previous day high/low/open/close, previous week high/low and today's open, drawn as a segment for each of the last N days with price labels.

Shows the time left on the current candle, the live spread and today's range next to the price or in a chart corner. Works on every timeframe.

Decides if you can add to a running winner: only when all open trades in that direction are on break-even and the newest one is in profit. The open risk is never more than one add. Hedging accounts only.

Drag a stop-loss line and read the lot size for your risk. The loss per lot comes from OrderCalcProfit, so the size is right on metals, indices and cross pairs. Shows the real risk after rounding, the margin and an R-multiple take profit. Places no orders.

A script that reads a tick CSV into a custom symbol and builds its M1 bars, so the Strategy Tester can run "Every tick based on real ticks" over a period the broker's server does not keep. It finds the columns by name and moves UTC times to server time.

A script that shows how far back your broker's server keeps real ticks for a symbol. It samples a few short windows over the last four years, asks for each one until its ticks arrive or the time is up, and prints the oldest one that has ticks.

Draws support and resistance from confirmed swing points and keeps each level live, with its price on the chart, until a close breaks it. Every break is graded on the spot: an arrow when volume surges, a diamond when the candle shows a rejection wick, a hollow circle when price slipped through without either.

Small MQL5 library that shares an EA's own runtime settings between charts of the same account, with edits from either chart, a file lock and per-field merge.

Checks the bar history of the chart for six defects that make an indicator give different values on another broker: missing bars, impossible values, filler bars, repeated bars, bars without ticks and price spikes. Every defective bar is marked in the indicator window, and a panel gives a health score for the symbol and timeframe, the largest holes, the defect counts and one line that can be pasted into a comment to compare brokers.

finds out why an indicator shows nothing on the chart. It reads the buffers of every other indicator on the chart and gives each one a verdict: not calculated, all values empty, values only in the newest bars, all values zero, no values in the visible bars, or values outside the visible scale. A panel lists the problems first, gives one line of advice and prints a report line that can be pasted into a comment.

Moves the stop loss of already open positions (manual or from any EA) to break-even and then trails it by points or ATR. Never opens or closes trades, only moves the SL in your favour.

Draws Asian, London and New York session boxes (high/low and range in points) for the last N days. Session hours are set in GMT; the broker's GMT offset is detected automatically.

12345678910...220