Loading…

Initial Balance Extension System

Initial balance trading is a well-known futures-pit technique: the first period of a trading session (classically the first hour) sets a high/low range, and a later break of that range is traded as the start of a trend day, with the range's own width used to scale the target. It is a genuine, published idea, but naive ports usually hardcode the target multiple (commonly "1x the IB range") without ever checking whether that number fits the instrument or timeframe they are running on. This EA instead measures the day-type statistic itself. Once a day's IB window closes, it scans up to InpStatsLookbackDays of the chart's own recent history, and for each completed day computes how far price actually extended beyond that day's own IB relative to the IB's own range. The average of those ratios - clamped between InpTargetMinMultiple and InpTargetMaxMultiple - becomes the target multiple used for that day's breakout trade. The target adapts to the symbol and timeframe it is attached to instead of assuming one constant. Forex has no single opening bell, so "session start" here is simply a server-time hour you choose - point it at the open of whichever session you treat as the day's reference (London or New York open in your broker's server time are common choices). The stop sits on the opposite side of the IB range, widened only as far as InpMinStopPips or the broker's own minimum stop distance requires. Notes and limitations - One trade per calendar day, taken on the first confirmed bar close outside the IB range once the IB window has finished forming. - The day-type statistic needs real history to be meaningful - with fewer than InpStatsLookbackDays completed days available, the target multiple falls back to InpTargetMinMultiple, the conservative bound. - "Session start" is a plain server-time hour, not a true exchange open; different brokers run different server time zones, so the same input value points at a different real-world time depending on broker. - Day boundaries are calendar-date based on server time; a day with a gap in bar data (holiday, feed outage) can produce a thin or missing IB for that day, which is simply skipped rather than estimated. - No news or spread filter - add one if breakout entries trade through conditions you would rather avoid.

Expert advisor · MT5 · v1.0 · Free

About Initial Balance Extension System

Initial Balance Extension System is an expert advisor (trading robot) for MetaTrader 5. It trades only in the hours you set (time filter). It has 11 settings, such as Session start hour, Ib minutes and Stats lookback days. MQL source code included.

Files in the download: InitialBalanceExtension.ex5, InitialBalanceExtension.mq5, InitialBalanceExtension.txt.

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

Settings

SettingDefaultWhat it does
Session start hour8Session start hour, broker/server time (0-23)
Ib minutes60Initial balance window length, minutes
Stats lookback days20Past days used to measure the average IB extension ratio
Target min multiple0.5Minimum allowed target multiple of the IB range
Target max multiple3.0Maximum allowed target multiple of the IB range
Min stop pips15Minimum stop distance enforced beyond the opposite IB side
Fixed lots0.10Fixed lot size
Magic number20260364Magic 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 5 open File → Open Data Folder, then go to MQL5 → Experts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 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: Trend · Trading Sessions · Time Filter · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria