.tpl File (MetaTrader Chart Template)
Definition
A .tpl file is a MetaTrader chart template containing the visual configuration of a chart — applied indicators, drawing objects, colour scheme, time scale, and which EA is attached. Save a configured chart as .tpl to recreate the setup on other charts or share configurations with other traders. Separate from .set files (which store EA parameters only).
In-depth: .tpl File (MetaTrader Chart Template)
Chart templates (.tpl files) in MetaTrader save the complete visual and analytical configuration of a chart, separate from the EA-specific preset (.set files). The .tpl file format is XML-like and includes:
1. Chart properties: timeframe, scale, colour scheme, foreground/background colours, time/price grid settings 2. Applied indicators: each indicator's full configuration including parameters, colours, line styles, applied price 3. EA attachment: which EA is attached, with its current parameter values 4. Drawing objects: trend lines, horizontal lines, channels, Fibonacci tools, custom drawings 5. Window properties: number of windows (main chart + subwindows for oscillators), window heights
File location: `MQL5/Profiles/Templates/` (MT5) or `templates/` (MT4) inside the data directory.
Use cases: 1. Vendor distribution: an EA vendor provides 'MyEA_chart.tpl' alongside the EA executable. Loading the template applies the EA with recommended settings, applies recommended indicators (e.g. confirmation indicators the EA uses or that human traders should monitor), and configures the chart for the trader's preferred view.
2. Setup propagation: after configuring a chart with indicators, EA, and colours, save as template. Load the template on other charts (other pairs, other timeframes) to instantly recreate the setup.
3. Configuration backup: save current chart configurations as templates before major changes. Roll back by loading the template.
4. Multi-monitor setups: configure templates for different roles (e.g. 'scalping_chart.tpl' for fast-timeframe execution charts, 'context_chart.tpl' for higher-timeframe macro view). Load templates onto multiple charts to set up a multi-monitor workspace quickly.
Default template: MetaTrader applies the default template to new charts. Save a customised default template as 'default.tpl' to set new charts' baseline appearance.
Limitations: - Path-specific: indicators referenced in the template must be installed at the same paths on any system loading the template. Custom indicators from one trader's setup don't automatically install on another's. - Version: templates created in different MetaTrader build numbers may not load cleanly across versions due to format evolution. - Symbol-agnostic: templates are not symbol-specific by default. A template containing the SMA20 indicator applies SMA20 to any symbol you load the template onto. - EA-specific state: templates capture the EA's input parameters, not the EA's runtime state. Loading a template starts the EA fresh; doesn't restore open positions or equity history.
Difference from .set files: - .set: stores EA input parameters only. Compact, portable. Used to switch between configurations of the same EA. - .tpl: stores complete chart visual configuration including EA. Larger file, more comprehensive. Used to recreate full chart setups.
Most vendors distribute both: .set files for parameter configurations across pairs/timeframes, and .tpl files for the complete chart setup.