Antovis Analytics · Spread RecorderVersion 1.1
EXPERT ADVISOR DOCUMENTATION

Spread Recorder 1.1

Record or load broker spread data, inspect how transaction costs change through the day and week, and export a structured spread profile for more realistic strategy testing.

2 modesHistorical or live recording
Up to 28Symbols per instance
10 secondsSampling interval
CSVDaily or weekly profile

1. Overview

Spread Recorder is a MetaTrader 5 Expert Advisor that measures the difference between bid and ask in broker points. It can read historical tick data for a defined period or collect new spread observations while the terminal runs.

Understand real trading costs

Inspect raw spread history as well as minimum, average and maximum values across selected symbols and periods.

Find recurring patterns

Aggregate spread behaviour into 15-minute segments of the day or hourly segments of the week.

Check data coverage

Use daily and weekly datapoint charts to see when quotes were present and where the source history contains gaps.

Build reusable profiles

Create a daily or weekly series from minimum, average or maximum spreads, then adjust, preview and export it.

Spread Recorder does not place, modify or close trades. It is a data collection and analysis tool.

2. Requirements

  • MetaTrader 5 on Windows.
  • An active connection to the broker when the EA is initialized.
  • The requested symbols must exist at the broker. Spread Recorder can add valid symbols to Market Watch automatically.
  • Sufficient tick history for the selected historical interval.
Not supported in Strategy Tester. Spread Recorder reads terminal and broker data directly and stops during initialization when launched in the MT5 Strategy Tester.

3. Installation

  1. Copy the complete SpreadRecorder folder to MQL5\Experts\TWExperts\ inside the target terminal data folder.
  2. Open MetaEditor and compile SpreadRecorder_1.1.mq5, or use the supplied SpreadRecorder_1.1.ex5.
  3. Return to MT5 and refresh the Navigator.
  4. Drag SpreadRecorder_1.1 onto any chart.
  5. Select the operating mode, time period and symbols, then click OK.

The EA does not require permission to trade because it never sends orders. The terminal must remain connected so broker symbols, ticks and spread values are available.

4. Input parameters

ParameterOptions / defaultPurpose
ModeHistory / Live
Default: History
History loads stored ticks between the configured dates. Live records new spread observations while the EA is running.
Start timeDate and timeFirst timestamp requested in History mode. It must be earlier than End time.
End timeDate and timeLast timestamp requested in History mode. It cannot be later than the current terminal time.
SymbolsCurrent / Market Watch / List
Default: Current
Select only the chart symbol, all symbols currently visible in Market Watch, or a custom semicolon-separated list.
Symbol listExample: EURUSD;CADJPY;GBPNZDUsed when Symbols is set to List. A maximum of 28 unique symbols is supported; each name may contain up to 15 characters.
Panel sizeAuto / Custom
Default: Auto
Auto scales the interface from the detected screen DPI. Custom enables the width, height and font-size inputs below.
Panel width / height / font1400 / 700 / 9Manual interface dimensions used only with Custom panel sizing.

The debug password is reserved for support diagnostics and is not needed during normal operation.

5. Historical and live workflows

Historical mode

  1. Choose History and set Start time and End time.
  2. Select the current symbol, Market Watch or a custom symbol list.
  3. Attach the EA. It requests tick history with up to three synchronization attempts per symbol.
  4. Wait for the loading message to finish. Large date ranges or symbol lists can take several minutes.
  5. Use the analysis tabs and profile builder once the panel appears.

Live mode

  1. Choose Live and select the symbols to record.
  2. Keep MT5 connected and the EA attached.
  3. Every ten seconds, the recorder checks each symbol and stores a new observation when the broker has published a newer quote timestamp.
  4. Use the History view to inspect the data accumulated during the current run.
Recorded observations are held in memory for the current EA session. Export the calculated profile before removing the EA or closing the terminal if you need to keep the result.

6. Analysis interface

Select one or more symbols with the buttons on the left, then choose the period and chart view. All selects every symbol and Clear removes the selection. Chart minimum and maximum fields can override automatic Y-axis scaling.

ViewWhat it shows
HistoryRaw spread observations over time for every selected symbol.
Min / Avg / MaxThe minimum, arithmetic average and maximum spread for each selected symbol inside the chosen timespan.
DailyMinimum, average and maximum spreads grouped into 96 fifteen-minute segments of the day.
WeeklyMinimum, average and maximum spreads grouped into 168 hourly segments from Monday through Sunday.
Daily datapointsNumber of observations available for every minute of the day.
Weekly datapointsNumber of observations available for every minute of the week.

The timespan selector offers the last minute, five minutes, hour, 24 hours, week, month or all loaded data. The effective amount of data also depends on the selected mode and available broker history.

7. Create a spread profile

The panel on the right converts the recorded observations for one symbol into a complete daily or weekly series.

ControlOptionsEffect
SymbolAny loaded symbolSelects the source data.
Time modeDaily / WeeklyCreates 1,440 minute values for a day or 10,080 minute values for a week.
Spread modeMinimum / Average / MaximumChooses the statistic calculated for each minute bucket.
Fill dataFill gaps / Do not fill gapsOptionally interpolates missing values between neighbouring recorded buckets.
Markup0–999%Adds a percentage margin to every calculated spread value.
SmoothingNone / 3 / 5 / 9 / 15 / 25Applies a centred moving average with the selected number of values.
RoundingNormal / Up / DownConverts the calculated result to integer broker points.

Click Show data to preview the processed series. Recheck the graph after changing gap filling, markup, smoothing or rounding.

8. CSV export format

Click Save to file, choose a filename and save the processed profile. The default folder is MQL5\Files\SpreadRecorder. Each row uses a semicolon as separator:

0;12
1;12
2;13
3;13
  • The first value is the minute index: 0–1439 for Daily, or 0–10079 for Weekly.
  • The second value is the calculated spread in integer broker points.
  • The file contains the processed series shown in the preview, including any filling, markup, smoothing and rounding.
A broker point is not always the same as a pip. Check the symbol digits and point size before using the exported values in another tool.

9. Troubleshooting

ProblemLikely cause and action
“Terminal is not connected”Connect MT5 to the broker account before attaching the EA, then try again.
“Failed to receive ticks”The requested history is unavailable or not synchronized. Open the symbol chart, reduce the date range and allow MT5 to download history before retrying.
Symbol does not existUse the broker's exact symbol name, including suffixes such as .a or -pro.
More than 28 symbolsReduce Market Watch or shorten the custom list. One instance supports a maximum of 28 symbols.
No chart appearsSelect at least one symbol and confirm that spread observations were loaded or recorded for it.
No data can be savedThe selected symbol has no observations or the calculated profile is empty. Load data and preview it first.
History load takes a long timeTick history is downloaded separately for every symbol. Use a smaller period or fewer symbols.
EA fails in Strategy TesterThis is intentional. Run Spread Recorder on a normal connected chart.

10. Important limitations

  • The output reflects the broker, account type, server and symbols from which the data was collected. It should not be assumed to represent another execution venue.
  • Historical tick availability and quality are controlled by the broker and MT5.
  • Live recording requires MT5, the computer or VPS and the broker connection to remain online.
  • Spread alone does not capture commission, swap, slippage, execution delay or market impact.
  • Gap filling and smoothing create derived values. Review the raw coverage charts before relying on a processed profile.

11. Support

For installation or technical questions, contact info@antovis.com. Include the Spread Recorder version, MT5 build, broker symbol name, selected mode and the relevant message from the Experts log.