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

False breaks at an ATR envelope, drawn as trades: price pushes through a band, closes back inside, and a box runs from the entry to the moving midline, with the stop as a thick line. Each label prints the win rate of earlier signals in the same RSI zone, and a corner card charts it for every zone.

Detects swing highs and lows automatically and draws Fibonacci retracement levels on the latest completed swing leg. The levels move to the new leg as soon as a new swing is confirmed; the levels, their colors and the swing sensitivity are configurable.

Small include file that gives you the lot size from risk in percent (or fixed money) and the stop loss distance. Rounds always down, checks min/max lot and free margin.

Expert Advisor éducatif : cassure de la fourchette journalière avec ordres en attente BuyStop/SellStop, rapport risque/rendement, prise de bénéfices et jours de trading. Code MQL5 clair et commenté, avec vérifications de la marge et du niveau de stop. Uniquement pour la version démo et le testeur de stratégie.

Spread Monitor est un Expert Advisor MQL5 qui affiche un panneau avec un code couleur sur le graphique. Ce panneau indique le spread actuel du symbole associé en points, ainsi que les valeurs moyennes, minimales et maximales sur un historique glissant. Il comptabilise également le nombre d'échantillons enregistrés ayant dépassé un seuil d'alerte et affiche la ligne d'état en rouge lorsque le spread actuel est supérieur à ce seuil. Cet utilitaire ne passe pas d'ordres. Les paramètres permettent de définir le seuil d'alerte, la taille de l'historique, l'intervalle de rafraîchissement et la position du panneau. Les objets du panneau sont supprimés lorsque l'Expert Advisor est déconnecté.

Exports closed trades to a CSV file, one row per closing deal: partial closes, close-by and netting reversals are split, each row with the position's open time, volume-weighted open price and its share of the entry commission.

A 24-hour clock of typical H1 ranges for XAUUSD (and any other symbol) versus the range of the current hour. The profile uses closed hours only. Display only — it does not trade.

A clean on-chart map of psychological 00/50 figures, prior day and week extremes, and the average daily range, with honest bounce/break statistics. Display only — it does not trade.

A lightweight MetaTrader 5 Expert Advisor that records new-bar events and terminal connection-state changes to a local CSV file. Designed for developers and traders who need reliable event logging, diagnostics and monitoring without executing trades.

Marks every opening gap on the chart, measures its size in ATR units and follows it until price trades back to the fill level (previous close by default). A panel reports the fill rate, the median and 90th-percentile number of bars to fill, and the same figures for weekend gaps and for three gap-size buckets. Gaps that are still undecided are reported separately and never counted as filled.

Converts session hours given in London, New York, Tokyo or Sydney time into broker server time, including US and EU daylight saving and the weeks when the two are out of step. Comes with a check script that verifies 15 hand-calculated cases.

Free Expert Advisor that watches a basket of open positions (all, by Magic number or by symbols) and closes the whole basket when floating loss or profit reaches a set percent of balance. Works next to any EA or manual trading.

Part 4 of the regression-testing series. An Expert Advisor that builds a fixed matrix of 20 valid and invalid trade requests (stops at and inside the stops level, wrong-side stops, volume outside the symbol rules, oversized and unknown closes, unchanged and wrong-side modifications), checks each one with OrderCheck() without sending anything, and reports PASS, FAIL or INCONCLUSIVE per row with a digest you can compare between runs.

Un panneau graphique pour MT5 permettant de passer des ordres en attente « Buy Limit », « Sell Limit », « Buy Stop » et « Sell Stop » en un seul clic. Le volume, la distance et les niveaux SL/TP (facultatifs) sont définis sur le panneau ; la fonction OCO annule automatiquement l'ordre opposé. Comprend la suppression groupée, une liste d’ordres en temps réel et la gestion automatique du paramètre STOPS_LEVEL du courtier ainsi que du mode d’exécution. Outil d’exécution uniquement – pas de signaux, pas de résultats garantis.

Mesure, sur l'historique du graphique lui-même, la fréquence à laquelle une barre dépasse le plus haut ou le plus bas précédent après des barres haussières et baissières, sur un maximum de cinq niveaux espacés de l'amplitude moyenne. Chaque niveau est associé à une barre de probabilité, et un tableau indique le côté favori sur l'ensemble des barres et sur les 200 dernières.

Utility EA that moves the stop loss of positions you already have open: break-even with locked profit and trailing stop in points or ATR. It never opens trades.

Utility EA that closes all positions (and optionally deletes pending orders) when the total floating profit reaches your target or the total floating loss reaches your limit, in account currency. It never opens trades.

News trading EA for Gold (XAUUSD) and forex: places a Buy Stop and a Sell Stop seconds before each release of the MT5 economic calendar, one cancels the other, stop loss, take profit and trailing in points. Open source code.

Previous day high and low indicator for MT5 on Gold (XAUUSD), forex and indices: PDH, PDL, previous week high and low, day and week open, and an arrow when a closed candle sweeps a level and closes back inside. Open source code.

Daily loss limit EA for MT5 on prop firm and funded accounts, Gold (XAUUSD), forex and indices: closes every position at the daily loss or profit limit, deletes pending orders and locks trading until the next day. Open source code.

Premium and discount zones for MT5 on Gold (XAUUSD), forex and indices: dealing range from confirmed swings, equilibrium 50 percent, 25 and 75 percent lines and the OTE band of the last leg. Open source code.

Opening range breakout EA for MT5 on Gold (XAUUSD), forex and indices: trades the first candle that closes outside the opening range, stop at the range, target in multiples of the stop, lot by risk, end of day close. Open source code.

Read-only panel with the numbers a prop-style challenge is judged on: today's result from server midnight (closed plus floating), room to your daily loss limit, static or trailing overall floor, profit target and trading days.

A library for MetaTrader 5 that writes every pass of an optimization to a SQLite file: result, test statistics, your own metrics and the inputs of the pass. A demo Expert Advisor optimizes the Rosenbrock function in the mode "Math calculations".

A read-only script that works out a lot size from the cash you accept to lose and the stop distance, and shows how many such losses fit inside your own daily loss limit. Uses the symbol tick value, so it works for gold, FX and indices.

Typical range of each time of day (median of the previous N days) versus the actual range of the bar. Shows when the market really moves. No look-ahead, no repainting. M1 to H1.

An MQL5 indicator that draws a table on the chart with one row per open position and shows what one more night of holding it costs, in the deposit currency where the symbol's swap mode allows it. The swap mode and the two rates come from the symbol's own specification, and so does the triple-swap weekday; no rate is typed into the code. Where the symbol charges in points, a horizon column turns that night into the number of normal nights needed to repay one round turn, and a figure the terminal cannot supply is a dash with a reason, never a zero.

Trails the stop loss of open positions with one of seven methods plus a break-even that includes the commission. Moves a stop only on a real improvement, never back, respects stop and freeze levels, limits requests. Restart-safe.

An Expert Advisor for MetaTrader 5 that prints one line each time one of its event handlers runs, on a chart, in the Strategy Tester and during an optimization. It never trades.

Volume profiles per day, week, month or year with POC, value area high and low (classic two-rows method), naked POC lines that stay until price trades through them, and a developing POC. Built from M1 bars. 8 buffers for EAs.

Free XAUUSD MT5 indicator with Asian session High/Low, closed-bar liquidity sweeps, swing structure breaks, EMA trend context and a manual lot-size risk planner. No automatic trading or guaranteed profit.

Indique la part de la fourchette quotidienne moyenne (ADR) déjà utilisée aujourd'hui et trace les deux cours que le plus haut et le plus bas du jour pourraient encore atteindre si la journée se terminait avec une fourchette moyenne. Indique la part de la fourchette quotidienne moyenne (ADR) qui a déjà été utilisée aujourd'hui, et trace les deux cours que le plus haut et le plus bas du jour pourraient encore atteindre si la journée se terminait avec une fourchette moyenne.

L'indicateur « Session Range Breakout » trace les plus hauts et les plus bas de trois sessions intrajournalières au maximum (Asie, Londres et New York par défaut) et prolonge chaque niveau vers la droite avec, en option, des étiquettes H/L et un rectangle délimitant la fourchette. Les horaires, les noms et les couleurs des sessions sont configurables en fonction de l'heure du serveur. Des alertes contextuelles, sonores et push facultatives se déclenchent lorsqu'une barre clôture en dehors de la fourchette d'une séance. Les niveaux sont fixés une fois la séance clôturée ; le tracé ne s'actualise donc pas. L'indicateur trace uniquement des objets graphiques et n'ouvre jamais de positions.

A script for MetaTrader 5 that exports the raw values of all buffers of every indicator on a chart to one CSV file, without changing any code.

Classifies the current market volatility as Low, Normal or High by ranking the ATR against its own recent history. The percent rank is shown as a color-coded histogram in a subwindow, with optional alerts when the regime changes.

Donchian Channel (highest high and lowest low of the last N bars) with a middle line, breakout arrows on the chart and alerts by pop-up window, push notification or e-mail when price breaks out of the channel.

Squeeze Momentum indicator: detects periods of volatility compression, when the Bollinger Bands move inside the Keltner Channel, and shows the direction and strength of the momentum that builds up during and after the squeeze.

Part 3 of the indicator regression-testing series. Compares the value an indicator had when each bar closed with the value recomputed on the later history, flags every bar that changed (look-ahead or repainting), and measures how many future bars each value needed before it settled.

Ranks the current ATR against its own recent history and colours each bar as a LOW, NORMAL or HIGH volatility regime, with a panel showing ATR in price and points, ATR vs its median and how long the regime has held.

Standalone MQL5 library for storing custom settings separately for each trade and following a verified pending-order-to-position lifecycle. It supports double, ulong and price-unit fields, terminal-local Global Variables, safe cleanup gates and an offline self-test. Includes a demo EA, source archive, and installation guide. A different-ticket transition, reconnection as a separate scenario, and netting behavior remain untested.

12345678910...219