Framework & template · MT4

Falcon Trading Bot Template

by JoeG777

This MetaTrader 4 expert advisor provides a robust framework for developing automated trading strategies.

High risk

GitHub stars7
Forks5
Last update5 years ago28 Dec 2020
LicenceNone stated

Overview

Falcon Trading Bot Template 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 volatility scaling. Users can configure fixed or ATR-based stop loss and take profit levels. Additional exit mechanisms include trailing stops, breakeven buffers, and time-based exits after a specific number of bars. It is designed as a foundational codebase for MQL4 developers.

Details

Author

JoeG777 on GitHub

Type

Framework & template

Platform

MetaTrader 4 (MQL4)

Strategy

Trend following, Mean reversion, Martingale

Markets

Any symbol

Timeframes

Any timeframe

Risk profile

  • Uses martingale lot scaling: losses can grow fast

Input parameters

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

NameTypeDefaultDescription
Header1string----------Trading Rules Variables-----------
lookbackPeriodADXint14
ADXThreshdouble20
trendThreshint35
lookbackPeriodMAint200
validBarsint10
Header2string----------Position Sizing Settings-----------
Lot_explanationstringIf IsSizingOn = true, Lots variable will be ignored
Lotsdouble0.01
IsSizingOnboolFalse
Riskdouble1Risk per trade (in percentage)
MaxLotsAlloweddouble20Per Order
Show all 40 inputs
NameTypeDefaultDescription
MinFreeMarginPerLotdouble1500Note: 1000USD of margin required to open a 1 lot of EURUSD on a 100:1 leverage.
IsAdaptiveVolSizingOnboolFalseSwitch for our adaptive volatility function
IsAdaptiveHRSizingOnboolFalseSwitch for our adaptive hit rate function
Header3string----------TP & SL Settings-----------
UseFixedStopLossboolTrueIf this is false and IsSizingOn = True, sizing algo will not be able to calculate correct lot size.
FixedStopLossdouble0Hard Stop in Pips. Will be overridden if vol-based SL is true
IsVolatilityStopOnboolTrue
VolBasedSLMultiplierdouble3.0Stop Loss Amount in units of Volatility
UseFixedTakeProfitboolTrue
FixedTakeProfitdouble0Hard Take Profit in Pips. Will be overridden if vol-based TP is true
IsVolatilityTakeProfitOnboolTrue
VolBasedTPMultiplierdouble3.0Take Profit Amount in units of Volatility
Header4string----------Breakeven Stops Settings-----------
UseBreakevenStopsboolFalse
BreakevenBufferdouble0In pips
Header5string----------Trailing Stops Settings-----------
UseTrailingStopsboolFalse
TrailingStopDistancedouble0In pips
TrailingStopBufferdouble0In pips
Header6string----------Volatility Trailing Stops Settings-----------
UseVolTrailingStopsboolFalse
VolTrailingDistMultiplierdouble0In units of ATR
VolTrailingBuffMultiplierdouble0In units of ATR
Header7string----------Time Based Stop (Exit)-----------
UseTimeBasedExitboolFalse
exitAfterBarsint7
Header8string----------Volatility Measurement Settings-----------
atr_periodint14

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone JoeG777/MT4_Forex_Trading_Bot_Template 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.
  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

2 stars

This MetaTrader 4 expert advisor and modular framework provides advanced trade management and position scaling capabilities. It 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 librar

MT4 Framework & template Trend followingIndicator crossoverGrid High risk

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

FX Git Collection

by dennislwm
101 stars

This repository contains a diverse collection of MetaTrader 4 expert advisors and R-based financial scripts. The primary robot is based on the Nanningbob trading system, which utilizes multi-timeframe analysis across daily and four-hour charts to identify trends and ranging markets. It employs Bollinger Bands for mean-

MT4 Collection Trend followingMean reversionMartingale High risk
Updated 5 years ago None stated GitHub repository of FX Git Collection
19 stars

This MetaTrader 4 repository contains a collection of expert advisors, primarily focused on the MultiTrader dashboard and various technical utility robots. MultiTrader functions as a multi-symbol management tool that monitors dozens of currency pairs simultaneously, using high and low percentage levels for trade execut

MT4 Collection Multi-strategyTrend followingMean reversion High risk
Updated 7 years ago None stated GitHub repository of MQL4 MultiTrader Collection

Support Resistance EA

by jblanked
11 stars

This MetaTrader 4 expert advisor executes trades based on a combination of Relative Strength Index and Moving Average indicators to identify key entry levels. It includes multiple order management features such as a trailing break-even stop and a four-stage partial profit-taking system. Risk management is handled throu

MT4 Trading robot Trend followingMean reversionMartingale High risk
Updated 3 years ago None stated GitHub repository of Support Resistance EA

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