Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Accedi al CodeBase dal tuo terminale MetaTrader 5
Non hai trovato il codice che fa per te? Ordinane uno dalla sezione Freelance
Come scrivere un Expert Advisor o un indicatore

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

EA per il recupero del basket XAUUSD su timeframe M15 con spaziatura ATR adattiva, verifica della struttura LL/LH, gating dinamico dell’RSI, rilevamento dei crolli, filtro delle notizie e ottimizzazione intelligente delle operazioni.

Crea un istogramma del volume orizzontale su una finestra di analisi retrospettiva recente e contrassegna il Punto di Controllo (POC) e l'Area di Valore utilizzando l'algoritmo standard TPO/volume per l'espansione dell'area di valore — non solo il POC ± un offset fisso. Viene aggiornato una volta per ogni nuova barra e visualizzato come barra laterale accanto al prezzo.

A high-precision trend filter combining EMA dynamic momentum with ATR volatility bounds to pinpoint high-probability entries.

Dynamic Exponential Moving Average crossover Expert Advisor featuring volatility-based ATR Stop Loss/Take Profit and automatic account risk percentage position sizing.

Trend-following Expert Advisor for MetaTrader 5 combining Supertrend direction with ADX and DI confirmation. Uses an ATR-based stop loss and risks up to 0.5% of equity per trade.

Marks impulse candles: body at least ATR x multiplier, body at least a set share of the candle range, close near the extreme, optional tick volume confirmation. Green arrow below a bullish impulse, red above a bearish one. Closed bars only, no repainting. Signals are in the two buffers so an Expert Advisor can read them with iCustom.

Account level risk guard for prop firm accounts. One copy on any chart watches every position on the account, closes everything when the daily loss or maximum loss limit is hit, caps lot size and can flatten around high impact news. Logs every action to the Experts tab and a CSV.

Draggable on-chart manual trading panel with multi-timeframe bias, ATR SL/TP hints, a trailing stop and one-click BUY/SELL/CLOSE ALL.

Indicatore MT5 open source per la struttura di mercato confermata, i blocchi di ordini volumetrici e l'attività di acquisto/vendita stimata.

Contrassegna i massimi e i minimi frattali come livelli di liquidità, quindi evidenzia con una freccia e un’etichetta di prezzo opzionale la barra esatta in cui il prezzo supera un livello e chiude nuovamente al suo interno — un “liquidity sweep” o “stop hunt” —. I controlli di “sweep” vengono eseguiti solo sulle barre chiuse, quindi i segnali non vengono mai ridisegnati.

Marks swing highs and lows only after N closed bars have confirmed them, so a drawn swing never moves or disappears.

Turtle-style Donchian breakouts on gold, followed with three exits at once: an ATR trailing stop, the Turtle exit channel and a fixed target. Backtested on XAUUSD H1 and H4 in 2025 and 2026, where all twelve combinations were profitable. Non-repainting, with buffers for an Expert Advisor.

A Turtle-style breakout EA for gold. It buys when an H4 bar closes above the 20-bar high in an uptrend, with a 2 ATR stop and a 2R target. Backtested on XAUUSD from January 2020 to September 2026: +9,029.72 on 10,000 at 1% risk, profit factor 1.77, max drawdown 11.38%, 6 of 7 years profitable.

Finds the weekend CME gap on gold and on 24/7 Bitcoin charts, keeps every unfilled gap on the chart until price returns to it, and shows how often gaps filled, how fast, how far price ran first, and what fading them would have made. Non-repainting, with buffers for an Expert Advisor.

Un pannello GUI interattivo per MetaTrader 5 progettato per i trader manuali e gli sviluppatori quant. Automatizza il dimensionamento dinamico delle posizioni in base alla percentuale esatta di rischio sul capitale del conto, offre l’esecuzione degli ordini con un solo clic (Acquisto/Vendita), il BreakEven istantaneo, la funzionalità “Chiudi tutto” e la gestione continua in tempo reale del Trailing Stop.

Ciò consente al grafico MT5 di scorrere come quello di TradingView, con un pulsante per il ripristino automatico

Posts your MT5 opens and closes to a Telegram chat: side, symbol, entry, stop and target in pips, lots, and on close the result, pips, R-multiple and time held. Retry queue, restart-safe, never trades. Free version of Trade Reporter Telegram and Discord.

Rileva i gap di fair value (squilibri di prezzo) su 3 candele e li rappresenta sotto forma di riquadri che rimangono visibili in tempo reale fino a quando il prezzo non torna a passare attraverso il gap. Il rilevamento viene eseguito solo su barre completamente chiuse, quindi i gap non appaiono e scompaiono intermittentemente mentre si forma la candela corrente.

Neural Loss-Pattern Auditor addestra una piccola rete neurale feed-forward, scritta da zero in MQL5 nativo, sulla cronologia delle operazioni chiuse per verificare se le caratteristiche comportamentali e relative al contesto di mercato consentano di prevedere quali operazioni abbiano una maggiore probabilità di generare perdite. Fornisce un miglioramento dell’accuratezza rispetto a una linea di base ingenua, una tabella di calibrazione delle probabilità, una classifica di importanza delle caratteristiche basata su permutazioni e un voto composito configurabile da A a F con raccomandazioni. Al primo avvio utilizza un conto demo sintetico integrato, quindi i risultati sono immediatamente visibili senza alcuna configurazione; è sufficiente impostare un parametro su InpUseDemoData=false per analizzare invece la cronologia di un conto reale. MQL5 puro: nessuna libreria esterna, nessun Python e nessun servizio di intelligenza artificiale di alcun tipo.

MQL5 port of a Pine Script ATR trailing-stop indicator: nLoss = ATR-multiple, the stop ratchets under price in an uptrend and over price in a downtrend, and flips (with a buy/sell arrow) when price closes through it. Includes a Python reference port and a parity test that checks both agree with a literal, bar-by-bar transcription of the Pine semantics (na/nz/series history).

A small demo Expert Advisor: EMA fast/slow cross entries (evaluated on closed bars only, no repainting), ATR-based stop-loss and take-profit, spread filter, and position handling that works on both hedging and netting accounts. Includes a Python reference implementation for parity testing. This is a deliverable example, not a trading recommendation - the attached equity curve is from synthetic data and shows the method, not an edge.

Time weighted average price of the running session, anchored at the cash open of Frankfurt, London, New York or Tokyo with automatic daylight saving. Every second counts the same, minutes without a tick carry the last price, and two bands show the time weighted standard deviation around the line.

Panel that samples the spread once per second and shows it in points and in the symbol's natural unit (pips on FX, index points on index CFDs), with rolling min/avg/median/max, a session statistic since server midnight, the spread as percent of ATR, a hold-time alert and an optional CSV log. It never sends an order.

Marks the Asian session range, signals when London or New York sweeps one side of it and reverses, and keeps a scorecard of how every past signal ended in R, spread included. Non-repainting, with buffers ready for an Expert Advisor.

An intraday Smart Money Concepts EA for gold. It waits for price to sweep a recent swing high or low, confirms the reversal with a close through the sweep candle's body, and trades only with the H1 trend. Backtested on XAUUSD M15 over 2025 and 2026 at 1% risk per trade.

Free risk-based position size calculator built specifically for Gold (XAUUSD). Enter your account balance, risk percentage, entry price and stop-loss price - the indicator calculates the exact lot size, risk amount, stop distance, risk/reward ratio and potential profit, and draws entry, stop and take-profit lines on the chart. Contract size is read automatically from the symbol specification, so it works on any gold symbol without manual setup.

Hull Moving Average indicator displaying four periods on a single chart, colour-coded by direction (green for rising, red for falling, grey for flat). Implemented with a ring buffer and incremental running-sum math, so memory and CPU use remain constant regardless of chart history length. Buffer layout is documented and stable, making the indicator suitable for use with iCustom() from EAs. Supports 2, 3, or 4 Hull lines depending on configuration.

Protect Your Funded Account with Institutional-Grade Risk Monitoring. The #1 reason traders fail prop firm challenges is not a bad strategy; it is breaching daily drawdown limits. The AlphaQuant Prop Firm Daily Drawdown Dashboard is a free, high-visibility Expert Advisor

A real economic-calendar news filter that also works in backtests. Export the events once with a script, then block new entries around news both live and in the Strategy Tester. Fixes the one-hour DST shift of historical calendar times.

Un pannello gratuito e di sola lettura per MetaTrader 5 che converte la regola di reset giornaliero della tua società di trading (impostata in base al fuso orario utilizzato dalla società) nell'ora effettiva del server del tuo broker, mostra un conto alla rovescia in tempo reale fino al prossimo reset e ti avvisa prima che il passaggio all'ora legale sposti il limite di un'ora. Non invia ordini, non legge dati del conto, è solo a scopo di visualizzazione.

Chiude un paniere di posizioni quando la perdita fluttuante raggiunge un limite impostato come importo fisso, percentuale del saldo o percentuale del capitale proprio. L’ambito di applicazione prevede filtri per simbolo o numeri magici, obiettivo di profitto opzionale e tentativi di esecuzione sicuri e non bloccanti.

Educational MT5 hedging-account trade panel with risk sizing, spread protection, a persistent daily-loss lock, break-even and trailing stops.

TREND Follower (Daily) is a lightweight, development-oriented Expert Advisor (EA) created as a base trading architecture for research, learning, experimentation, and further development. The EA is intentionally designed around a simple concept: follow the market direction using the relationship between price and the Parabolic SAR. It is not presented as a fully optimized or finished trading system. Instead, it provides a clean and accessible foundation that developers can study, modify, test, and expand.

Account-wide MT5 risk protection EA for prop-firm and personal accounts. Monitors daily and overall drawdown, position losses, safety buffers, and automatically protects the account when configured limits are reached.

Un oscillatore a finestra secondaria che contrassegna le barre di spostamento con scarsa partecipazione come "vuoti di liquidità" e assegna un punteggio da 0 a 100 in base alla rapidità con cui il prezzo riempie ciascuna di esse, distinguendo il rumore assorbito rapidamente dai livelli che continuano a fungere da vero supporto o resistenza.

Utilizzo della strategia ORB sul CFD di AAPL

Un pannello compatto integrato nel grafico che mostra l'andamento del simbolo corrente su diversi intervalli di tempo contemporaneamente, ciascuno valutato in modo indipendente con il proprio incrocio tra media mobile veloce e lenta. Non è più necessario passare da un grafico all'altro per verificare "come si sta comportando l'H4": tutto è riunito in un unico posto, con un codice colore.

Stima l'esponente di Hurst mobile del prezzo tramite l'analisi del range riscalato (R/S) e lo rappresenta graficamente sotto forma di oscillatore con codice cromatico che indica se il mercato sta attualmente seguendo un trend, se tende a tornare alla media o se si muove come un percorso casuale.

Spread histogram in a sub-window with current/avg/max/min stats, cost per trade, and threshold alerts for scalpers.

Educational MT5 EA: closed-bar EMA crossover entries, ATR-based stop loss and take profit, lot size from a fixed percent of equity via OrderCalcProfit, spread filter, magic-number isolation and server return-code checks. A clean template for building risk-controlled EAs. No profit claim.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207