Last month, I wanted to backtest a mean-reversion strategy on a specific exotic cross-currency pair. My broker simply didn't offer it. I almost gave up until I realized MT5 has a built-in feature that lets you create custom symbols and import your own historical data. This changed everything.
The Problem with Default Symbols
Your broker's symbol list is fixed. If they don't provide a particular instrument, you can't just request it. But for backtesting, you don't need live trading connectivity—you just need price data. That's where custom symbols come in.
How to Create a Custom Symbol
The official MetaTrader 5 Help section on custom instruments explains the process clearly . Here's the exact workflow I followed:
- Give it a unique name (cannot match any existing broker symbol). The name can only contain Latin letters, and only these special characters are allowed:
., _, &, and # .- Set the "Base" field to the underlying asset name (e.g., for a futures contract, enter the commodity name).
- You can copy parameters from an existing symbol using the "Copy from" dropdown to save time.
Importing Historical Data
My custom symbol was empty—no price history. I needed to import data. Here's what worked:
history\ folder of its data directory.The Hidden Catch
Here's something the official docs don't spell out: custom symbols only store bid prices by default. If your backtest relies on ask price calculations (like for buy orders), you'll need to import ask data separately or adjust your EA to work with bid-based entry logic. I wasted two days wondering why my backtest results were off by a few pips before I figured this out.
Testing Your EA on the Custom Symbol
Once the symbol was set up with data, opening the Strategy Tester (Ctrl+R) and selecting my custom symbol from the dropdown was straightforward. The EA ran as if the symbol were live.
Exporting Custom Symbols
You can export custom symbol settings as a JSON file to share or back up. In the Symbols window, right-click the custom symbol and choose "Export" . This saves all configuration—trading sessions, contract specifications, everything.
Reference: MetaTrader 5 Help - Custom Financial Instruments (metatrader5.com).
This article was originally published on FXEAR.com. All rights reserved. Unauthorized reproduction is prohibited.