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.
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.
3. Installation
- Copy the complete
DataEditorfolder toMQL5\Experts\TWExperts\in the terminal data folder. - Compile
DataEditorMarket_1.1.mq5in MetaEditor, or use the supplied EX5 build. - Refresh the MT5 Navigator and attach DataEditorMarket_1.1 to the symbol you want to edit.
- 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
- Press the middle mouse button so the chart crosshair appears.
- Hold the left mouse button at one edge of the intended range.
- Drag across the candles and release the left mouse button.
- 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
| Action | Behaviour |
|---|---|
| Shift | Moves the selected data by 1–12 hours forward or backward. Existing data at the destination is replaced. Shift areas are shown in blue. |
| Delete | Removes the selected bars or ticks from the generated output. Delete areas are shown in pink. |
| Delete daily | Applies a selection shorter than 24 hours to the same time range on every day in the available chart history. |
| Delete weekly | Repeats a selection shorter than seven days for every week. |
| Delete yearly | Repeats a selection shorter than 364 days for every represented year. |
| Cut edit | Uses 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.
8. Create a new data file
- Enter Start date and End date, or leave them empty to use the available chart-history range.
- Select Tick or one of the supported bar periods: M1, M5, M10, M15, M30, H1, H4 or D1.
- Optionally replace tick volume and real volume for bar exports. A blank or zero keeps the original value.
- For tick exports, optionally set Last, Volume and Flags. Blank or zero retains the source field.
- Choose the spread model for a bar export.
- Click Create new file and review the confirmation dialog, including the date range and first edit definitions.
- 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
| Mode | How it works |
|---|---|
| Do not change spread | Preserves the spread value from the source bars. |
| Use fixed value | Writes one fixed integer spread in broker points to every output bar. |
| Calculate from symbol | Builds 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 file | Reads 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
| Input | Action |
|---|---|
| Middle mouse, then left-drag | Create a chart selection. |
| Spacebar | Start or pause automatic scrolling. |
| Arrow up / down | Increase or decrease scroll speed. |
| Arrow right / left | Increase or decrease the custom scroll step. |
| Esc | Clear the current selection. |
12. Troubleshooting
| Problem | Action |
|---|---|
| EA reports it is not allowed in Strategy Tester | Attach it to a normal MT5 chart. This restriction is intentional. |
| No range is selected | Use the middle mouse button to activate the crosshair, then drag with the left button, or type valid start and end timestamps. |
| An edit is rejected | Check for overlap with an existing edit or, for shifts, with the destination of another shifted range. |
| History cannot be copied | Open the symbol and timeframe, allow MT5 to download the required history and retry with a smaller date range. |
| Spread symbol is invalid | Use the broker's exact non-custom symbol name and ensure it is available in Market Watch. |
| Spread file is rejected | Confirm semicolon-separated sequential indices, non-negative spreads and exactly 1,440 or 10,080 rows. |
| Export takes a long time | Tick 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.