Loading…

Multi Symbol Tester Driver

The MT4 Strategy Tester advances exactly one symbol's clock. A rule that genuinely needs a second symbol's own trend or price ("buy EURUSD only when GBPUSD agrees") cannot read that second symbol's history reliably inside the tester - other symbols are not guaranteed to have their history loaded during a test run, and even when data happens to be present, it is not time-aligned to the driver symbol's own bar clock, so naive multi-symbol EAs frequently either fail outright in the tester or silently test against stale or misaligned data without any warning. This EA solves it by never asking the tester for a companion symbol's price at all. Instead, each companion's aligned close series is pre-exported to a plain two-column CSV (bar time, close) BEFORE the test run, using any script that walks the companion symbol/timeframe's own history outside the tester. This driver EA loads that file once in OnInit and, for each driver-symbol bar, looks up the companion's value by an EXACT time match via binary search - not by row position, which would silently drift out of alignment the moment a companion symbol has a session gap the driver symbol does not share. A bar with no exact companion row is treated as "no data this bar" and excluded from the vote, rather than guessed at with a nearest-neighbour value. The bundled trading rule is intentionally simple - buy when every loaded companion's own trend over InpTrendLookback bars agrees upward, sell when they all agree downward - since the point of this submission is the alignment mechanism itself, which is the genuinely hard and easy-to-get-wrong part of testing a multi-symbol idea in a single-symbol tester. Notes and limitations - This EA does trade the driver symbol - it is not report-only. The export step is the safety-relevant part: an outdated or misaligned companion file produces a wrong signal silently, so re-export whenever the test's date range changes. - Alignment requires an EXACT bar-time match between the driver's current bar and a row in the companion file. A companion file covering a different timeframe or a gapped session correctly contributes "no data" for the unmatched bars rather than a guess - by design, not a bug - but this means a badly-exported companion file can silently starve the vote rather than erroring loudly. - The bundled entry rule requires ALL loaded companions to agree; it does not implement partial-agreement weighting or any other voting scheme, since the alignment mechanism, not the rule sophistication, is this submission's point. - Only one position at a time on the driver symbol. - This works equally in a live/demo chart attach, not only the tester, since the underlying file lookup mechanism does not care which context it runs in - but its main design intent, and the reason for the pre-export step, is the tester's single-symbol limitation.

Expert advisor · MT4 · v1.0 · Free

About Multi Symbol Tester Driver

Multi Symbol Tester Driver is an expert advisor (trading robot) for MetaTrader 4. It has 10 settings, such as Companion symbol a, File name a and Companion symbol b. MQL source code included.

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

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

Settings

SettingDefaultWhat it does
Companion symbol aGBPUSDCompanion symbol A - used only as a label and file-name key
File name aMultiSymbolTesterDriver_GBPUSD.csvPre-exported aligned series for companion A, under MQL4\Files\
Companion symbol bUSDJPYCompanion symbol B - set InpFileNameB blank to disable this leg
File name bPre-exported aligned series for companion B, blank = not used
Trend lookback20Bars back used to judge each companion's own trend direction
Fixed lots0.10Lot size for the driver symbol's trades
Magic number40701Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Stop loss pips30Fixed stop loss on the driver symbol, in pips
Take profit pips60Fixed take profit on the driver symbol, in pips

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: Trend · EURUSD · GBPUSD · Multi-Currency · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria