Build your own composite symbol from existing instruments, import external tick data, and test correlations or non-tradeable indices. The custom symbol feature is one of MT5's most powerful and least-used.
Your broker offers a fixed set of tradeable instruments. But there are cases where you want a chart of something your broker does not list:
Custom symbols let you build any of these without leaving MT5.
Press Ctrl+U or right-click in market watch then choose Symbols. At the bottom of the dialog you will see a button labelled Custom Symbol. Click it.
From here you can:
Click Create. You get a form with all the contract specifications you would see for a real symbol.
| Field | Notes |
|---|---|
| Symbol | Internal name. Avoid spaces and special characters. Example: EURBASKET. |
| Description | Human-readable label. Example: "EUR basket (equal weight)". |
| International name | Optional ISIN or similar identifier. |
| Category | Group in market watch (e.g. Custom Indices). |
| Trade mode | Set to Disabled. Custom symbols cannot be traded. |
| Digits | Price precision. 5 for forex-style, 2 for index-style. |
| Contract size | Arbitrary for non-tradeable symbols. Use 1. |
| Tick value / tick size | Set so that 1 tick of price change equals 1 unit of value if you do not care. |
Most of the specification fields do not matter for a custom symbol you only want to chart. Set Trade Mode to Disabled and the rest is cosmetic.
The most powerful custom symbol feature: you can specify a price formula that references other symbols. MT5 then automatically calculates the custom symbol's price tick-by-tick.
In the custom symbol's Formula field (under Advanced specifications), enter an expression. Examples:
| Goal | Formula |
|---|---|
| Inverse of EURUSD | 1 / EURUSD |
| EUR basket (3 pairs avg) | (EURUSD + EURGBP * 1.27 + EURJPY / 154) / 3 |
| Gold/silver ratio | XAUUSD / XAGUSD |
| Net long position proxy | EURUSD - GBPUSD |
| Volatility proxy | (USDCHF + USDJPY / 100 + DXY / 100) / 3 |
The formula uses MT5's expression parser. Operators: + - * / ( ) and a small set of functions (abs, max, min). It references other symbol names as variables, using the latest tick.
Once a formula is set, the custom symbol updates in real time as the underlying symbols tick.
If you have historical data from another source (an external broker, a data vendor, a research dataset), you can import it into a custom symbol.
MT5 expects this CSV layout, no header row:
2025.01.15,09:00:00,1.0834,1.0840,1.0830,1.0838,12345
2025.01.15,09:01:00,1.0838,1.0842,1.0836,1.0841,8721
2025.01.15,09:02:00,1.0841,1.0845,1.0840,1.0843,15432
Columns: date, time, open, high, low, close, tick volume. Date format YYYY.MM.DD, time HH:MM:SS.
Once imported, open a chart of the symbol and it will display the imported history.
For Strategy Tester accuracy, importing tick-by-tick data is far better than OHLC bars. Tick data lets the Tester replay every price movement, including intra-bar fluctuations.
2025.01.15 09:00:00.123,1.08340,1.08342
2025.01.15 09:00:00.456,1.08341,1.08343
2025.01.15 09:00:00.789,1.08340,1.08342
Columns: datetime (with milliseconds), bid, ask. Optional fourth column for volume.
Custom symbols appear in the Strategy Tester's symbol dropdown. You can backtest an EA or indicator against your imported history exactly as you would on a real symbol.
This is the key reason custom symbols matter for serious backtesting:
Let us build a tradeable analysis of the gold/silver ratio (XAU/XAG), useful for precious metals traders.
Ctrl+U, click Custom Symbol > Create.XAUXAG. Description: "Gold/Silver Ratio".Custom Ratios.XAUUSD / XAGUSD.Now drag XAUXAG from the Symbols panel to market watch, then open a chart. The chart updates live as gold and silver tick. The ratio is in the range of approximately 75 to 95 historically and indicates relative valuation between the two metals.
If you create a formula-based composite symbol today, MT5 has no historical data for it yet. The chart will start with today's tick and build history from there. To backfill historical data, you need to import OHLC or tick data from CSV.
If you reinstall MT5 or move to another computer, custom symbols do not transfer automatically. They are stored in the MQL5\Symbols folder under your terminal data directory. Back this folder up if your custom symbols are important.
Even if you mark trade mode as Full, there is no exchange behind a custom symbol. You can place orders in MT5, but they will simply error out. Use custom symbols for analysis, not execution.
Yes, in iCustom() calls and SymbolInfo() functions. Make sure the custom symbol exists in market watch before running the EA.
There is no hard limit but MT5 performance degrades with extremely large datasets (multi-gigabyte tick files). For most backtests, 5-10 years of tick data per symbol is the practical sweet spot.
Check that all referenced symbols are in your market watch. The formula parser cannot reference unsubscribed symbols. Also confirm there is no division by zero possible at any tick combination.
Formula-based custom symbols update on every tick of their underlying symbols. Imported-data custom symbols are static and do not update unless you import additional data.