MetaEditor provides multiple settings to help you conveniently customize your work in the development environment. To open the settings, click Options... in the Tools menu (Ctrl+O).
All settings are grouped in several tabs based on what they do:
- General – general code editing settings: tab size, auto completion, auto list of names, etc.
- Colors – colors for highlighting MQL4/MQL5 language syntax.
- Font – settings of a text entered in MetaEditor.
- Styler – settings for the automatic source code styling.
- Compiler – settings of external compiling for multilingual projects.
This tab features general code editing settings: tab size, auto completion, auto list of names, etc.
The window contains the following parameters:
- Tabulation – number of characters inserted when pressing Tab.
- Insert spaces – enable/disable replacing tab characters with spaces.
- String indices – enable/disable line numbering in the code editing window.
- Auto indent – enable/disable auto indent when moving to the next line according to the indent of the previous one.
- Auto parameters – enable/disable automatic opening of the function signature hint when you enter it.
- Auto list names – enable/disable auto opening of a scrollable list of names of built-in and custom functions when entering the first characters of their names.
- List names after "n" characters – set the number of characters followed by the auto list of names.
- Insert () and closing } ] ) ' " – automatic insertion of parentheses after functions and closing parentheses and quotation marks when entering opening ones.
- Highlight current line – when enabled, the current code line in the editing window is highlighted in gray.
- Highlight matching brackets – when enabled, the background of matching parentheses is highlighted when the mouse cursor is placed between them.
It is recommended not to disable the "Insert spaces" option to save the code formatting when transferring to other editors.
The Colors tab configures highlighting MQL4/MQL5 language syntax when working with a source code.
The Elements block allows you to select MQL4/MQL5 language syntax elements, while the right part manages their display: Foreground, Background. The block below the settings shows an example of how this element will be displayed in the code editing window. Click Reset All to reset the syntax highlighting settings to default values.
This tab configures the font type and size for displaying code in the editing window.
The following setting blocks are available here:
- Font – font type selected from the list of available ones.
- Size – font size. The size can be selected from the list or entered manually.
- Script – font encoding selected from the list of available ones.
- Preview window – here we can see the final text appearance after applying the settings.
- Bold – enable/disable display of an element in bold.
The styler quickly brings a source code design in line with the recommended standard. This makes the code look professional and easy to read.
In this section you can specify settings for the styler:
- Style – the style that will be used to format the code. Multiple variants are available, including the recommended MetaQuotes style, Linux, Java, GNU and other styles.
- Spaces per indentation – the number of spaces to be inserted at the beginning of a new line to align nested constructions.
- Convert tabs to spaces – if this option is enabled, the styler will replace each tab character with one space.
- Delete empty lines – the styler can remove all lines having only space characters, tabs or line breaks.
- Insert spaces after commas and semicolons – when this option is enabled, the styler will visually separate constructions with element enumerations:
// before styler
// after styler
for(int i=0; i<total; i++)
- Insert spaces around statement operators – when this option is enabled, the styler will insert spaces around the assignment, equality, comparison, and other operators. For example:
// before styler
// after styler
if(x == 1 & y != 2)
int a = 0;
You do not necessarily need to use an external editor for multilingual projects. C/C++ and Python projects can be managed straight from MetaEditor.
If appropriate compilers are installed on your PC, MetaEditor will detect them and add to settings. Optionally, you can specify paths to required components under the Compilers tab. From the same tab, you can download the components by clicking Install next to the appropriate field.
After that you can work with C/C++ and Python projects similarly to MQL5 programs.
This tab allows you to configure general debugging and program profiling options.
The following settings are available here:
- Use specified settings – enable/disable the use of certain settings for debugging and profiling programs. When starting debugging or profiling, the program will be launched on a chart with a specified symbol and period. When debugging on history, these parameters are used for visual testing. If this option is disabled, all the fields below are not editable.
- Symbol – symbol chart to be used for debugging/profiling of programs.
- Period – chart period to be used when debugging/profiling programs.
- Date – period used to check a program when debugging in history. A visual testing is launched in the strategy tester on this period.
- Execution – strategy tester allows you to emulate network delays during an Expert Advisor operation in order to bring testing closer to real conditions. A certain time delay is inserted between placing a trade request and its execution in the strategy tester. From the moment of sending a request till its execution, the price can change. This allows you to evaluate how trade processing speed affects the trading results. Select a delay to be used when debugging on history: no delay, a fixed value (one of the predefined values or a custom one) or a random value. For more information, please read the trading platform user guide.
- Tick generation mode – used for debugging on history. For more information, please read the trading platform user guide.
- Every tick – most accurate but the slowest mode. It simulates all ticks.
- 1 minute OHLC – in this mode only 4 prices (Open, High, Low and Close) of each minute bar are emulated.
- Open prices only – in this mode, OHLC prices are also simulated, however only the open price is used for testing/optimization.
- Deposit – initial deposit currency and amount for debugging on history. Please note that cross rates for converting profit and margin to the specified deposit currency must be available on the account, to ensure proper debugging. Only symbols with the "Forex" or "Forex No Leverage" calculation type can be used as cross rates.
- Leverage – leverage used for debugging on history data.
- Profit in pips – if this option is enabled, profit during debugging and profiling in the tester will be calculated in pips instead of money. This mode accelerates testing while there is no need to recalculate profit to deposit currency using conversion rates (and thus there is no need to download the appropriate price history). Swap and commission calculations are eliminated in this mode. Please note that when calculating profit in pips, the deal volume does not matter. Only the number of won/lost pips is calculated for each deal. Also margin control is not performed in this mode.
If no symbol and chart period for debugging/profiling are specified on this tab, the first symbol of the Market Watch window on H1 timeframe is used by default.
Trading platform and MetaEditor are tightly integrated with MQL5.community – a community of MQL5 developers. The MQL5.community provides unique services for traders and developers:
- Market – you can purchase any ready-made application in the store of MQL4/MQL5 programs. Before purchasing, you can download a trial version and test it in the strategy tester.
- MQL5 Cloud Network is a powerful distributed computing network available for testing and optimization of Expert Advisors in the Strategy Tester. Thousands of optimization sessions can now be performed in minutes. In addition to using the network, you can provide your own computing capacities and earn.
- MQL5 Storage – personal storage of source codes integrated into the MetaEditor. Keep your code safe and access it from anywhere in the world. The MQL5 Storage features will be expanded soon to allow multiple users to remotely work on one project.
- Freelance – if you cannot find the desired application in the Code Base or Market, order one from a professional developer in the Freelance section of MQL5.community website.
- Code Base – download any code published in the Code Base of MQL5.community website. The code is automatically placed in the correct directory and compiled.
- Articles – various useful MQL5.community articles about MQL5 programming language and the platform have been published on the MQL5.community website. Find the necessary data by article headers and descriptions conveniently listed in a separate tab of the Toolbox window.
Enter your account detail and get access to all the unique services of the MQL5.community:
- Login – MQL5.community account.
- Password – a password to the specified account.
- The password is stored on the hard drive in an encrypted form.
- Login and password are case sensitive. They should accurately match your login on MQL5.community website.
- If you do not have an MQL5.community account, please register and get access to unique opportunities.