Libreria di Codici Sorgente MQL4 e MQL5

icon

Vuoi imparare il linguaggio di programmazione MQL5 o MQL4, ma non sai da dove cominciare? Qui sono disponibili vari programmi per il tuo terminale MetaTrader. Scarica e studia questi esempi di codici pubblicati e sviluppa per conto tuo degli indicatori e degli Expert Advisor. Le tue applicazioni pubblicate nella più grande libreria di codici MQL5 e MQL4 saranno disponibili in ogni terminale MetaTrader e nel MetaEditor.

I tuoi esempi di codice in MQL4 e MQL5 saranno distribuiti in tutto il mondo, permettendoti di entrare in contatto con migliaia di trader!

Invia il tuo codice

Bootstrap a blocchi dei risultati giornalieri: quale può essere l'entità massima del drawdown di un conto o di una strategia nei prossimi mesi, con percentili e un generatore con valori iniziali predefiniti per esecuzioni ripetibili.

Rileva il modello ICT su barre chiuse (killzone liquidity sweep, MSS con spostamento o FVG invertito, ingresso su ritracciamento con SL e TP) e segue ogni configurazione fino al risultato finale, fornendo statistiche relative allo scenario peggiore. Non effettua mai operazioni e non modifica mai i dati; buffer compatibili con gli EA.

Un indicatore che segnala il momento in cui le candele hanno superato un limite di prezzo estremo

Mette in evidenza le sessioni di Asia, Londra e New York e la sovrapposizione tra Londra e New York utilizzando l'ora locale effettiva e le regole relative all'ora legale, in modo che gli intervalli delle sessioni siano corretti su qualsiasi broker.

Script che riporta gli aspetti che un EA deve gestire in questo contesto: copertura o compensazione, autorizzazioni di trading, modalità di esecuzione, livelli di stop e di blocco, regole sui volumi, swap e posizioni già aperte sul simbolo. Salva un file di report che è possibile allegare a un ordine su Freelance.

Segna i gap di apertura giornalieri e del fine settimana su qualsiasi grafico, tiene traccia di quando ogni gap viene colmato, avvisa in caso di nuovi gap, registra una riga CSV per ogni gap e rende visibile il gap in iCustom.

Classifies each bar into trend, exhaustion, compression or noise regimes using Fractal Efficiency, ATR compression and a time-of-day adjusted volume Z-Score.

Watchdog in sola lettura per MT5: avvisi in caso di numeri magici sconosciuti, posizioni duplicate dopo la riconnessione, SL mancanti, stop out e su ciò che è accaduto mentre era disattivato. Non effettua mai operazioni.

L'indicatore individua le onde di prezzo, ne segna i massimi e i minimi con frecce a tre livelli e traccia automaticamente le linee di resistenza e di supporto in base a esse.

Draws the previous day, week or month high, low and close, the current period open and Classic, Fibonacci, Camarilla or Woodie pivots for each period, with a panel showing the nearest level above and below price.

Shows the relative strength of USD, EUR, GBP, JPY, CHF, CAD, AUD and NZD, plus an optional gold (XAU) line, built from the 28 major pairs, with a strongest-to-weakest ranking panel.

Volume-weighted average price that resets every day, week or month, with two pairs of standard-deviation bands, the previous period's final VWAP and a panel showing how far price is from VWAP in price, points and sigma units.

A script that turns candles into a MIDI file: one instrument per symbol, meter detected from the data, pitch from the move, duration from the candle body.

Dynamically export customizable historical bar data (OHLC, Tick Volume) and selected technical indicators (RSI, MACD, ATR, ADX, Stochastic, CCI, MFI, Momentum) directly to a clean .csv file with automatic header generation.

A real-time CCanvas on-chart utility for MetaTrader 5 that calculates net lot exposure per currency across all open positions and simulates the exact margin, Margin Level (%), and Stop-Out buffer impact of a new Buy or Sell order—automatically accounting for your broker's hedged margin rules.

Free panel indicator for funded / prop-firm accounts: shows the room left before the daily loss limit and the static maximum drawdown, and alerts when you get close. Monitor only: it never opens, closes or blocks trades.

Exports the closed positions of the account to a CSV file (one row per position) and shows a summary: trades, win rate, profit factor, net result, max drawdown and results per symbol. Read-only.

A compact on-chart scanner that shows the RSI of the Market Watch symbols (or of a custom list) in a sorted, color-coded dashboard, marks overbought and oversold symbols, and can send alerts when a symbol enters one of these zones.

Devil Trader AI Lite is an automated Smart Money & Liquidity Expert Advisor engineered exclusively for GOLD (XAUUSD) on M30 and H1 timeframes. It maps Major Demand and Supply Order Blocks, waits for confirmed rejection candles, and applies dynamic ATR Stop-Loss, auto-lot sizing, and trailing stop protection with zero Martingale.

Break-even and trailing stop for open positions, measured in R (distance to the first stop loss). Respects stops level and freeze level, only moves the stop in profit direction.

Probabilità di overfitting nel backtest (PBO) di un'ottimizzazione su MT5 mediante validazione incrociata combinatoriamente simmetrica. Ogni ciclo invia i propri risultati giornalieri sotto forma di frame e il PBO viene calcolato al termine dell'ottimizzazione.

Pannello integrato nel grafico che converte un’impostazione di rischio in una dimensione del lotto e mostra come l’incremento di volume e il lotto minimo del broker influiscono su tale rischio. Solo a scopo di visualizzazione: non effettua, modifica né chiude mai un ordine.

Seven-Bar Pressure Flip (SBPF) is a sell-only Expert Advisor for MetaTrader 5, provided as a research example for XAUUSD on the M15 timeframe. It looks for a bearish reversal candle following positive average candle-body pressure and manages positions using ATR-based stops, a fixed reward-to-risk setting, and a bar-count exit.

PRO Day Trading Signals is a non-repainting M15 indicator for MT5 that finds trend-following pullback entries after a liquidity sweep. How it works: it trades only in the direction of the H4/H1 trend (EMA200, EMA20/50). It waits for an M15 candle to sweep the previous 10-bar high or low at the EMA20/50 zone and close back inside. It confirms with a strong candle body (≥0.30 × ATR) and RSI (≥52 for BUY, ≤48 for SELL). Signals appear only on closed bars.

An MQL5 indicator example that checks the latest closed candle and suppresses duplicate alerts.

Marks every weekend gap on the chart, measures it in price and in ADR, shows whether and how fast it was filled, and keeps fill statistics for recent weeks. Display only, it does not trade.

Shows where today's daily ATR stands against the last 1, 3 and 5 years, and translates an ATR stop into money, lot size and minimum-lot risk for your account settings. Completed bars only. Display only, it does not trade.

Builds a time-of-day profile from your own broker's history: the typical spread, the typical tick activity and the typical spread-to-range cost of every time slot of the trading day. Cheap and expensive slots are marked in the indicator window, the daily rollover window is flagged, and a panel lists the best and worst slots and ranks the current spread against its own slot.

Intraday momentum EA for the Nasdaq 100: trades breakouts of a noise band around the New York open (rules of Zarattini, Aziz and Barbon, 2024), exits inside the band or across the session VWAP, flat at 16:00 New York.

Tokyo, London and New York session boxes with high-low range, kept on the right hours through every clock change, plus a live clock panel.

Tracks live MQL5 economic calendar events and real-time Bid-Ask spread in a chart HUD, exposing three iCustom buffers for EA news and spread gating.

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 didattico: breakout del range giornaliero con ordini pendenti BuyStop/SellStop, rapporto rischio/rendimento, take profit e giorni di trading. Codice MQL5 pulito e commentato, con controlli sul margine e sul livello di stop. Solo per la versione demo e lo Strategy Tester.

Spread Monitor è un Expert Advisor MQL5 che disegna sul grafico un pannello con codice cromatico. Il pannello mostra lo spread attuale del simbolo associato in punti, insieme alla media, al minimo e al massimo su un periodo storico mobile. Conta inoltre quanti campioni memorizzati hanno superato un livello di avviso e trasforma la riga di stato in rosso quando lo spread attuale è superiore a tale livello. L’utilità non effettua ordini. I parametri di input controllano il livello di avviso, la dimensione della cronologia, l’intervallo di aggiornamento e la posizione del pannello. Gli oggetti del pannello vengono rimossi quando l’Expert Advisor viene scollegato.

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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218