
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
New MetaTrader 5 Platform Build 1495: Improvements in MQL5 for working with custom graphics
MetaTrader 5 platform update is to be released on December 9, 2016. It contains the following changes:
- MQL5: Added the CopyTicksRange function.
- MQL5: Added improved anti-aliasing functions to CCanvas class:
- CircleWu
- EllipseWu
- LineWu
- PolygonWu
- PolylineWu
- TriangleWu
- MQL5: Added description of the graphical library
to the MQL5 Reference. The library allows to quickly create histograms,
distributions and line graphs right on the price charts.
- MQL5: Added the identifiers of the state of system keys to the list of constants of Client Terminal Properties. A call to TerminalInfoInteger(TERMINAL_KEYSTATE_XXX) returns the same state code of a key as the GetKeyState() function in MSDN.
- MQL5: Disabled the support for casting of string type to bool. To
check strings, one needs to use explicit conditions. For example, in the
new build, compilation of the following code will result in an error:
- Fixed errors reported in crash logs.
The update will be available through the LiveUpdate system.One should use an explicit condition:
New MetaTrader 5 build 1525: Representing trading history as positions and tester improvements
The MetaTrader 5 platform update will be released on Friday, January 27, 2017. The new version features the following changes:
On hedging accounts, the new history form is similar to the account history used in MetaTrader 4.
Declaration of the resource variable
Features
Examples of Use
If false, drawing of any price chart attributes is disabled and all chart border indents are eliminated, including time and price scales, quick navigation bar, Calendar event labels, trade labels, indicator and bar tooltips, indicator subwindows, volume histograms, etc.
Disabling the drawing is a perfect solution for creating a custom program interface using graphical resources.
The graphical objects are always drawn regardless of the CHART_SHOW property value.
Functions ChartGetInteger and ChartSetInteger allow getting and setting the property.
New properties for working with memory
Four new properties can be received through CLGetInfoIntegrer:
bool CLExecutionStatus(int kernel)
Returns the OpenCL program execution status. The OpenCL program kernel handle is passed as the parameter.
bool CLSetKernelArgMemLocal(int kernel_handle,int arg_index,ulong local_mem_size)
Sets the local buffer as an argument of the kernel function. The OpenCL program kernel handle, the number of the OpenCL function argument and the buffer size are passed as parameters.
{
if(id==CHARTEVENT_KEYDOWN)
{
short sym=TranslateKey((int)lparam);
//--- if the entered character is successfully converted to Unicode
if(sym>0)
Print(sym,"'",ShortToString(sym),"'");
else
Print("Error in TranslateKey for key=",lparam);
}
}
The update will be available through the LiveUpdate system.
Forum on trading, automated trading systems and testing trading strategies
New MetaTrader 5 Platform Build 1545: Fast switching between windows and changing price values with the mouse wheel
MetaQuotes Software Corp., 2017.02.15 16:39
New MetaTrader 5 Platform Build 1545: Fast switching between windows and changing price values with the mouse wheel
The MetaTrader 5 platform update will be released on February 17, 2017. The update will feature the following changes:
The update will be available through the LiveUpdate system.
Forum on trading, automated trading systems and testing trading strategies
New MetaTrader 5 Platform Build 1570: Improved Market showcase and extended MQL5 template functions
MetaQuotes Software Corp., 2017.03.22 17:03
New MetaTrader 5 Platform Build 1570: Improved Market showcase and extended MQL5 template functions
MetaTrader 5 platform update is to be released on March 24, 2017. The update will feature the following changes:
As a result of the code execution, we can see that the Assign() template function has been used for the int+string pair, while the overloaded version has already been used for the bool+string pair during the second call.
Thus, typification is performed by explicit specification of types rather than via the call parameters.
The update will be available through the LiveUpdate system.
Forum on trading, automated trading systems and testing trading strategies
New MetaTrader 5 Platform Build 1595: Access to the price history
MetaQuotes Software Corp., 2017.04.19 17:10
New MetaTrader 5 Platform Build 1595: Access to the price history
The MetaTrader 5 platform update will be released on April 21, 2017. The update will feature the following changes:
To download the data, open the symbol management dialog from the context menu of the "Market Watch" window:

The dialog features two new tabs: "Bars" and "Ticks". Select the symbol, the desired time interval and click "Request". The platform will request from the server all available data, and will immediately display the data if they have already been downloaded. Saved price data can be exported to a CSV file.The update will be available through the LiveUpdate system.
Forum on trading, automated trading systems and testing trading strategies
New MetaTrader 5 Platform Build 1640: Creating and testing custom symbols
MetaQuotes Software Corp., 2017.07.19 18:15
New MetaTrader 5 Platform Build 1640: Creating and testing custom symbols
MetaTrader 5 platform update is to be released on July 21, 2017. The update will feature the following changes:
Creating a Custom Symbol
Open the symbol management window using the context menu of the "Market Watch" window and click on "Create Custom Symbol":

A large number of symbol parameters can be configured. The full list of parameters and their description is available in the documentation. You can quickly configure your custom symbol by copying parameters of any similar instrument and modifying them. Select an existing symbol in the "Copy from" field.Managing Custom Symbols
All symbols are displayed in a separate Custom group. If you need to modify or delete a symbol, use the context menu of the list:
Importing the Price History
You can import price data to your custom symbol from any text file. Choose a symbol and go to the "Bars" tab.

In the import dialog, specify the path to the file and set the required parameters:A file with 1-minute bars should have the following format: Date Time Open High Low Close TickVolume Volume Spread. For example;
2016.06.27 00:02:00 1.10070 1.10165 1.10070 1.10165 32 55575000 46
2016.06.27 00:03:00 1.10166 1.10166 1.10136 1.10163 13 13000000 46
2016.06.27 00:04:00 1.10163 1.10204 1.10155 1.10160 23 51000000 41
Using Custom Symbols
Use of custom symbols is similar to the use of instruments provided by the broker. Custom symbols are displayed in the Market Watch window; you can open charts of such symbols and apply indicators and analytical objects on them. Custom symbols cannot be traded.
Testing Strategies on Custom Symbols
Custom symbols can be used for testing trading robots and indicators in the strategy tester. This allows for optimization of strategies even for the financial symbols a broker is currently unable to provide. You just need to import history correctly and configure the custom symbol properties.

When calculating the margin and profit, the strategy tester automatically uses available cross rates. Suppose that we have created AUDCAD.custom symbol with the Forex type of margin calculation, and our account currency is USD. In this case, the tester searches for the necessary symbols in the following order based on the Forex symbol name:Instruments with other types of margin calculation (CFD, Futures and Stock Exchange) require a currency pair to convert the instrument currency into the deposit one. Suppose that we have created a custom symbol with profit and margin currency expressed in GBP, while the deposit currency is CHF. In this case, the search for testing symbols is performed in the following order:
When testing applications using custom instruments, make sure that the trading account has all the necessary currency pairs. Otherwise, the calculation of financial results and margin requirements during testing will not be possible.
More possibilities will be available in future platform versions
The development of custom symbols has not completed yet, and more functions will be added in the next builds of the platform. You will be able to import history to custom symbols straight from Expert Advisors, as well as broadcast data (add quotes) of such symbols in real time.
Deals with the volume less than the specified value can be hidden from the Time & Sales table. If this filter is applied, only large deals will appear in the Time & Sales window.
Double click on the first line in the Time & Sales window, specify the minimum volume in lots, and then click on any other area of the Market Depth. Trades will be filtered, and the current filter value will appear in the volume column header.

You can also specify the minimum volume using the Time & Sales context menu.When profiling based on real data, the program is launched in a normal chart of the terminal. Many programs, especially indicators, only perform calculations at the arrival of a new tick (OnTick, OnCalculate). Thus, in order to evaluate performance, you have to wait for new ticks in real time. If you test a program using history data, you can immediately provide the required load. Profiling is launched in the visual mode in the Strategy Tester, and you receive a lot of new tick events at a time.
Unlike the structure, various union members belong to the same memory area. In this example, the union of LongDouble is declared with long and double type values sharing the same memory area. Please note that it is impossible to make the union store a long integer value and a double real value simultaneously (unlike a structure), since long_value and double_value variables overlap (in memory). On the other hand, an MQL5 program is able to process data containing in the union as an integer (long) or real (double) value at any time. Therefore, the union allows receiving two (or more) options for representing the same data sequence.
During the union declaration, the compiler automatically allocates the memory area sufficient to store the largest type (by volume) in the variable union. The same syntax is used for accessing the union element as for the structures, i.e. the point operator.
Memberwise copying of objects is performed in the implicit operator.
If necessary, you can override the behavior and create your own option instead of an implicit copy operator, using overloading.
New properties
Order, deal and position creation reasons
Three variables have been added for obtaining the reasons for the creation of trading operations:

To jump to a breakpoint, double-click on it.Forum on trading, automated trading systems and testing trading strategies
MetaTrader 5 Build 1700: Synthetic Instruments, Shared Projects and MQL5 Cloud Protector
MetaQuotes Software Corp., 2017.12.05 14:33
Long-awaited release of the platform which incorporates brand new features. Be among the first users to share the new experience.
The beta version of the updated MetaTrader 5 platform will be released on 6 December 2017. We will update our public MetaQuotes-Demo server located at access.metatrader5.com:443. We invite all traders to join testing in order to evaluate the updated platform features and to help developers fix errors.
To update the MetaTrader 5 platform up to build 1700, connect to access.metatrader5.com server:443.
The final build of the new MetaTrader 5 platform will be released after the public beta test.
Support for older versions of desktop and mobile terminals will end upon the release of the new platform version:
MQL5 Storage Operation Protocol Changes
To support new shared projects, we have updated the protocol of operation with the MQL5 Storage. Therefore, you will need to perform a checkout of all data from the storage after the platform update. Data stored at the MQL5 Storage will not be lost or affected during the update.
Before updating the platform to the new version, we recommend that you perform the Commit operation to send all local changes to the MQL5 Storage.
The update will feature the following changes:
Now the main MQ5 program file does not appear as the project. The project is a separate "MQPROJ" file, which stores program settings, compilation parameters and information about all used files. Main project settings can be accessed from a separate dialog box, so there is no need to specify them in the source code via #property now.
A separate tab in the Navigator is provided for a convenient work with the project. All files, such as include, resource, header and other files are arranged into categories on this tab. All files are automatically added to the project navigator. For example, if you include a new MQH file, it will automatically appear in the "Dependencies" section of the navigator.
Support for new projects has also been implemented in the updated MQL5 Storage online repository. It is a convenient option for developing large projects through collaboration with other members of the MQL5.community.
New Shared Projects section is provided for group projects. A project created in this section is immediately sent to the storage: you can grant permissions to other users and start collaboration right away.
When you compile a project in Shared Projects, an executable EX5 file is automatically copied to the local Experts, Indicators or Scripts directory depending on the program type. You can easily launch the program on a chart without having to copy files manually.What's New in the MQL5 Storage Operation
To implement support for new shared projects, we have modified the protocol of operation with the MQL5 Storage. Therefore, you will need to perform a checkout of all data from the storage after the platform update. Data stored at the MQL5 storage will not be lost or affected during the update.
New Projects: Examples of Creation and Operation Details
A new project entity has been added in MetaEditor. A project is an mqproj file that stores common program properties and information about all used files. Now, program properties can be conveniently managed from a separate MetaEditor dialog instead of manual modification of properties in the source code (using #property directives).
If you have available code, you can easily test new projects by using the 'New Project from Source' command.
In the directory where the selected file is located, a new project file with the same name and the mqproj extension will be created. The main program properties specified in the source code via #property will be automatically added to the project, including the name, copyright, version, link to the developer's site and program description.
Two new options for compiling MQL5 programs have been added to project properties:To work with projects, use a separate Project tab in the Navigator window. All files used in a project are displayed on this tab in a convenient form. When a project is generated from a source file, all used include files (specified using the #include directory in the main MQ5 file and in its include files) are automatically added to the Dependencies section.
When a new include file is added to the source code, it also appears in the project Navigator. Used header files are added to the Headers section; images, sounds and other MQL5 programs used in the project as resource are added to the Resources section. MQ5 files with the source code are displayed in the Sources section. In the 'Settings and files' section, you can add other files, such as set files for testing and chart templates.
Use context menu commands to add existing files to a project or to delete files from it. Be careful when deleting files, since you can remove a file from the project (remove the binding) or completely delete it from the hard disk:

Creation of a new project is as easy as the creation of a normal MQL5 program. Click 'New Project', select the type of new program and specify properties (such as name, event handlers, etc) in the MQL5 Wizard.To obtain an executable EX5 file, you can open the project and press F7 (the compilation command) or open the main MQ5 file of the program and compile it.
Shared Projects in MQL5 Storage: Operation Details
Shared projects are managed from a separate Shared Projects section. If you have not connected the storage yet, execute the 'Activate MQL5 Storage' command from the context menu of the desired folder. MetaEditor will check if your storage contains any saved data and if there are any share projects available to you. All available data will be retrieved from the storage and uploaded to your computer (the checkout operation). Available group projects appear in the Shared Projects section. To retrieve the projects, execute "Checkout from Storage" in the context menu.
To create a new group project, select the Shared Projects folder and click "New Project":

Then complete standard MQL5 steps: set the type, name and properties of the desired program. For group projects, you should use clear and understandable names, so that other participants could easily find them. Only Latin letters without spaces can be used in project names.A created object is immediately added to the MQL5 Storage. Standard Library files used in the project are not added to the storage, and you can add them manually.
To allow other participants to work with the project, open its properties. From here you can grant permissions to selected users by specifying their MQL5.community login, as well as set common parameters for the group work:

When you compile a group project, the executable EX5 file is automatically copied to the local Experts, Indicators or Scripts directory depending on the program type. It allows you to instantly run the program in the terminal without having to copy it manually to the proper directory.How It Works
Note: the USDEUR and USDGBP pairs are used in the source dollar index formula. Since only reverse pairs are available in the platform, a negative power and Ask instead of Bid are used in the synthetic symbol formula.
The platform will calculate in real time the price of the new instrument based on the quotes of the other six symbols provided by your broker. The price changes will be visualized in the Market Watch window and on the chart:

Create a new custom symbol, open its specification and enter the formula:

For convenience, the formula editor shows a list of possible options as you type the names of symbols and functions.Calculation of ticks and one-minute bars of a synthetic instrument starts when this instrument is added to the Market Watch. Also, all symbols required for the synthetic price calculation are automatically added to the Market Watch. An entry about the calculation start will be added to the platform journal: Synthetic Symbol USDX: processing started.
Real-Time Calculation of Quotes
Every 100 ms (i.e. ten times per second) the prices of symbols used in calculation are checked. If at least one of them has changed, the price of the synthetic symbol is calculated and a new tick is generated. Calculation is performed in parallel in three threads for Bid, Ask and Last prices. For example, if the calculation formula is EURUSD*GBPUSD, the price of the synthetic symbol will be calculated as follows:
The availability of changes is checked separately for each price. For example, if only the Bid price of a source instrument has changed, only the appropriate price of a synthetic instrument will be calculated.
Creating a History of Minute Bars
In addition to collecting ticks in real time, the platform creates a minute history of the synthetic instrument. It enables traders to view synthetic symbol charts similar to normal ones, as well as to conduct technical analysis using objects and indicators.
When a trader adds a synthetic instrument to the Market Watch, the platform checks whether its calculated minute history exists. If it does not exist, the history for the last 60 days will be created, which includes about 50,000 bars. If a lower value is specified in the 'Max. bars in chart' parameter in platform settings, the appropriate restriction will apply.
If some of bars within this period have already been created, the platform will additionally generate new bars. A deeper history is created if the user tries to view an older time period on the chart (by scrolling it back or accessing it from an MQL5 program).
The history of one-minute bars of a synthetic instrument is calculated based one one-minute bars (not ticks) of instruments used in its formula. For example, to calculate the Open price of a 1-minute bar of a synthetic symbol, the platform uses the Open prices of symbols used in its formula. High, Low and Close prices are calculated in a similar way.
If the required bar is not available for any of the instruments, the platform will use the Close price of the previous bar. For example, three instruments are used: EURUSD, USDJPY and GBPUSD. If in the calculation of a bar corresponding to 12:00 the required bar of USDJPY is not available, the following prices will be used for calculation:
If the minute bar is not available for all of the instruments used in the formula, the appropriate minute bar of the synthetic instrument will not be calculated.
Drawing New Minute Bars
All new bars (current and subsequent ones) of the synthetic instrument are created based on generated ticks. The price used for building the bars depends on the value of the Chart Mode parameter in the specification:
What Operations Can Be Used in the Symbol Formula
Price data and some properties of existing symbols provided by the broker can be used for calculating synthetic prices. Specify the following:
Mind the calculation priority of arithmetic operations:
You can use constants in the formula:
You can also use in the formula all mathematical functions supported in MQL5, except for MathSrand, MathRand and MathIsValidNuber: Only short names are used for all functions, such as fabs(), acos(), asin() etc.
The CustomTicksAdd function allows feeding quotes as if these quotes were received from a broker's server. Data is sent to the Market Watch window instead of being directly written to the tick database. Then, the terminal saves ticks from the Market Watch to the database. If a large volume of data is passed in one call, the function behavior changes, in order to save resources. If more than 256 ticks are transmitted, data is divided into two parts. A larger part is recorded directly to the tick database (similar to CustomTicksReplace). The second part consisting of the last 128 ticks is sent to the Market Watch, from where the terminal saves the ticks to a database.
Now, this type of protection is available to all platform users. To protect your files, execute the following command in MetaEditor: Tools—MQL5 Cloud Protector. The only difference of MQL5 Cloud Protector from the mechanism used in the Market, is that the file is not linked to the user's computer. Protected via MQL5 Cloud Protector files can be run on any computers similar to common EX5 files.
If a symbol chart is constructed using Bid prices (as per specification settings), Bid High and Bid Low prices are shown for this symbol. If a symbol chart is constructed using Last prices, Last High and Last Low prices are shown for this symbol.
If Market Watch contains at least one symbol whose chart is drawn based on Last prices, the Last column is automatically enabled in addition to High/Low.

For convenience, modified entries are highlighted as follows:To save the changes, click "Apply Changes" at the bottom of the window.
The function accepts dynamic arrays of the same type and the same dimensions. For multidimensional arrays, the number of elements in all dimensions except the first one should match.

The same menu allows adding to program code files in the form of a binary or text array. Among others, you can transfer chart templates with Expert Advisors or indicators: insert your template in the program code as an array, and save it to disk then using the FileSave function. After that the template can be applied on the desired chart right from an Expert Advisor using the ChartApplyTemplate function.The update will be available through the LiveUpdate system.
Forum on trading, automated trading systems and testing trading strategies
New MetaTrader 5 Build 1730: Projects in MetaEditor and Synthetic financial instruments
MetaQuotes Software Corp., 2017.12.20 13:49
New MetaTrader 5 Build 1730: Projects in MetaEditor and Synthetic financial instruments
The MetaTrader 5 platform update will be released on December 21, 2017.
Support for older versions of desktop and mobile terminals will end upon the release of the new platform version:
MQL5 Storage Operation Protocol Changes
To support new shared projects, we have updated the protocol of operation with the MQL5 Storage. Therefore, you will need to perform a checkout of all data from the storage after the platform update. Data stored at the MQL5 Storage will not be lost or affected during the update.
Before updating the platform to the new version, we recommend that you perform the Commit operation to send all local changes to the MQL5 Storage.
The update will feature the following changes:
Full-featured projects are now available in MetaEditor. The program development process has become more convenient.
Now the main MQ5 program file does not appear as the project. The project is a separate "MQPROJ" file, which stores program settings, compilation parameters and information about all used files. Main project settings can be accessed from a separate dialog box, so there is no need to specify them in the source code via #property now.
A separate tab in the Navigator is provided for work convenience within the project. All files, such as include, resource, header and other files are arranged into categories on this tab. All files are automatically added to the project navigator. For example, if you include a new MQH file, it will automatically appear in the "Dependencies" section of the navigator.
Support for new projects has also been implemented in the updated MQL5 Storage online repository. Now, it has become much more convenient to develop large projects through collaboration with other members of the MQL5.community.
New Shared Projects section is provided for group projects. A project created in this section is immediately sent to the storage: you can grant permissions to other users and start collaboration right away.
When you compile a project in Shared Projects, an executable EX5 file is automatically copied to the local Experts, Indicators or Scripts directory depending on the program type. You can easily launch the program on a chart without having to copy files manually.
What's New in the MQL5 Storage Operation
To implement support for new shared projects, we have modified the protocol of operation with the MQL5 Storage. Therefore, you will need to perform a checkout of all data from the storage after the platform update. Data stored at the MQL5 storage will not be lost or affected during the update.
The 'Checkout from Storage' command is unavailable now. Instead, the 'Activate MQL5 Storage' and 'Update from Storage' commands are used to receive data:
New Projects: Examples of Creation and Operation Details
A new project entity has been added in MetaEditor. A project is an mqproj file that stores common program properties and information about all used files. Now, program properties can be conveniently managed from a separate MetaEditor dialog instead of manual modification of properties in the source code (using #property directives).
If you have available code, you can easily test new projects by using the 'New Project from Source' command.
In the directory where the selected file is located, a new project file with the same name and the mqproj extension will be created. The main program properties specified in the source code via #property will be automatically added to the project, including the name, copyright, version, link to the developer's site and program description.
Two new options for compiling MQL5 programs have been added to project properties:
To work with projects, use a separate Project tab in the Navigator window. All files used in a project are displayed on this tab in a convenient form. When a project is generated from a source file, all used include files (specified using the #include directory in the main MQ5 file and in its include files) are automatically added to the Dependencies section.
When a new include file is added to the source code, it also appears in the project Navigator. Used header files are added to the Headers section; images, sounds and other MQL5 programs used in the project as resource are added to the Resources section. MQ5 files with the source code are displayed in the Sources section. In the 'Settings and files' section, you can add other files, such as set files for testing and chart templates.
Use context menu commands to add existing files to a project or to delete files from it. Be careful when deleting files, since you can remove a file from the project (remove the binding) or completely delete it from the hard disk:
Creation of a new project is as easy as the creation of a normal MQL5 program. Click 'New Project', select the type of new program and specify properties (such as name, event handlers, etc) in the MQL5 Wizard.
To obtain an executable EX5 file, you can open the project and press F7 (the compilation command) or open the main MQ5 file of the program and compile it.
Shared Projects in MQL5 Storage: Operation Details
Shared projects are managed from a separate Shared Projects section. If you have not connected the storage yet, execute the 'Activate MQL5 Storage' command from the context menu of the desired folder. MetaEditor will check if your storage contains any saved data and if there are any share projects available to you. All available data will be retrieved from the storage and uploaded to your computer (the checkout operation). Available group projects appear in the Shared Projects section. To retrieve the projects, execute "Checkout from Storage" in the context menu.
To create a new group project, select the Shared Projects folder and click "New Project":
Then complete standard MQL5 steps: set the type, name and properties of the desired program. For group projects, you should use clear and understandable names, so that other participants could easily find them. Only Latin letters and numbers without spaces can be used in project names.
A created object is immediately added to the MQL5 Storage. Standard Library files used in the project are not added to the storage, and you can add them manually.
To allow other participants to work with the project, open its properties. From here you can grant permissions to selected users by specifying their MQL5.community login, as well as set common parameters for the group work:
When you compile a group project, the executable EX5 file is automatically copied to the local Experts, Indicators or Scripts directory depending on the program type. It allows you to instantly run the program in the terminal without having to copy it manually to the proper directory.
Public Projects in MQL5 Storage: Participation in Development
As mentioned above, each group project in MQL5 Storage has publicity settings: the project can be private or open to other users. Now, all projects you can freely join are displayed in the separate "Public Projects" tab.
Everyone can find an exciting project and take part in its development. Simply click Join and receive the project from the storage.

Each joined user gets read-only rights. Contact the project author to be able to submit your changes. To know his or her login, open the project properties via the context menu.Terminal: Now, the trading platform allows creating synthetic financial instruments, i.e. symbols based on one or more existing instruments. The user should set the formula for calculating quotes, after which the platform will generate ticks of the synthetic instrument in real time, and also will create its minute history.
How It Works
For example, you can create an instrument showing the dollar index (USDX). It uses the below formula:
Note: the USDEUR and USDGBP pairs are used in the source dollar index formula. Since only reverse pairs are available in the platform, a negative power and Ask instead of Bid are used in the synthetic symbol formula.
The platform will calculate in real time the price of the new instrument based on the quotes of the other six symbols provided by your broker. The price changes will be visualized in the Market Watch window and on the chart:

Create a new custom symbol, open its specification and enter the formula:

For convenience, the formula editor shows a list of possible options as you type the names of symbols and functions.Calculation of ticks and one-minute bars of a synthetic instrument starts when this instrument is added to the Market Watch. Also, all symbols required for the synthetic price calculation are automatically added to the Market Watch. An entry about the calculation start will be added to the platform journal: Synthetic Symbol USDX: processing started.
Real-Time Calculation of Quotes
Every 100 ms (i.e. ten times per second) the prices of symbols used in calculation are checked. If at least one of them has changed, the price of the synthetic symbol is calculated and a new tick is generated. Calculation is performed in parallel in three threads for Bid, Ask and Last prices. For example, if the calculation formula is EURUSD*GBPUSD, the price of the synthetic symbol will be calculated as follows:
The availability of changes is checked separately for each price. For example, if only the Bid price of a source instrument has changed, only the appropriate price of a synthetic instrument will be calculated.
Creating a History of Minute Bars
In addition to collecting ticks in real time, the platform creates a minute history of the synthetic instrument. It enables traders to view synthetic symbol charts similar to normal ones, as well as to conduct technical analysis using objects and indicators.
When a trader adds a synthetic instrument to the Market Watch, the platform checks whether its calculated minute history exists. If it does not exist, the history for the last 60 days will be created, which includes about 50,000 bars. If a lower value is specified in the 'Max. bars in chart' parameter in platform settings, the appropriate restriction will apply.
If some of bars within this period have already been create, the platform will additionally generate new bars. A deeper history is created if the user tries to view an older time period on the chart (by scrolling it back or accessing it from an MQL5 program).
The history of one-minute bars of a synthetic instrument is calculated based one one-minute bars (not ticks) of instruments used in its formula. For example, to calculate the Open price of a 1-minute bar of a synthetic symbol, the platform uses the Open prices of symbols used in its formula. High, Low and Close prices are calculated in a similar way.
If the required bar is not available for any of the instruments, the platform will use the Close price of the previous bar. For example, three instruments are used: EURUSD, USDJPY and GBPUSD. If in the calculation of a bar corresponding to 12:00 the required bar of USDJPY is not available, the following prices will be used for calculation:
If the minute bar is not available for all of the instruments used in the formula, the appropriate minute bar of the synthetic instrument will not be calculated.
Drawing New Minute Bars
All new bars (current and subsequent ones) of the synthetic instrument are created based on generated ticks. The price used for building the bars depends on the value of the Chart Mode parameter in the specification:
What Operations Can Be Used in the Symbol Formula
Price data and some properties of existing symbols provided by the broker can be used for calculating synthetic prices. Specify the following:
Mind the calculation priority of arithmetic operations:
You can use constants in the formula:
You can also use in the formula all mathematical functions supported in MQL5, except for MathSrand, MathRand and MathIsValidNumber: Only short names are used for all functions, such as fabs(), acos(), asin() etc.
The CustomTicksAdd function allows feeding quotes as if these quotes were received from a broker's server. Data is sent to the Market Watch window instead of being directly written to the tick database. Then, the terminal saves ticks from the Market Watch to the database. If a large volume of data is passed in one call, the function behavior changes, in order to save resources. If more than 256 ticks are transmitted, data is divided into two parts. A larger part is recorded directly to the tick database (similar to CustomTicksReplace). The second part consisting of the last 128 ticks is sent to the Market Watch, from where the terminal saves the ticks to a database.
Now, this type of protection is available to all platform users. To protect your files, execute the following command in MetaEditor: Tools—MQL5 Cloud Protector. The only difference of MQL5 Cloud Protector from the mechanism used in the Market, is that the file is not linked to the user's computer. Protected via MQL5 Cloud Protector files can be run on any computers similar to common EX5 files.
If a symbol chart is constructed using Bid prices (as per specification settings), Bid High and Bid Low prices are shown for this symbol. If a symbol chart is constructed using Last prices, Last High and Last Low prices are shown for this symbol.
If Market Watch contains at least one symbol whose chart is drawn based on Last prices, the Last column is automatically enabled in addition to High/Low.

For convenience, modified entries are highlighted as follows:To save the changes, click "Apply Changes" at the bottom of the window.
Traders can send a request to a broker to open a real account straight from desktop terminals. The user needs to fill in a simple request form with contact details. A special preliminary account is created for the trader after that. Then, the broker contacts the trader to formalize relations and turn the real account from the preliminary one.
MQL5: Added Generic Data Collections to the Standard Library. They contain classes and interfaces for defining collections based on templates. The new strongly typed collections provide a greater application development convenience and high data handling performance.
The library is placed to the Include\Generic folder of the terminal's working directory.
The function accepts dynamic arrays of the same type and the same dimensions. For multidimensional arrays, the number of elements in all dimensions except the first one should match.
The terminal does not calculate this value. It is requested from the operating system once per minute. It is not an indication of the connection quality between a particular terminal and a trade server, since the percentage is calculated for the entire network activity, including system and background activity.
The TERMINAL_RETRANSMISSION property is added to the ENUM_TERMINAL_INFO_DOUBLE enumeration, the TerminalInfoDouble function is used to obtain it.

The same menu allows adding to program code files in the form of a binary or text array. Among others, you can transfer chart templates with Expert Advisors or indicators: insert your template in the program code as an array, and save it to disk then using the FileSave function. After that the template can be applied on the desired chart right from an Expert Advisor using the ChartApplyTemplate function.The update will be available through the Live Update system.
Forum on trading, automated trading systems and testing trading strategies
New MetaTrader 5 Platform Build 1745
MetaQuotes Software Corp., 2018.01.11 13:58
New MetaTrader 5 Platform Build 1745
The MetaTrader 5 platform update will be released on January 12, 2018.
MetaTrader 5 build 1745 will be the last platform version supporting Microsoft Windows XP/2003/Vista
A few months ago, we announced end of support for older versions of operating systems. Windows 2003, Windows Vista and especially Microsoft Windows XP are outdated operating systems. Microsoft ended support for Windows XP three years ago, because potential hardware capabilities could no longer be realized on this system due to technical limitations.
MetaTrader 5 build 1745 and older versions will continue to work on the above operating systems, but will no longer receive updates. Platform installers will not run on these operating systems.
The minimum required operating system version for running MetaTrader 5 is Windows 7. However, we strongly recommend using the 64-bit version of Windows 10.
The new version features the following changes:
- Terminal: The /auto key has been added to the installer, allowing to install the program in automated mode without additional actions required from the user. When the installer is launched with this key, installation settings will not be shown to the user, and the terminal will be installed at the standard path, with the standard Start menu folder name for the program. Example of such launch:
C:\mt5setup.exe /auto
- Terminal: Fixed installer operation in cases when the user does not have appropriate operating system permissions.
- Terminal:
Fixed excessive consumption of CPU resources when no actions are
performed in the terminal (when there are no open charts and no actions
are performed by the user).
- Terminal: The new version features automatic compression of *.log files at the file system level. The new functionality allows reducing the amount of disk space used by logs.
- Tester:
The amount of cache during single test runs has been increased. This
provides faster testing in 64-bit operating systems.
- Tester: Fixed optimization of trading robots using the MQL5 Cloud Network. Issues could arise with products purchased from the MetaTrader Market.
- Tester: Fixed calculation of spreads for bars generated in the "Every Tick" testing mode.
- Tester:
Fixed selection of OpenCL devices in the strategy tester. Now, the
visual tester is allowed to access all available OpenCL devices.
- Tester: The new version features automatic compression of *.log files at the file system level. The new functionality allows reducing the amount of disk space used by logs.
- MQL5: Fixed deletion of bars of a custom symbol using the CustomRatesDelete method.
- Fixes based on crash reports.
- Updated documentation.
The update is available through the LiveUpdate system.