Framework & template · MT4

MQ4 Expert Advisor Framework

by Hawkynt

This MetaTrader 4 expert advisor and modular framework provides advanced trade management and position scaling capabilities.

High risk

GitHub stars2
Forks1
Last update11 days ago11 Sep 2026
LicenceLGPL-3.0
Latest releasev202606093 months ago

Overview

MQ4 Expert Advisor Framework features a linear trailing stop that triggers at a predefined profit level and a pyramiding system to add positions to winning trades using a lot multiplier. The code is structured as a library-driven system, allowing for the integration of technical indicators like Moving Average crossovers and Parabolic SAR. It includes multiple risk management options, such as fixed lot sizing, equity percentage risk, and ATR-based stops. The architecture supports grid trading, though the primary example focuses on trailing stops.

Details

Author

Hawkynt on GitHub

Type

Framework & template

Platform

MetaTrader 4 (MQL4)

Strategy

Trend following, Indicator crossover, Grid, Mean reversion

Markets

Any symbol

Timeframes

Any timeframe

Risk profile

  • Opens a grid of orders: exposure builds up in a trend

Input parameters

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

NameTypeDefaultDescription
InitialTriggerPipsfloat15.0f
InitialPipsfloat5.0f
TrailingPipsfloat10.0f
PyramidPipsfloat20.0f
PyramidLotFactorfloat1.0f

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone Hawkynt/MQ4ExpertAdvisors from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL4/Experts.
  3. 3Copy the filesCopy the .mq4 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

Gartal Inc

by bsAmirHeydar
1 stars

Gartal Inc is a modular trading automation framework and strategy development template for MetaTrader 4. It provides a structured environment for testing various entry and exit logic, including Fair Value Gaps, moving average crossovers, and Donchian channels. The repository focuses on backtesting workflows, featuring

MT4 Framework & template SMC / ICT / price actionIndicator crossoverTrend following
Updated 3 months ago None stated GitHub repository of Gartal Inc

EA MQL4 Collection

by Yumerain
151 stars

This repository provides a diverse library of expert advisors and technical indicators for MetaTrader 4. The collection includes robots utilizing moving average crossovers, MACD trend-following signals, and mean-reversion strategies based on Bollinger Bands. A notable inclusion is a Martingale robot that scales lot siz

MT4 Collection Indicator crossoverTrend followingMartingale High risk
Updated 6 years ago None stated GitHub repository of EA MQL4 Collection
2 stars

This repository functions as a large collection of over 170 MetaTrader 4 expert advisors provided in source code format for further development. The library includes various automated trading robots based on popular technical indicators such as Heiken Ashi, RSI, Stochastic, and MACD crossovers. The included files utili

MT4 Collection Indicator crossoverTrend followingMean reversion High risk
7 stars

This MetaTrader 4 expert advisor provides a robust framework for developing automated trading strategies. It includes pre-built modules for trend detection using ADX and Moving Averages, alongside pullback entry logic. The template emphasizes risk management, featuring percentage-based lot sizing and adaptive volatilit

MT4 Framework & template Trend followingMean reversionMartingale High risk
Updated 5 years ago None stated GitHub repository of Falcon Trading Bot Template
4 stars

This repository is a collection of MetaTrader 5 expert advisors developed as early coding projects between 2021 and 2024. It includes multiple robots implementing varied strategies such as range breakouts, Donchian channels, Fibonacci retracements, and Bollinger Bands. The expert advisors are largely technical indicato

MT5 Collection Trend followingBreakoutMean reversion High risk

RemedyBot

by Uzochinny
3 stars

RemedyBot is a collection of Expert Advisors for MetaTrader 5 focused on technical indicator strategies. The primary files utilize the MQL5 standard library classes to combine trend-following signals, such as Moving Average crossovers, with volatility-based exits like the Parabolic SAR trailing stop. The project includ

MT5 Collection Trend followingIndicator crossoverMean reversion High risk
Updated 1 year ago None stated GitHub repository of RemedyBot

More frameworks and templates

Need a broker for MT4?

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

Compare brokers