Antovis Analytics · Data EditorVersion 1.1
EXPERT ADVISOR DOCUMENTATION

Data Editor 1.1

Edit historical market data visually inside an MT5 chart. Select, delete or shift time ranges, save the edit plan and export a new bar or tick file without changing the broker's original history.

Visual editingSelect ranges in the chart
±12 hoursShift selected data
Bars or ticksCreate new CSV files
4 spread modesKeep, fix, calculate or import

1. Overview

Data Editor is a MetaTrader 5 Expert Advisor for controlled modification of historical bar and tick data. Edits are defined visually on a normal chart, then applied only when a new CSV file is generated.

Remove known distortions

Delete individual ranges or repeat the same deletion on every day, week or year represented in the chart history.

Correct timestamps

Shift selected bars or ticks between one and twelve hours forward or backward, with overlap checks before the edit is accepted.

Compare synchronized charts

Link open charts to the active chart and use recurring time marks to inspect the same location across symbols.

Generate research files

Create new tick data or M1, M5, M10, M15, M30, H1, H4 and D1 bar files with optional volume and spread adjustments.

The broker history is never overwritten. Data Editor stores an edit plan and writes the modified result to a separate file.

2. Requirements

  • MetaTrader 5 on Windows.
  • Historical bars or ticks for the chart symbol and requested date range.
  • Sufficient MT5 history settings for the period you intend to edit.
  • A normal chart—the EA intentionally does not run in Strategy Tester.
Work on copies of important data and verify every exported file before using it in research. Removing or shifting history changes the sequence on which a backtest operates.

3. Installation

  1. Copy the complete DataEditor folder to MQL5\Experts\TWExperts\ in the terminal data folder.
  2. Compile DataEditorMarket_1.1.mq5 in MetaEditor, or use the supplied EX5 build.
  3. Refresh the MT5 Navigator and attach DataEditorMarket_1.1 to the symbol you want to edit.
  4. Choose the timeframe that best matches the ranges you need to inspect.

The Data Editor is a tooling EA and does not send trading orders.

5. Select a time range

  1. Press the middle mouse button so the chart crosshair appears.
  2. Hold the left mouse button at one edge of the intended range.
  3. Drag across the candles and release the left mouse button.
  4. Check the Selection start and Selection end fields. The selected area is highlighted in green.

You can also type the start and end manually. Times are aligned to the current chart period. Press Esc to clear the active selection.

6. Define the edits

ActionBehaviour
ShiftMoves the selected data by 1–12 hours forward or backward. Existing data at the destination is replaced. Shift areas are shown in blue.
DeleteRemoves the selected bars or ticks from the generated output. Delete areas are shown in pink.
Delete dailyApplies a selection shorter than 24 hours to the same time range on every day in the available chart history.
Delete weeklyRepeats a selection shorter than seven days for every week.
Delete yearlyRepeats a selection shorter than 364 days for every represented year.
Cut editUses the current selection to shorten, split or remove part of an existing edit.

Edits may not overlap. Shift operations are also checked at their destination so two moved ranges cannot occupy the same output period.

7. Save and continue an edit plan

Save edits writes the current edit definitions to a binary file under MQL5\Files\DataEditor\Edits. Load edits restores a saved plan and redraws the colored edit regions.

Existing non-overlapping edits stay in place when a file is loaded. If a loaded edit overlaps one already present, the loaded definition replaces the conflicting chart edit.

The BIN file contains edit instructions, not price history. Keep it together with the symbol, timeframe and source-history information needed to reproduce the export.

8. Create a new data file

  1. Enter Start date and End date, or leave them empty to use the available chart-history range.
  2. Select Tick or one of the supported bar periods: M1, M5, M10, M15, M30, H1, H4 or D1.
  3. Optionally replace tick volume and real volume for bar exports. A blank or zero keeps the original value.
  4. For tick exports, optionally set Last, Volume and Flags. Blank or zero retains the source field.
  5. Choose the spread model for a bar export.
  6. Click Create new file and review the confirmation dialog, including the date range and first edit definitions.
  7. Choose the CSV destination under MQL5\Files\DataEditor\History.

The selected edits are applied during file creation. The current chart symbol and its broker history remain unchanged.

9. Spread models for bar files

ModeHow it works
Do not change spreadPreserves the spread value from the source bars.
Use fixed valueWrites one fixed integer spread in broker points to every output bar.
Calculate from symbolBuilds a minute-of-day spread curve from roughly two months of M1 history for another valid broker symbol. A percentage markup and minimum spread can be applied.
Use spread from fileReads a 1,440-line daily or 10,080-line weekly index;spread profile, such as one created by Spread Recorder.

When calculated from a symbol, every minute needs sufficient observations. Missing minute buckets are filled from a nearby valid bucket, markup and minimum are applied, and the result is smoothed across seven values.

10. Output formats

Bar CSV

time,open,high,low,close,tick_volume,real_volume,spread

Each output row contains an MT5 bar timestamp, OHLC prices, tick and real volume and the selected spread value.

Tick CSV

<DATE>,<TIME>,<BID>,<ASK>,<LAST>,<VOLUME>,<FLAGS>
2026.08.30,12:00:00.123,1.08501,1.08503,,,6

Tick exports preserve millisecond timestamps and write only those bid, ask, last and volume fields indicated by the tick flags.

Spread-profile input

0;8
1;8
...
1439;11

The index must begin at zero and increase without gaps. Accepted lengths are exactly 1,440 values for a day or 10,080 for a week.

11. Keyboard and mouse shortcuts

InputAction
Middle mouse, then left-dragCreate a chart selection.
SpacebarStart or pause automatic scrolling.
Arrow up / downIncrease or decrease scroll speed.
Arrow right / leftIncrease or decrease the custom scroll step.
EscClear the current selection.

12. Troubleshooting

ProblemAction
EA reports it is not allowed in Strategy TesterAttach it to a normal MT5 chart. This restriction is intentional.
No range is selectedUse the middle mouse button to activate the crosshair, then drag with the left button, or type valid start and end timestamps.
An edit is rejectedCheck for overlap with an existing edit or, for shifts, with the destination of another shifted range.
History cannot be copiedOpen the symbol and timeframe, allow MT5 to download the required history and retry with a smaller date range.
Spread symbol is invalidUse the broker's exact non-custom symbol name and ensure it is available in Market Watch.
Spread file is rejectedConfirm semicolon-separated sequential indices, non-negative spreads and exactly 1,440 or 10,080 rows.
Export takes a long timeTick files and large date ranges can contain many records. Wait for the completion message before closing MT5.

13. Important limitations

  • Data Editor does not validate whether an edited market sequence is economically plausible.
  • Deleting or shifting data can alter gaps, bar construction, indicator values and strategy behaviour.
  • Results depend on the availability and quality of the broker's historical bars or ticks.
  • A spread model does not include commission, swap, slippage, execution delay or market impact.
  • Generated files should be reviewed and archived with their edit-plan and source-history assumptions.

14. Support

For installation or technical questions, contact info@antovis.com. Include Data Editor version 1.1, the MT5 build, symbol, timeframe, export mode and the relevant Experts-log message.