Trading robot · MT4

Gann Fan Bot

by AbasNiknam

This MetaTrader 4 expert advisor automates trading based on Gann Fan theory by identifying trend angles from recent swing highs and lows.

GitHub stars1
Forks0
Last update11 months ago8 Oct 2025
LicenceNone stated

Overview

Gann Fan Bot enters the market using buy and sell stop orders placed at specific distances from detected Gann lines. The robot includes risk management features such as fixed stop loss, take profit levels, and a daily position closure option. It supports multiple positions with predefined tiered lot sizes and limits the total number of open trades in each direction to control exposure.

Details

Author

AbasNiknam on GitHub

Type

Trading robot

Platform

MetaTrader 4 (MQL4)

Strategy

Trend following, Breakout, Hedging

Markets

Any symbol

Timeframes

M15-H1, H4 and above

Risk profile

  • Holds opposite positions at once

EA files

Input parameters

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

NameTypeDefaultDescription
intervalInputint4Interval in hours
StopOrderDistancedouble5Distance to Place Buy/Sell Stop Order
StopLossdouble100Distance to Place Stop Loss
TPdouble200Distance to Place TP
Lots1double0.01Lots1
Lots2double0.02Lots2
Lots3double0.03Lots3
Lots4double0.04Lots4
DistanceToCheckdouble135Distance to Check and Send New Order
MaxNumOfBuyint4Max allowed Num of Buy Position
MaxNumOfSellint4Max allowed Num of Sell Position
OnTickModeboolfalseOnTick or OnBar?
Show all 13 inputs
NameTypeDefaultDescription
CloseAtEndbooltrueClose Positions at End of Day

How to install it

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

Nyao Scalper

by elrizwiraswara
173 stars

Nyao Scalper is an automated scalping robot for MetaTrader 5 that utilizes a multi-factor weighted scoring system to identify trade opportunities. It evaluates trend alignment through EMA crossovers, momentum via RSI, and price action through wick rejection and candle body analysis. The EA manages risk with adaptive AT

MT5 Trading robot ScalpingTrend followingMartingale High risk
Updated 3 months ago BSD-3-Clause GitHub repository of Nyao Scalper

EA XAUUSD Premium

by diditgravatar
4 stars

This MetaTrader 5 expert advisor is designed for gold trading, utilizing a multi-timeframe strategy across the M15, H1, and H4 charts. It integrates technical indicators including ADX, RSI, and Moving Averages to identify trend-following and breakout opportunities. Risk controls include dynamic lot sizing based on acco

MT5 Trading robot Trend followingBreakoutGrid High risk
Updated 1 year ago None stated GitHub repository of EA XAUUSD Premium

Experienced FX Trader

by simonokwundue-ops
1 stars

This collection of Expert Advisors for MetaTrader 5 provides high-frequency scalping and multi-strategy automated trading across multiple currency pairs. The robots utilize a signal scoring system based on moving average crossovers, RSI momentum, Bollinger Band breakouts, and MACD signals. The suite includes a dedicate

MT5 Trading robot ScalpingBreakoutIndicator crossover
Updated 10 months ago None stated GitHub repository of Experienced FX Trader

Prem Gold Advisor

by Premkumar238
1 stars

Prem Gold Advisor is an automated MetaTrader 5 expert advisor specialized for XAUUSD (Gold) trading on the five-minute timeframe. It initiates trades using breakout levels placed at specific distances from the candle open. The strategy features a progressive scale-in mechanism, adding new orders as the price hits succe

MT5 Trading robot BreakoutTrend followingMartingale High risk
Updated 4 weeks ago None stated GitHub repository of Prem Gold Advisor

Phantom Edge

by tHeStRyNg
1 stars

Phantom Edge is a MetaTrader 5 expert advisor primarily designed for trading BTCUSD. It identifies entries using a combination of technical indicators, including RSI, MACD, and SMA, while validating setups through multi-timeframe analysis of M15 liquidity sweeps and M30 trend breaks. The EA features comprehensive trade

MT5 Trading robot Trend followingBreakoutHedging
Updated 1 year ago None stated GitHub repository of Phantom Edge

Box Breakout EA

by je-zhou
26 stars

This MetaTrader 5 expert advisor implements a box breakout strategy designed for the foreign exchange market. The robot identifies price ranges during specific time windows and enters trades upon a breakout. It features a trend filter using fast and slow moving averages to align entries with broader market direction. R

MT4MT5 Trading robot BreakoutTrend following

More trading robots

Need a broker for MT4?

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

Compare brokers