La libreria di script è inoltre disponibile direttamente dall'ambiente di sviluppo MetaEditor per permetterti di imparare la programmazione in MQL5. Una volta scritta e controllata accuratamente, una libreria permette agli utenti di accelerare lo sviluppo di nuove applicazioni MQL5. Uno degli esempi illuminanti è la libreria ALGLIB che contiene molteplici funzioni di analisi numerica.
I codici sorgente della libreria possono essere scaricati e utilizzati in MetaEditor durante lo sviluppo di strategie di trading. Non possono essere lanciati separatamente in MetaTrader 5.
Consenti l'uso dei cookie per accedere al sito MQL5.com.
Abilita le impostazioni necessarie nel browser, altrimenti non sarà possibile accedere.
Hai effettuato l'accesso. L'autenticazione a due fattori è stata disattivata. Configurala di nuovo e scansiona un nuovo codice QR, oppure continua con l'autenticazione a due fattori disattivata.
Attiva l'autenticazione a due fattori ContinuaA library for MetaTrader 5 that declares rules between the inputs of an Expert Advisor once in the code. OnInit rejects a combination that breaks a rule, with the reason in the Journal; before an optimization starts, OnTesterInit estimates which share of its passes the rules would reject and warns above a limit you set.
One include file that encrypts texts and bytes so only a program with the same key can read them. A wrong key or a changed message is refused instead of read as garbage, keys can come from a password, and the code is checked against the official NIST and RFC test vectors.
One include file that gives your EA or indicator keyboard shortcuts the user types into the inputs, such as Shift+B. Each press fires one action, Shift+B never fires on a plain B, and a shortcut that cannot work is refused at start with the reason.
Watches the equity like a prop firm does: daily loss limit and max loss limit, static or trailing, floating profit included. Stops new trades at a warning level, closes everything on a breach and remembers it after a restart.
Draws a live heatmap of two optimised inputs while the Strategy Tester optimises your EA, and scores every cell by its neighbourhood: the plateau score is the mean minus k times the standard deviation of the surrounding cells. It shows whether your best parameters sit on a stable plateau or on a single lucky cell, and writes an HTML report, a CSV and a picture of the map. Includes a Monte Carlo drawdown criterion and a small demo EA. Part of the free Robustness Lab set.
Builds H2 to D1 candles from H1 on the New York close clock, so your indicators see the same candles on every broker, no matter which server time it uses. Detects the server clock automatically.
One call before you send an order: is the session open, how long until it closes, are quotes still coming in, is trading allowed. Gives you the reason when the answer is no.
Una libreria composta da un unico file che gestisce le modalità di trading di un EA: controlli pre-negoziazione, normalizzazione rispetto ai limiti del broker, riprovazioni sicure, un ordine per ogni segnale, isolamento tramite "magic number" e ripristino dello stato dopo un riavvio. Include lotti in base al rischio, limite di perdita giornaliero e soglia minima di capitale proprio. Verificata nello Strategy Tester.
A library for MetaTrader 5 that checks every trade request of an existing Expert Advisor in the Strategy Tester, with one include line and no other change. Volume, stops level, freeze level, margin, trade mode and the order limit are checked; the request then goes out unchanged, and the Journal and a CSV list each violation with the file and line that sent it.
Rilevamento in tempo reale delle variazioni della media o della volatilità (Adams-MacKay): probabilità di una variazione nelle ultime k barre, lunghezza attuale del segmento, previsione e indicatore.
Adatta cinque copule bivariate sui ranghi, con il tau di Kendall, la dipendenza delle code, la probabilità di giorni estremi congiunti, l’AIC e le probabilità condizionali di trading a coppie.
Include file with small functions to find the Gotobi days: the 5th, 10th, 15th, 20th, 25th and the last day of each month, moved back to the previous business day when they fall on a weekend or a holiday you list. Information only, no trading functions.
A library for MetaTrader 5 that puts trade management code behind an interface and tests it against a fake broker, without a trade server. The fake checks stops level, freeze level, tick grid and volume step, answers with retcodes chosen by the test and logs every request. An example break-even rule and 26 test cases come with it.
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.
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.
La migliore tra tante strategie è davvero superiore al benchmark? Il test SPA di Hansen, il Reality Check di White, lo StepM di Romano-Wolf e l’insieme di confidenza del modello.
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.
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.
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.
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.
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.
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.
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".
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.
Converts broker server time to UTC and New York time with US and EU daylight saving rules. Works the same live and in the Strategy Tester, where TimeGMT() returns server time.
Minimal include file to license your own EAs and indicators: allowed account numbers, expiry date, demo-only trial mode and broker server filter. Example EA included.
Persistent MQL5 outbox with a Telegram demo and offline tests. An uncertain result is never retried automatically. Manual retry may duplicate a message; SENT means API acceptance, not a read receipt.
Gestisci le posizioni aperte in un Expert Advisor: break-even, trailing stop, due chiusure parziali e uno stop e un target per le posizioni che non ne hanno. Non apre mai un’operazione.
A stop distance in points is not money until the tick size and tick value make it one. This library turns four risk bases into a lot size, floors it to the volume step, caps it against free margin and tracks a daily loss limit. Two MQL5 headers, no DLL.
Exact maximum likelihood of an Ornstein-Uhlenbeck spread and Bertram's optimal entry and exit levels for a given cost, with the expected length of a trade cycle.
A lightweight tab bar for chart panels, drawn with the standard CCanvas class. One include file, several independent instances per chart, click selection, resizing and safe cleanup. Includes a demo Expert Advisor.
Parkinson, Garman-Klass, Rogers-Satchell and Yang-Zhang estimators, daily realized and bipower variance from intraday bars, and HAR volatility forecasts.
Five tests to tell a random walk from a mean-reverting series: KPSS, Phillips-Perron, DF-GLS, Zivot-Andrews with the break date, and the variance ratio.
Detects the broker's GMT offset and its daylight-time rule (fixed, US or European) from the weekly closes in the H1 history, the same way live and in the Strategy Tester, with functions that convert New York times to server time and back.
Unit root and cointegration tests (ADF, Engle-Granger, Johansen) with MacKinnon p-values, hedge ratio, half-life and z-score of the spread, and a pair scanner.
Kalman filter and smoother with an exact diffuse start, missing values and maximum likelihood: local level, local linear trend and a regression whose hedge ratio drifts.
Gaussian hidden Markov model fitted by Baum-Welch: regime probabilities without look-ahead, most likely path, expected durations and regime forecasts.
Holidays and early halts of the CME equity index futures (S&P 500, Nasdaq-100, Dow, Russell 2000, E-mini and Micro), computed from the US holiday rules for any year, with a script that checks the calendar against your broker's own M1 history.
Include for EAs running 24/7 on an MQL5 VPS or PC: run-where switch, order send with OK/FAIL/UNKNOWN result (no duplicate orders after a timeout), restart-safe counters, positions closed while the EA was off, append-only log and optional Telegram. No trading logic inside.