Master MetaTrader 4/5 Templates and Profile Management

Learn to save, load, and share MT4 and 5 templates (.tpl) and profiles to instantly restore your trading workspace, indicators, and EA settings.

master-metatrader-4-5-templates-and-profile

Why Templates and Profiles Matter

Every experienced MetaTrader user knows the frustration of rebuilding a chart layout after a platform crash or when switching between trading styles. Templates and profiles solve this. A template saves a single chart's complete setup—indicators, timeframes, grid settings, and objects. A profile saves your entire workspace: all open charts, their templates, and their arrangement on screen. Together, they let you switch between a scalping layout, a swing-trading multi-chart view, or a backtesting configuration in seconds.

The real power becomes apparent when you manage multiple trading systems. For example, you might have a day-trading profile with four charts showing EURUSD, GBPUSD, USDJPY, and Gold on 15-minute timeframes, each with a 20-period EMA and RSI. Switching to a swing-trading profile could instantly replace those with daily charts of six currency pairs, each sporting a 50/200 SMA cross and a MACD histogram. Without templates and profiles, this would take 10–15 minutes of manual setup per switch. With them, it's a single click.

Prerequisites

  • A running MetaTrader 4 or MetaTrader 5 terminal (any build from 2015 onward)
  • At least one chart open with indicators/EAs attached (for practice)
  • Basic familiarity with right-click context menus
  • Windows file explorer access to locate the Profiles and Templates folders

Step-by-Step: Saving and Loading Templates

1. Save a Template from a Configured Chart

  1. Set up a chart exactly how you want it: choose a timeframe, attach indicators (e.g., Moving Average, RSI, Bollinger Bands), draw trendlines or horizontal lines, adjust the grid and color scheme under Charts > Properties (F8).
  2. Right-click anywhere on the chart, select Template > Save Template.
  3. In the dialog, type a descriptive name (e.g., "MA_RSI_Daily_Blue"). The file saves with a .tpl extension in MQL4/Profiles/Templates/ (or MQL5/Profiles/Templates/).
  4. Click Save. Your template now includes all indicator settings, colors, and applied objects.

Important detail: Templates also save chart object properties like trendline colors, ray extensions, and Fibonacci levels. If you have a complex set of support/resistance lines, they will be preserved. However, custom indicator source code is not saved—only the compiled .ex4 or .ex5 file reference and its input parameters are stored.

2. Load a Template onto Any Chart

  1. Open a new chart (or click an existing one).
  2. Right-click, choose Template > Load Template.
  3. Select your saved template from the list, or click Browse to pick a .tpl file from another folder.
  4. The chart instantly adopts all saved settings. Existing indicators on that chart are replaced unless the template is empty.

MT4 vs MT5 difference: In MT5, when you load a template that contains an Expert Advisor, the EA is automatically attached to the chart with its saved settings. In MT4, the EA is also attached, but you must confirm the "Allow live trading" checkbox if it was enabled when saved.

3. Set a Default Template for New Charts

  1. Configure a chart with your preferred default: timeframe, grid off, crosshair style, one or two indicators.
  2. Save it as Default.tpl (case-sensitive, no spaces).
  3. Any new chart opened via File > New Chart or by dragging a symbol from Market Watch now loads Default.tpl automatically.

Pro tip: Create a Default.tpl with only a 200-period moving average and a clean white background. This gives you a neutral starting point for any analysis. Avoid putting custom indicators in Default.tpl unless you use them on every chart.

Step-by-Step: Managing Profiles

1. Save Your Current Workspace as a Profile

  1. Arrange all your charts: open multiple symbols, set each to its own template, tile them manually or use Window > Tile Horizontally/Vertically/Cascade.
  2. Go to File > Profiles > Save As (MT4) or File > Profiles > Save Profile (MT5).
  3. Name your profile (e.g., "SwingTrade_4Pair"). The file saves as a folder with the same name under MQL4/Profiles/ or MQL5/Profiles/.
  4. All chart positions, attached templates, and Expert Advisors running on those charts are preserved.

What gets saved in a profile:

  • Every open chart's symbol, timeframe, and template
  • Chart window positions and sizes (including tabbed vs. tiled layout)
  • All running Expert Advisors with their current settings
  • Custom chart objects (trendlines, Fibonacci, text labels)
  • The active chart (the one that was selected) is remembered

2. Switch Between Profiles

To change to a different workspace, use File > Profiles and select a saved profile from the list. MT4 and MT5 both show recently used profiles at the top. You can also click the profile name in the bottom-right corner of the status bar (MT5) or use the drop-down in the toolbar (MT4 builds 1300+).

Keyboard shortcut: In MT5, press Ctrl + F9 to open the profile selection dialog. In MT4, you can assign a hotkey via Tools > Options > Expert Advisors > Hotkeys for profile switching.

3. Share Profiles Between Computers

  1. Locate the profile folder: %AppData%\MetaQuotes\Terminal\[INSTANCE_ID]\MQL4\Profiles\ (the instance ID is a long hexadecimal folder name).
  2. Copy the entire profile folder (e.g., "SwingTrade_4Pair") to a USB drive or cloud storage.
  3. On the target machine, paste it into the same Profiles\ directory (close MT first, then restart). The profile appears in the menu.

Cross-version compatibility: MT4 profiles are not compatible with MT5, and vice versa. The file structures differ—MT4 uses .chr files inside the profile folder, while MT5 uses a layout.ini file. Always verify you're copying to the correct platform's folder.

Templates vs Profiles: When to Use Each

Feature Template (.tpl) Profile (folder)
Scope Single chart All open charts and their arrangement
Saves EAs Yes (with settings) Yes (running EAs preserved)
Saves Chart Objects Yes Yes
Best Use Case Apply consistent indicator setup to many symbols Switch between complete trading environments

Advanced Profile Editing: The layout.ini File

For power users, the profile's layout.ini file (MT5) or the .chr files (MT4) can be manually edited to fine-tune your workspace without opening MetaTrader. Here's what you can change in MT5's layout.ini:

Parameter Location in File What You Can Change
Symbol [ChartWindow.0] section Replace "EURUSD" with "GBPUSD" to change the chart's symbol
Timeframe [ChartWindow.0] section Change Timeframe=60 to Timeframe=1440 (daily)
Window Position [ChartWindow.0] section Adjust X, Y, Width, Height values

Warning: Always make a backup of the profile folder before editing layout.ini. A syntax error can prevent the profile from loading, and you'll need to restore from backup.

Tips and Best Practices from Experience

  • Name templates by purpose, not symbol. Use names like "Scalp_1Min_EMA" or "Swing_Daily_Bollinger" so you remember what each does. Avoid "EURUSD_Setup" because that template works on any symbol.
  • Create a "Clean" template with no indicators, default colors, and grid visible. Use it to quickly strip a chart back to basics before applying a different setup.
  • Back up your Profiles folder regularly. Copy the entire Profiles\ directory to a safe location. A corrupted profile after a platform update can wipe your layouts.
  • Use profiles for backtesting. Create a dedicated profile with one chart per symbol, each set to the same template, all EAs disabled. This prevents accidental live trades when testing.
  • In MT5, you can drag and drop profile files from Windows Explorer directly onto the status bar area to load them quickly.
  • Indicator templates don't save Expert Advisors that are attached to the chart, but they do save indicator-based EAs that are compiled as custom indicators. For full EA preservation, use profiles.
  • Version control your templates: If you update an indicator's parameters, save the template with a version number (e.g., "RSI_Strategy_v2.tpl") so you can roll back if the new settings perform worse.

Programmatic Template Management with MQL5

For developers, MQL5 provides functions to manage templates programmatically. Here's a simple script that applies a template to all open charts:

//+------------------------------------------------------------------+
//|                                          ApplyTemplateToAll.mq5

Frequently Asked Questions

Can I share a template between MT4 and MT5?

No. The .tpl file format differs between MT4 and MT5, and indicator IDs are not cross-compatible. You must recreate templates manually on the other platform.

Does saving a profile also save my EA's running state and open orders?

No. Profiles save chart layouts and attached EA settings, but not open positions, pending orders, or EA internal variables. Use global variables or file exports for that data.

How do I delete a template or profile I no longer need?

For templates: open the Templates folder via File > Open Data Folder > MQL4/Profiles/Templates (or MQL5/Profiles/Templates), delete the .tpl file. For profiles: go up one level to Profiles/, delete the entire profile folder. Restart MT4/MT5 to refresh the menu.

My template includes a custom indicator that uses external DLLs. Will those DLLs transfer with the template?

No. Templates only store indicator parameters. You must manually copy the DLL files to the terminal's root folder or Libraries folder, and ensure the indicator's DLL import is enabled in Tools > Options > Expert Advisors.

Community

Clap for the article and open comments only when you want to read them.

0 claps0 comments

Related articles