Loading…

Spread Seasonality Archiver

Spread is not constant through the day - it widens around rollover, around low- liquidity Asian-session hours, and around major news. A single week of watching a chart is not enough to see the real pattern, and MetaTrader keeps no long-run record of it on its own. This EA builds one, tracking the current spread against the SERVER hour (0-23) every tick, and appending a completed calendar month's 24 hourly averages to a CSV archive when the month rolls over. Server hour, not local hour, is the deliberate choice: every trader on the same broker shares the same server clock, so bucketing by server hour keeps the archive meaningful regardless of where the terminal itself happens to be running. Bucketing by local time would silently mix different sessions together depending on the terminal's own time zone. The archive is append-only by design - each finished month adds 24 new rows and never rewrites what came before, so running this EA for a year on a chart builds a genuine twelve-month seasonality record rather than a single most-recent snapshot. Notes and limitations Spread is read from MarketInfo(symbol, MODE_SPREAD) in broker points, which already reflects that broker's own pricing - it is not comparable point-for-point across brokers with different quoting conventions without checking digits/point size first. A month that starts or ends partway through the EA's runtime still gets flushed, with the last CSV column marking it incomplete - exclude those rows before treating an hour's average as a full month's true average. This is a passive archiver only; it never trades and carries no risk-management inputs because there is nothing to size or protect.

Expert advisor · MT4 · v1.0 · Free

About Spread Seasonality Archiver

Spread Seasonality Archiver is a script for MetaTrader 4. It has 1 setting, such as Archive file name. MQL source code included.

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

Settings

SettingDefaultWhat it does
Archive file nameSpreadSeasonalityArchiver.csvArchive file, written under MQL4\Files\

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 → Scripts.
  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 script onto a chart to run it once.

Download the PDF guide

Tags: Trading Sessions · News Trading · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria