Trading robot · MT4 · MT5

Persistent Anti

by EarnForex

Persistent Anti is a technical expert advisor for MetaTrader 4 and 5 that attempts to exploit the statistical persistence or anti-persistence of price trends.

GitHub stars12
Forks2
Last update1 year ago8 Aug 2025
LicenceApache-2.0
Latest release1.014 years ago

Overview

Persistent Anti analyzes a user-defined number of historical candles to determine if the market is currently repeating or reversing its previous directional movements. The robot then enters trades based on these findings, often taking a contrarian stance to anticipate reversals. It features fixed lot sizing or optional money management and allows users to reverse the logic entirely. Note that the EA lacks traditional stop loss and take profit parameters in its primary configuration.

Details

Author

EarnForex on GitHub

Type

Trading robot

Platform

MetaTrader 4 (MQL4) and MetaTrader 5 (MQL5)

Strategy

Mean reversion

Markets

Forex

Timeframes

H4 and above

Risk profile

  • Trades without a fixed stop loss

Topics

backtestexpert-advisorforexforex-robotforex-tradingmetatradermetatrader-4metatrader-5mql4mql5

Input parameters

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

NameTypeDefaultDescription
Nint10N: How many bars to lookup to detect (anti-)persistence?
Ratiodouble0.66Ratio: How big should be the share of (anti-)persistent bars?
ReversebooltrueReverse: If true, will trade inversely to calculated persistence data.
Lotsdouble0.1Lots: Basic lot size
MMboolfalseMM: Use money management?
Slippageint100Slippage: Tolerated slippage in points
MaxPositionSizedouble5.0MaxPositionSize: Maximum size to use
OrderCommentarystringPersisteneceAnti
Magicint2013041812

How to install it

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

EA31337 Libre

by EA31337
252 stars

EA31337 Libre is an open-source, multi-strategy trading robot for MetaTrader 4 and MetaTrader 5. It functions as a simplified implementation of the EA31337 framework, providing a collection of over 35 built-in strategies based on technical indicators. The expert advisor performs independent market analysis across vario

MT5 Trading robot Multi-strategyTrend followingMean reversion
Updated 1 year ago GPL-3.0 GitHub repository of EA31337 Libre

GridMaster Pro

by sajidmahamud835
129 stars

An automated MetaTrader 5 expert advisor that executes a bi-directional grid trading strategy. It uses the Average True Range (ATR) indicator to dynamically calculate grid spacing, allowing the system to adapt to current market volatility. The robot supports neutral, bullish, and bearish modes. It includes risk managem

MT5 Trading robot GridMean reversion High risk
Updated 5 months ago MIT GitHub repository of GridMaster Pro
52 stars

This MetaTrader 5 expert advisor serves as an educational example from a book on MQL5 programming. It implements a versatile trading system that can be configured to use moving average crossovers, Relative Strength Index levels, or both indicators combined for trade entries. The EA manages risk with user-defined stop l

MT5 Trading robot Indicator crossoverMean reversion
Updated 6 years ago None stated GitHub repository of Introduction MQL5 Book EA

Free Expert Advisor

by ersingencturk
35 stars

This MetaTrader 4 expert advisor is a scalper designed for the five-minute timeframe across several Forex pairs. It utilizes three strategies based on overbought and oversold market conditions to execute trades. Risk management features include a fixed hard stop loss, a virtual take profit and stop loss derived from an

MT4 Trading robot ScalpingMean reversion
Updated 9 years ago BSD-3-Clause GitHub repository of Free Expert Advisor

XAUUSD Forex Trader

by frkn2076
31 stars

This expert advisor for MetaTrader 4 focuses on gold trading using daily price extremes and moving averages. It calculates the 7-day Simple Moving Average and identifies the highest price points from the previous five trading days to determine market direction. The EA executes its logic on a five-second timer interval

MT4 Trading robot Mean reversionBreakout
Updated 5 years ago None stated GitHub repository of XAUUSD Forex Trader

Spike Trader

by EarnForex
29 stars

Spike Trader is a price action robot for MetaTrader 4 and 5 that identifies price spikes to trade market reversals. It monitors candle highs or lows relative to preceding bars and requires a specific percentage price jump and candle close position to trigger an entry. The EA enters trades in the opposite direction of t

MT4MT5 Trading robot Mean reversion
Updated 1 year ago Apache-2.0 GitHub repository of Spike Trader

More trading robots

Need a broker for MT4/MT5?

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

Compare brokers