A template is a set of chart window parameters that can be applied to other charts. The following data can be stored in a template:
- chart type and color;
- color scheme;
- chart scale;
- OHLC line shown or hidden;
- running Expert Advisor and its parameters;
- applied custom and technical indicators and their settings;
- graphical objects;
- separators of days.
When you apply a template to a chart, settings stored in it are applied to the instrument and timeframe. For example, you can create a template that includes indicators MACD, RSI, and Moving Average, and then use it for other charts. In this case, the chart windows look the same for different symbols and periods.
Templates are saved as TPL-files in folder \MQL5\Profiles\Templates. The platform provides several predefined names of templates:
- default.tpl — the basic template that us automatically applied when you create a new chart;
- tester.tpl — the template of the chart on which testing results are displayed;
- debug.tpl — the template of the chart created when you start MQL5 application debugging from MetaEditor.
To create a template with the desired parameters (or modify an existing one), configure the chart and click " Save Template..." in its context menu.
To share and synchronize templates and profiles between your platforms, use the MQL5 Storage, which is integrated into MetaEditor. You will be able to access them from any computer using your MQL5.community account.
Actions with Templates
Click "Templates" in the Chart menu or in the context menu of a chart or click on on the toolbar.
Actions with templates
Profiles provide a convenient way of working with groups of charts. The following data can be stored in a profile:
- charts that are open at the moment when you save the profile
- the location and size of these charts;
- templates applied to the charts.
When a profile is opened, each chart with all its settings is located exactly in the same position where it was during profile saving. All changes in open chart windows are automatically saved in the current profile. The list of all charts of the current profile is available in the Window menu. The name of the current profile is displayed in the status bar and is marked with a tick in the profile control menu.
A default profile is created during platform installation. Initially, it stores four chart windows of basic currency pairs: EURUSD, USDCHF, GBPUSD and USDJPY. All profiles are stored in a folder \MQL5\Profiles\Charts.
Chart templates with running Expert Advisors are also saved in profiles, therefore the platform settings provide an option for automatic disabling of Expert Advisors when changing the profile.
Click "Profiles" in the File menu, button on the toolbar or click on the name of the current profile in the status bar.
The lower part of this menu contains the list of existing profiles. To apply one of them click on it.
A predefined profile can be assigned to a trade account. Create a profile with the same name as the account number. The predefined profile is applied automatically when you switch to this account. If there is no predefined profile, the current profile remains active.
The current profile and the default profile (marked as DEFAULT) cannot be deleted.