Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
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

Gestione degli ordini, degli ordini esistenti, degli ordini con limite di prezzo, degli ordini trailing, del break-even e del calcolatore della dimensione del lotto in un unico strumento

Un piccolo Expert Advisor didattico per MetaTrader 5 che illustra un modo semplice per combinare i classici mattoncini Renko a dimensione fissa con uno stato di tendenza in stile SuperTrend.

A port of the Olsen group's Alpha Engine: eight limit-order agents trade intrinsic-time directional changes on a hedging account. They add on overshoots and trim at a profit on reversals.

Mirrors trades opened, modified, and closed by another EA on the same hedging account, selected by magic number. By default it inverts direction (Buy↔Sell, SL↔TP), so you can forward-test the reverse of a strategy with real spreads, slippage, and execution.

A free open-source MT5 utility for analyzing historical trading performance beyond Profit Factor.

Un calcolatore di rischio MT5 trascinabile che converte la distanza di entrata e lo stop selezionati in una dimensione della posizione normalizzata dal broker, utilizzando la dimensione del tick, il valore del tick e il rischio del conto.

Indicatore MT5 gratuito che traccia automaticamente i livelli di Fibonacci su più intervalli di tempo ed evidenzia le zone di confluenza, la struttura di mercato, le aree di premio/sconto e le reazioni chiave dei prezzi.

Shows where stops are likely resting and which ones were just taken. Liquidity pools = confirmed swing highs and lows that price has not traded through yet, equal highs/lows (a bigger pool) and yesterday's high and low. When a bar trades beyond a pool it is marked as swept, and as "grabbed & rejected" if the same bar closes back inside. Non-repainting: a swing is used only after N closed bars on each side. The panel is a neon city drawn on a CCanvas: the price is a flying car, sell stops are towers below it, buy stops floating platforms above it, yesterday's levels golden billboards, a searchlight sweeps the sky and a ticker runs today's catch. Two buffers give the nearest active pool above and below for use in an Expert Advisor. Indicator only: it never trades.

Measures whether an indicator repaints instead of trusting the claim. It re-reads the buffers of any custom indicator on bars that have already closed and counts every value that changes, appears or disappears, with the furthest shift back at which that still happens. Verdict per buffer on a chart panel, every event written to CSV.

Tests whether live closing deals still match the backtest of an Expert Advisor. A bootstrap-calibrated CUSUM detector raises an alarm and estimates when the drift began, a two-window check separates a short dip from a lasting decline, and an expectancy decomposition shows whether the win rate or the trade sizes changed. The script generates demonstration data on the first run and is written in pure MQL5.

A free, fully open EA: buy GBPJPY every Monday at 11:00 server time (04:00 New York), close at 23:00. Stays profitable in backtest with the entry anywhere from 09:00 to 13:00. Attach to GBPJPY M1.

Quickly view each and every individual market's open and close times. Very important for short term scalping. I own the copyright, if anyone modifies or uses this it must stay free. Comments and feedback welcome.

Calcola un inviluppo di Nadaraya-Watson senza aggiornamento in tempo reale utilizzando la smussatura gaussiana e contrassegna con delle frecce i punti in cui il prezzo supera le bande superiore e inferiore.

Un indicatore leggero per i grafici MT5 che mostra in tempo reale le specifiche di trading relative al broker e al simbolo, tra cui spread, dimensione del tick, valore del tick, limiti di volume, livello di stop e livello di congelamento.

Shows the real spread for each server hour, measured from your broker's own tick history: median and 90th percentile per hour, optional cost as a share of your stop and per lot, and CSV export.

A chart panel that shows the contract specification details that decide position size and trading cost (point value, spread cost, margin, swap, execution rules) in the account currency, warns about broker settings that silently break lot-size code, and exports the audit of every Market Watch symbol to CSV.

Rileva automaticamente i punti di svolta e contrassegna sul grafico un conteggio delle onde di Elliott convalidato in base alle regole (impulso 1-2-3-4-5 e correzione A-B-C), con un pannello informativo sui livelli di Fibonacci. A titolo puramente indicativo: confermare sempre manualmente.

Indica l'inizio e la fine di un massimo di tre sessioni di negoziazione (asiatica, londinese, newyorkese o qualsiasi intervallo personalizzato) tramite separatori verticali e/o riquadri con sfondo ombreggiato, ripetuti quotidianamente su un intervallo di dati recenti a scorrimento. È una funzione puramente visiva: nessun calcolo, nessun segnale, solo confini chiari delle sessioni.

H1 indicator that combines support/resistance confluence from H4, D1 and W1 with EMA trend alignment and candlestick confirmation. Shows non-repainting BUY/SELL arrows with ATR-based stop and reward/risk filtering.

Script that lists the global variables of the terminal with value, last access time and age, filtered by prefix, substring and age. It exports them to CSV, deletes the matching ones after a confirmation and a backup, and restores them from a CSV file.

Tracks changes to 18 broker contract properties against a saved baseline, with before and after values, a chart panel and a local CSV audit trail.

The Adaptive Kalman Trend Filter smooths price fluctuations to highlight the underlying market trend, adapting its responsiveness as market conditions change.

Il MACD adattivo è un indicatore di momentum dinamico che regola il proprio livellamento in base alle condizioni di mercato. Calcola il coefficiente di correlazione di Pearson tra il prezzo e l’indice delle barre su un periodo definito dall’utente, quindi utilizza l’R² risultante per combinare due diverse serie di coefficienti MACD. Ciò rende la linea MACD più reattiva durante i trend forti e più regolare nei mercati laterali. L’indicatore traccia un istogramma con codice colore (forte/debole, rialzista/ribassista) e una linea MACD con contrasto automatico opzionale che si adatta allo sfondo del grafico. I parametri di input consentono di personalizzare il periodo R², le lunghezze delle linee veloce e lenta, il periodo del segnale e i colori. Adatto al trading di tendenza e all’individuazione dei cambiamenti di momentum.

Struttura di mercato e Smart Trade Tracker (MT5) Un indicatore avanzato "tutto in uno" basato sul concetto di Smart Money (SMC) che combina la mappatura automatizzata della struttura di mercato, le candele con heatmap del momentum e il monitoraggio dell'esecuzione delle operazioni da parte degli investitori istituzionali.

Open-source EURUSD Expert Advisor for MetaTrader 5 Strategy Tester, based on RSI exhaustion signals, ATR-based exits and volatility-adjusted spread filtering.

ZoneUS30 is a simple US30 Expert Advisor focused on SELL opportunities after upward price extensions. The strategy combines a mean-reversion concept with a carry-trade idea: when short positions receive positive overnight swap, the EA can benefit both from a price correction and from holding the position over time. Designed for US30 and intended for experimental and educational use. Counter-trend trading involves significant risk, especially with high lot sizes.

iFVG Indicator With Signals

"Support Resistance zig zag based" è un indicatore di Price Action progettato per tracciare in modo automatico e dinamico sul grafico i livelli di supporto, resistenza e le aree di transizione (Flip Zones). Si concentra esclusivamente sulla rappresentazione chiara della struttura dei prezzi e sull’evidenziazione delle principali aree di rimbalzo (SBR e RBS). Include inoltre un pannello di controllo interattivo per monitorare in tempo reale l’andamento del mercato.

Verifica se un indicatore grafico viene aggiornato, anziché affermare che ciò non avvenga. L'invariante: una volta che una barra si è chiusa ed è stata elaborata, nessun oggetto disegnato su di essa può mai cambiare: non può spostarsi, cambiare colore, modificare il proprio testo né scomparire. Lo script genera un simbolo personalizzato con dati storici reali, associa il tuo indicatore tramite un modello, registra ogni oggetto, aggiunge le barre, forza un ricalcolo completo e confronta oggetto per oggetto. Le modifiche e le sparizioni vengono conteggiate separatamente, poiché solo una modifica implica che l’affermazione sia falsa. Un’esecuzione che non ha rilevato alcuna differenza viene segnalata come INCONCLUSIVA, mai come superata. L’output è un file CSV che è possibile pubblicare accanto al numero.

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.

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 guard for prop firm accounts. Watches every position on the account, closes everything at the daily or maximum loss limit, caps the money at risk per position, closes trades left without a stop and can flatten around high impact news.

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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208