Mohamed-amine Baddir
Mohamed-amine Baddir
  • MT5 developer: gold and index EAs, testing tools at Independent MQL5 developer
  • Morocco
  • 2241
  • Information
no
experience
17
products
2
demo versions
0
jobs
1
signals
0
subscribers
MT5 developer: gold and index EAs, testing tools at Independent MQL5 developer
I build and sell MetaTrader 5 Expert Advisors for gold and stock indices, and the testing tools I use to check them.

Expert Advisors
- Quaterna: four strategies on gold and the Nasdaq 100 in one EA; two of them trade my own real account. https://www.mql5.com/en/market/product/208261
- Gemina: gold and USD/JPY, about 17 trades a year, stop loss and take profit on every trade. The same rules trade my own real account. https://www.mql5.com/en/market/product/206725
- IndexDip: S&P 500 and Nasdaq 100 dip buyer, daily trades with a hard stop. https://www.mql5.com/en/market/product/206105
- Gemina Signals and IndexDip Signals (free): the same trades on your chart, with alerts.

How I build them
- No grid, no martingale, no averaging down, no trade without a stop.
- The strategy settings are fixed inside the EA: what you test is what runs, and there is nothing to over-fit.
- Each EA is checked trade by trade in the Strategy Tester, with broker spreads, swaps and commission, before it is published.
- Try any of them free in your own Strategy Tester before you buy.

Tools for testing and risk
- Backtest vs Live and Trade Excursion Analyzer: why live results differ from the backtest, and where stops and exits belong
- Prop Risk Guard: daily loss and drawdown limits for prop-firm accounts
- TradeMirror: local trade copier between MT5 accounts
- Portfolio Allocator and Portfolio Backtest Combiner: lot sizes and the combined result of several EAs
- Free: Account Performance Report, Trade History to Excel, Monte Carlo Risk Simulator, Optimization Robustness Map, Backtest Report Compare, Hourly Volatility Profile
Free 30-day trials of TradeMirror and Prop Risk Guard (demo accounts only): https://drive.google.com/drive/folders/1S8yw6vxnkrEWOI_YIC2_c4wetn3SeMIF
Free libraries in the CodeBase: GARCH, cointegration, Kalman filter, data snooping tests and more.

Custom work
I turn written rules or TradingView scripts into clean MT5 Expert Advisors, fix existing EAs (risk sizing, session and spread filters, drawdown guards, multi-symbol portfolios) and audit strategies with walk-forward tests, with a straight answer on whether the results are likely to hold up. Every delivery includes the .mq5 source, the .ex5, a .set preset and a backtest report. I confirm the full specification in writing before I start.
Mohamed-amine Baddir
Published code DataSnooping: SPA test, Reality Check, StepM and model confidence set
Is the best of many strategies really better than the benchmark? Hansen's SPA test, White's Reality Check, Romano-Wolf StepM and the model confidence set.
Mohamed-amine Baddir
Published code Cointegration: ADF, Engle-Granger and Johansen tests with a pair scanner
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.
Mohamed-amine Baddir
Published code Kalman: exact diffuse Kalman filter, local level and time-varying hedge ratio
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.
Mohamed-amine Baddir
Published code RegimeHMM: market regimes with a hidden Markov model
Gaussian hidden Markov model fitted by Baum-Welch: regime probabilities without look-ahead, most likely path, expected durations and regime forecasts.
Mohamed-amine Baddir
Published code Garch: GARCH, GJR-GARCH and EGARCH volatility models with forecasts
Fits GARCH(1,1), GJR-GARCH and EGARCH with normal, Student t or GED shocks by maximum likelihood, with robust standard errors and variance forecasts.
Mohamed-amine Baddir
Published code BacktestOverfitting: probability of backtest overfitting (PBO) of an optimization
Probability of Backtest Overfitting (PBO) of an MT5 optimization by combinatorially symmetric cross-validation. Every pass sends its daily results as a frame, and the PBO is computed when the optimization ends.
Mohamed-amine Baddir
Published code DrawdownBootstrap: Monte Carlo of the maximal drawdown
Block bootstrap of daily results: how deep the drawdown of an account or strategy can get over the next months, with percentiles and a seeded generator for repeatable runs.
Mohamed-amine Baddir
Published code PortfolioWeights: risk parity, HRP, minimum variance and maximum diversification
Portfolio weights from the returns of symbols or Expert Advisors: inverse volatility, risk parity, hierarchical risk parity, minimum variance, maximum diversification, Ledoit-Wolf covariance.
Mohamed-amine Baddir
Published code TesterReport: read a saved Strategy Tester report into deals and trades
Reads a Strategy Tester report saved as HTML into its deals, closed trades, net profit and balance drawdowns, for comparing, combining or exporting backtests.
Mohamed-amine Baddir
Published code Live Test Bench: automated checks of an EA on a demo account
Automated checks of an Expert Advisor on a live demo chart (restart, second copy, server history, chart button) with a PASS/FAIL report.
Mohamed-amine Baddir
Published code AttachExpert: attach an EA with inputs to a chart from code
AttachExpert.mqh attaches an Expert Advisor to a chart from MQL5 code, with the inputs you choose and with "Allow Algo Trading" on or off.
Mohamed-amine Baddir Published product

Portfolio Allocator tells you how many lots each Expert Advisor of a portfolio should trade. It reads one saved Strategy Tester report per Expert Advisor, or the history of an account that runs several of them (one strategy per magic number), and computes the allocation with eight methods: from equal risk and risk parity to hierarchical risk parity, maximum diversification, maximum Sharpe and minimum tail loss. Then it scales the whole portfolio to the drawdown you accept, and shows with a

Mohamed-amine Baddir
Published code TesterStats: Strategy Tester report statistics in MQL5 code
Calculates the Strategy Tester report statistics from the deal history, including Z-Score, AHPR, GHPR, LR Correlation and LR Standard Error, which TesterStatistics() does not return. Checked value by value against the tester.
Mohamed-amine Baddir
Published code XlsxWriter: Excel .xlsx files from MQL5 without DLL
An include file that writes real Excel workbooks (.xlsx) from MQL5 without DLLs: several sheets, numbers, text and real Excel dates, a frozen bold header and filters. Example script: the account deals and the daily results to Excel.
Mohamed-amine Baddir Published product

Backtest vs Live explains why an Expert Advisor earns a different amount live than in the Strategy Tester. It matches every live trade with its twin in the backtest, then splits the whole difference of the results, to the cent, into entry prices, exit prices, swap and commission, lots and currency conversion, trades the backtest made that live trading missed, and live trades the backtest never made. It can also compare two backtests, for example the same Expert Advisor with and without execution

Mohamed-amine Baddir Published product

Monte Carlo Risk Simulator shows how much worse a backtest could have gone with the same trades in a different order, and what more or less risk per trade does to its growth and drawdown. It reads saved Strategy Tester reports or the history of your account, runs thousands of simulations and writes one HTML page. How To Use Backtests: in the Strategy Tester, right click on the Backtest tab > Report > save it as HTML into MQL5\Files\RiskSimulator (File > Open Data Folder). Account: set

Mohamed-amine Baddir Published product

Trade History to Excel turns saved Strategy Tester reports, or the trading history of your account, into a real Excel workbook (.xlsx). Every report goes into the same file: one summary row per report, every closed trade with its entry and exit price, every deal, and the results of each day and month with the balance. Dates are Excel dates, numbers are numbers, the header row is frozen and every sheet has filters, so you can sort, filter, build pivot tables and charts right away. How To Use

Mohamed-amine Baddir Published product

Optimization Robustness Map reads the results of a Strategy Tester optimization and shows whether the best pass sits on a plateau, where nearby inputs give similar results, or on a lone spike that a small change destroys. It draws a heat map of any two inputs, compares every pass with its neighbours, shows how each input moves the result and, when a forward period was tested, how well the back test predicted it. Everything is written to one HTML page. How To Use In the Strategy Tester, after an

Mohamed-amine Baddir Published product

Trade Excursion Analyzer measures how far every closed trade went against you (maximum adverse excursion, MAE) and in your favour (maximum favorable excursion, MFE) before it closed. It reads saved Strategy Tester reports or the history of your account, measures each trade on the price history of your terminal and writes one HTML page: where your stop-loss could be, how much open profit your exits give back, and what a fixed stop-loss or take-profit would have changed. How To Use Backtests: in

Mohamed-amine Baddir Published product

Backtest Report Compare puts several Strategy Tester reports side by side on one HTML page: growth and drawdown curves on one chart, the main statistics in one table, the correlation of their daily results, monthly returns and results by weekday and hour. Use it to choose between Expert Advisors, between settings of one Expert Advisor, or to see which strategies lose on the same days. How To Use In the Strategy Tester, after each test: right click on the Backtest tab > Report > save it as

123