Summary: Learn how to create and configure custom symbols in MT5 for backtesting strategies on instruments your broker doesn't offer. Includes official MetaTrader 5 documentation references and a practical data import workflow.




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:

  • <strong>Open the Symbols Management Window</strong>: In the Market Watch window, right-click and select "Symbols." Or go to View > Symbols from the top menu.


  • <strong>Create Custom Symbol</strong>: In the Symbols window, click the "Create Custom Symbol" button. This opens the configuration panel.


  • <strong>Configure Basic Properties</strong>:

  • - 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.

  • <strong>Set Trading and Quote Sessions</strong>: This is critical for realistic backtesting. The official documentation notes that EAs will not trade during non-trading periods in the Strategy Tester . I set my trading hours to match the underlying market's active session.


  • Importing Historical Data

    My custom symbol was empty—no price history. I needed to import data. Here's what worked:

  • <strong>Get the Data</strong>: I exported historical data from my MT4 installation (since MT4 had the pair I needed). MT4 saves history files in the history\ folder of its data directory.


  • <strong>Format for Import</strong>: MT5 custom symbols accept data import through the History Center. Go to View > History Center, select your custom symbol, and click "Import." The file needs to be in CSV format with columns for time, open, high, low, close, and tick volume. I used a simple script to convert my MT4 export into this format.


  • <strong>Load the Data</strong>: After import, the data appeared in the History Center. I could verify it by opening a chart for the custom symbol.


  • 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.