Garch.mqh fits GARCH volatility models to a series of returns by maximum likelihood and forecasts the variance of the next periods. It gives the parameters with classic and robust standard errors, the log-likelihood with AIC and BIC, the conditional variance of every period, the persistence and the half-life of a shock. No DLL; the matrix type of MQL5 is used for the covariances.
#include <Garch\Garch.mqh>
double y[]; // returns, for example 100 * log(close[i] / close[i-1])
// ... fill y ...
CGarch g;
g.Model(GARCH_MEAN_CONSTANT, GARCH_VOL_GJR, GARCH_DIST_T);
if(g.Fit(y))
{
for(int i = 0; i < g.Parameters(); i++)
PrintFormat("%s %.5f (%.5f)", g.Name(i), g.Parameter(i), g.StdError(i)); // robust standard error
double variance[];
g.Forecast(20, variance); // variance of each of the next 20 periods
double half = g.HalfLife(); // periods for a shock to lose half its effect
} The script GarchExample.mq5 takes the returns of a symbol, fits the nine models with a constant mean, keeps the best by BIC and prints its parameters, the volatility now, the long-run volatility and the volatility expected over the next 1 to 60 periods, all in percent a year (picture 1). It can write the returns and the fitted volatility to a CSV file (picture 2).


Picture 3: every daily return of XAUUSDm with the band of two conditional standard deviations that the model gave for that day. The band widens after large moves and narrows again in calm months, which a constant volatility cannot do. 5.1% of the days fall outside it; the fitted GED expects 5.9%, a normal distribution 4.6%.

Picture 4: the returns minus their mean, divided by the volatility of the model for that day. With normal shocks they would follow the dashed curve. They do not: 49.7% of the days are within half a standard deviation (38.3% for a normal) and 1.45% beyond three (0.27% for a normal). The GED with shape 1.04 follows both the peak and the tails, which is why the GED models have the lowest BIC in picture 1.

108 fits (every mean, variance and distribution) on six series: three simulated, daily BTCUSDT, hourly XAUUSD and the daily results of a trading portfolio, compared with arch 8.0:
A fit of 2 000 returns takes 10 to 100 ms; the slowest, with a shape that goes to its bound, about 1.5 s.
Garch.mqh goes to MQL5\Include\Garch, GarchExample.mq5 to MQL5\Scripts\Garch.
Session Time Highlighter
Highlights the Asia, London and New York sessions and the London/New York overlap using real local time and daylight saving rules, so the session boxes are correct on any broker.
Order Watchdog - alerts on unknown magic, duplicates, no SL, stop outs (read-only)
Read-only watchdog for MT5: alerts on unknown magic numbers, duplicate positions after reconnects, missing SL, stop outs and what happened while it was off. Never trades.
VpsToolkit - safe order send and restart-safe state for VPS EAs
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.
CME equity index futures holiday calendar
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.