Framework & template · MT5

MT5 Quant Lib

by xMattC

MT5 Quant Lib is an MQL5 development framework and an included trend-following Expert Advisor for MetaTrader 5.

GitHub stars7
Forks4
Last update4 months ago20 May 2026
LicenceNone stated

Overview

MT5 Quant Lib provides a modular infrastructure for trade execution, multi-symbol management, and risk control. The included strategy enters trades based on RSI triggers and CCI trend confirmation, utilizing trendline analysis and ATR bands for market structure. Risk management features include percentage-based position sizing and ATR-calculated stop loss and take profit levels. The system supports advanced backtesting with data splitting and custom optimization criteria. It includes tools for trailing stops and breakeven management for runner positions.

Details

Author

xMattC on GitHub

Type

Framework & template

Platform

MetaTrader 5 (MQL5)

Strategy

Trend following

Markets

Any symbol

Timeframes

Any timeframe

Risk profile

No grid, martingale or hedging logic was found in its code or README. That says nothing about how it performs: backtest it first.

Input parameters

Read from trend_following_ea.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
inp_lot_modeLOT_MODELOT_MODE_PCT_RISKMethod used for position sizing (e.g., fixed lot, or % risk)
inp_lot_vardouble2Lot value or risk percentage (depending on selected lot mode)
inp_sl_modeSL_MODESL_ATR_MULTIPLEStop Loss method (e.g., ATR-based, fixed value, etc.)
inp_sl_vardouble1.5SL parameter (e.g., ATR multiplier or fixed points)
inp_tp_modeTP_MODETP_ATR_MULTIPLETake Profit method (e.g., ATR-based, fixed value, etc.)
inp_tp_vardouble1TP parameter (e.g., ATR multiplier or fixed points)
inp_custom_criteriaCUSTOM_MAX_TYPECM_WIN_PERCENTCustom performance metric to use in OnTester()
inp_opt_min_tradesint0Minimum trades required to validate backtest result
inp_data_split_methodMODE_SPLIT_DATANO_SPLITMethod used to split data (e.g., train/test split)
inp_force_optint1Forces optimizer to call OnTester() even if not in training set
InpTrendlinePeriodint100Lookback period for moving average used in trendline
InpTriggerPeriodint14RSI period used to trigger entries
Show all 14 inputs
NameTypeDefaultDescription
InpConformationPeriodint50CCI period used for confirming trend direction
InpExitPeriodint5Stochastic period used to signal exits

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone xMattC/mt5-quant-lib from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
  3. 3Copy the filesCopy the .mq5 file into Experts, and any .mqh files into the Include folder the code expects.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar expert advisors

16 stars

This framework provides MQL5 header files and example expert advisors designed to trade on non-time-based Range Bar charts within MetaTrader 5. It includes template robots for moving average crossovers and Super Trend strategies. The included code manages trade execution with configurable stop loss, take profit, break-

MT5 Framework & template Indicator crossoverTrend following

Orchard Simple EA Template

by OrchardForexTutorials
13 stars

This collection provides educational templates for building MetaTrader 5 Expert Advisors. It includes demonstration robots that interface with indicators like MACD and Parabolic SAR using the iCustom function. The repository serves as a learning resource for structuring MQL5 code and handling trade execution. Each exam

MT5 Framework & template Indicator crossoverTrend following

New Robot

by andreolvgomes
10 stars

This MetaTrader 5 framework provides a modular structure for developing and deploying automated strategies, specifically optimized for the Mini Índice Bovespa. It includes an example implementation of the Dunnigan setup, utilizing candle sequences and price levels for entries. The system manages trades with advanced co

MT5 Framework & template BreakoutTrend following
Updated 5 years ago None stated GitHub repository of New Robot

Hedge Terminal

by SokolovVasiliy
3 stars

Hedge Terminal is a specialized framework for MetaTrader 5 designed to facilitate hedging net positions and provide a structured API for managing expert advisors. The repository includes demonstration robots such as a moving average expert that operates across multiple timeframes. These examples show how to open trades

MT5 Framework & template Indicator crossoverTrend followingHedging
Updated 6 years ago None stated GitHub repository of Hedge Terminal
2 stars

This MetaTrader 5 expert advisor acts as a modular architectural blueprint for developing complex algorithmic trading systems. It demonstrates a structured framework for separating user interface components, input configurations, and core execution logic into maintainable layers. While the repository provides placehold

MT5 Framework & template Trend followingGridHedging
2 stars

This MetaTrader 5 framework provides a modular library for technical analysis, including candle pattern detection, support and resistance levels, and Fibonacci calculations. The repository includes an expert advisor that implements ZigZag-based wave analysis to identify market structure and chart patterns. It features

MT5 Framework & template SMC / ICT / price actionTrend followingMartingale High risk

More frameworks and templates

Need a broker for MT5?

Compare regulated brokers that support MetaTrader, with spreads, minimum deposits and leverage side by side.

Compare brokers