Building an MT5 custom symbol from your own tick history
Posted: Thu Oct 29, 2026 12:02 pm
For backtests with real spreads, I import my own recorded ticks into an MT5 custom symbol. It took a few tries to get right, so here's the process.
1. Recording
A small service EA writes every tick (time in milliseconds, bid, ask, flags) to a CSV per day. Running on the VPS for months.
2. Cleaning
In the strategy tester, choose the custom symbol and "Every tick based on real ticks".
Lessons: be careful with the time zone (DST changes caused a one-hour offset in my first import), and with commission, which the custom symbol doesn't know. Set it in the tester or in your code.
Has anyone automated this end to end? I'd like to stop doing step 2 by hand.
1. Recording
A small service EA writes every tick (time in milliseconds, bid, ask, flags) to a CSV per day. Running on the VPS for months.
2. Cleaning
- Remove duplicate ticks (same time and prices).
- Check for gaps over 5 minutes during trading hours, which mark connection drops.
- Convert times to the broker's server time zone consistently.
- CustomSymbolCreate with the original symbol as template, so contract size, digits and margin settings copy over.
- CustomTicksReplace in batches by day, rather than one huge import.
In the strategy tester, choose the custom symbol and "Every tick based on real ticks".
Lessons: be careful with the time zone (DST changes caused a one-hour offset in my first import), and with commission, which the custom symbol doesn't know. Set it in the tester or in your code.
Has anyone automated this end to end? I'd like to stop doing step 2 by hand.