Loading…

IBS Reversion System

Internal Bar Strength is IBS = (Close - Low) / (High - Low) on a closed bar, expressed here as 0-100. It is a well-documented published effect: in US equity index data, a bar that closes near its low (low IBS) tends to be followed by a bounce, and a bar that closes near its high (high IBS) tends to be followed by a pullback. The published research behind it is specifically about daily equity index bars, where overnight and session-open mechanics create the asymmetry. Forex has no single exchange, no overnight specialist book and a far flatter session structure than an equity index, so there is no guarantee the same effect transfers to a currency pair, or to a timeframe other than daily. This EA does not pretend otherwise: it measures IBS on the closed bar of whatever chart it is attached to and trades the rule as published, so you can test honestly whether the effect holds on your instrument and timeframe rather than assuming it does. A position is closed on a timed exit after InpHoldBars bars regardless of profit or loss, since a reversion trade that has not reverted inside the expected window is assumed wrong rather than left open on hope. Optional fixed pip stop and target are also available. Notes and limitations - IBS is a documented equity-market effect. Nothing about this build proves it holds on forex - it implements the rule honestly so you can test that for yourself, and the source header repeats this caveat. - One position at a time, tracked by InpMagicNumber only. - Signals are evaluated once per closed bar, not on every tick. - A flat bar (High equals Low) has no directional information and is treated as neutral (IBS 50) rather than dividing by zero. - No news, spread or session filter - add one if the raw signal trades through conditions you would rather avoid.

Expert advisor · MT4 · v1.0 · Free

About IBS Reversion System

IBS Reversion System is an expert advisor (trading robot) for MetaTrader 4. It has 11 settings, such as Low threshold, High threshold and Trade short side. MQL source code included.

Files in the download: IbsReversionSystem.ex4, IbsReversionSystem.mq4, IbsReversionSystem.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Low threshold20Buy when IBS of closed bar is below this (0-100 = IBS*100)
High threshold80Sell when IBS of closed bar is above this (0-100 = IBS*100)
Trade short sidetrueAlso take the symmetric sell/high-IBS side
Hold bars5Maximum bars to hold a position before a timed exit
Stop loss pips60Stop loss distance, in pips (0 = none)
Take profit pips0Take profit distance, in pips (0 = none - rely on timed exit)
Fixed lots0.10Fixed lot size
Magic number20260344Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria