MetaTrader 5 Platform Beta Build 1995: Economic Calendar, MQL5 applications as services and R language API

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
204838
MetaQuotes Software Corp.  

The beta version of the updated MetaTrader 5 platform will be released on February 15, 2019. We invite traders to join testing and to evaluate updated platform features, as well as help developers fix errors.

To update the MetaTrader 5 platform up to build 1995, navigate to Help \ Check Desktop Updates \ Latest Beta Version:

The final build of the new MetaTrader 5 platform will be released after the completion of public beta testing.

The new version features the following changes:

  1. Terminal: Completely revised built-in Economic Calendar.

    The Economic Calendar is our proprietary solution. Therein you will find over 600 financial news and indicators related to the 13 largest global economies: USA, European Union, Japan, UK, Canada, Australia, China among others. Relevant data is collected from open sources in real time.

    The new version features updated contents and advanced event filters: by time, priority, currencies and countries.

    The possibility to access the calendar data from MQL5 programs will be implemented soon.




  2. Terminal: Added new type of MQL5 applications — Services. This new type enables the creation of custom price feeds for the terminal, i.e. to implement price delivery from external systems in real time, just like it is implemented on brokers' trade servers.

    Unlike Expert Advisors, indicators and scripts, services are not linked to a specific chart. Such applications run in the background and are launched automatically when the terminal is started (unless such an app was forcibly stopped).

    Services can be managed from a new section within the Navigator window:




    How to create services
    To create a service template, use the corresponding MQL5 Wizard option. Services have one OnStart entry point, similar to scripts. At this point, you can implement an endless data receiving and handling cycle using network functions.

    How to launch the services
    To run multiple Expert Advisor or indicator copies with different parameters, you should launch them on different charts. In this case different program instances are created, which then operate independently. Services are not linked to charts, therefore a special mechanism has been implemented for the creation of service instances.

    Select a service from the Navigator and click "Add service" in its context menu. This will open a standard MQL5 program dialog, in which you can enable/disable trading and access to signal settings, as well as set various parameters.




    A service instance can be launched and stopped using the appropriate instance menu. To manage all instances, use the service menu.

  3. Terminal: A learning program has been added.

    The new feature will help beginners in learning how to interact with the platform. We have added over 100 interactive tips concerning the main platform features.

    • Tips are seamlessly displayed as a progress bar on the toolbar and thus they do not distract the user.
    • Tips only appear for the actions which you have never performed in the platform.
    • All tips include interactive links, by which you can navigate to the relevant interface elements. For example, a trading dialog or a menu with the desired program can be launched straight from the tip.

    The filled area of the progress bar will increase whenever you perform appropriate actions and continue training.




  4. Terminal: The trading account history can be presented as positions. The platform collects data on deals related to the position (opening, volume increase, partial or full closing) and groups the information into a single record. Thus you can access position details: open and close time, volume, price and result. This efficient presentation form is now available in history reports exported to files.




  5. Terminal: Added new API enabling request of MetaTrader 5 terminal data through applications using the R language.

    We have prepared a special MetaTraderR package. It contains DLL for interactions between R and the MetaTrader 5 terminal, documentation and auxiliary r files. We are completing the package registration in the CRAN repository, after which it will be available for download and installation.




    The package can be installed using a special command:
    R CMD INSTALL --build MetaTraderR
    The following commands related to data request are available:

    • MT5Initialize initializes and establishes connection with the MetaTrader 5 terminal. If necessary, the terminal is launched during command execution.
    • MT5Shutdown de-initializes and disconnects from MetaTrader 5.
    • MT5Version gets the MetaTrader 5 terminal version.
    • MT5TerminalInfo gets the state and parameters of terminal connection to a broker's server (account number and server address).
    • MT5WaitTerminal sets a 2-minute waiting period for the MetaTrader 5 terminal to connect to a broker's server.
    • MT5CopyTicksFrom(symbol, from, count, flags) copies the specified number of ticks starting from the specified date. The date is specified in milliseconds since 01.01.1970.
    • MT5CopyTicksRange(symbol, from, to, flags) copies ticks from within the specified period. The dates are specified in milliseconds since 01.01.1970.
    • MT5CopyRatesFrom(symbol, timeframe, from, count) copies the specified number of one-minute bars starting from the specified date. The date is specified in seconds since 01.01.1970.
    • MT5CopyRatesFromPos(symbol, timeframe, start_pos, count) copies one-minute bars from the specified position relative to the last bar.
    • MT5CopyRatesFromRange(symbol, timeframe, date_from, date_to) copies bars from within the specified period. The dates are specified in seconds since 01.01.1970.

    The list of supported commands will be further expanded.

  6. Terminal: Optimized Close By dialog used for closing a position by an opposite one. Now, the dialog is not slowed down even if you have a large number of open positions.
  7. Terminal: Fixed synthetic symbol calculation errors, due to which data could be occasionally skipped.
  8. Terminal: When a custom symbol is deleted, files storing its tick and bar history are also deleted. This avoids the accumulation of unused data on the hard disk.
  9. MQL5: Fixes and operation speed improvements related to tick and bar history.
  10. MQL5: Fixes and significant operation speed improvements related to tick and bars history modification functions of custom trading symbols, CustomTicks* and CustomRates*.
  11. MQL5: New data conversion functions.

    CharArrayToStruct copies a uchar array to a POD structure.
    bool  CharArrayToStruct(
       void&         struct_object,    // structure
       const uchar&  char_array[],     // array
       uint          start_pos=0       // starting position in the array
       );

    StructToCharArray copies a POD structure to a uchar array.
    bool  StructToCharArray(
       const void&  struct_object,     // structure
       uchar&       char_array[],      // array
       uint         start_pos=0        // starting position in the array
       );

  12. Added MathSwap function for changing byte order in ushort, uint and ulong values.
    ushort MathSwap(ushort value);
    uint   MathSwap(uint   value);
    ulong  MathSwap(ulong  value);

  13. MQL5: Added network functions for creating TCP connections to remote hosts via system sockets:

    • SocketCreate creates a socket with specified flags and returns its handle
    • SocketClose closes the socket
    • SocketConnect connects to the server, with timeout control
    • SocketIsConnected checks if the socket is currently connected
    • SocketIsReadable gets the number of bytes which can be read from the socket
    • SocketIsWritable checks if data writing to this socket is possible at the current time
    • SocketTimeouts sets data receiving and sending timeouts for the system socket object
    • SocketRead reads data from a socket
    • SocketSend writes data to a socket
    • SocketTlsHandshake initiates a secure TLS (SSL) connection with the specified host using the TLS Handshake protocol
    • SocketTlsCertificate receives information concerning the certificate used for secure network connection
    • SocketTlsRead reads data from a secure TLS connection
    • SocketTlsReadAvailable reads all available data from a secure TLS connection
    • SocketTlsSend sends data using a secure TLS connection

    The address of the host, to which connection using network functions is established, must be explicitly added to the list of allowed addresses in terminal settings.
    New error codes have been added for operations with network functions:

    • ERR_NETSOCKET_INVALIDHANDLE (5270): invalid socket handle passed to the function
    • ERR_NETSOCKET_TOO_MANY_OPENED (5271): too many sockets open (maximum 128)
    • ERR_NETSOCKET_CANNOT_CONNECT (5272): error while connecting to remote host
    • ERR_NETSOCKET_IO_ERROR (5273): error while sending/receiving data from the socket
    • ERR_NETSOCKET_HANDSHAKE_FAILED (5274): secure connection establishment error (TLS Handshake)
    • ERR_NETSOCKET_NO_CERTIFICATE (5275): no data about certificate used for secure connection

  14. MQL5: Added new functions for string operations:

    StringReserve reserves for a string the memory buffer of the specified size.
    bool  StringReserve(
       string&        string_var,          // string
       uint           new_capacity         // buffer size for the string
       );
    StringSetLength sets the specified string length in characters.
    bool  StringSetLength(
       string&        string_var,          // string
       uint           new_length           // new string length
       );

  15. MQL5: Added new function for array operations:

    ArrayRemove removes from an array the specified number of elements starting with the specified index.
    bool  ArrayRemove(
       void&         array[],              // array of any type
       uint          start,                // the index to start removal
       uint          count=WHOLE_ARRAY     // number of elements
       );
    ArrayInsert inserts to a receiver array the specified number of elements from the source array, starting with the specified index.
    bool  ArrayInsert(
       void&         dst_array[],          // receiver array
       const void&   src_array[],          // source array
       uint          dst_start,            // index in the receiver array where to insert
       uint          src_start=0,          // index in the source array to start copying
       uint          count=WHOLE_ARRAY     // number of inserted elements
       );
    ArrayReverse reverses in an array the specified number of elements starting with the specified index.
    bool  ArrayReverse(
       void&         array[],              // array of any type
       uint          start=0,              // index to start reversing
       uint          count=WHOLE_ARRAY     // number of elements
       );

  16. MQL5: New "uint count" parameter has been added in functions CustomRatesUpdate, CustomRatesReplace, CustomTicksAdd and CustomTicksReplace. It allows specification of the number of elements of the passed array. The WHOLE_ARRAY value is used for the parameter by default. It means that the whole array will be urilized.
  17. MQL5: Added CustomBookAdd function to pass the status of the Depth of Market for a custom symbol. The function allows broadcasting the Depth of Market as if the prices arrive from a broker's server.
    int  CustomBookAdd(
       const string        symbol,            // symbol name
       const MqlBookInfo&  books[]            // an array with the DOM elements descriptions
       uint                count=WHOLE_ARRAY  // number of elements to be used
       );
  18. MQL5: Added CustomSymbolCreate function overloading. This allows the creation of a custom trading symbol based on an existing one. After creation, any symbol property can be edited using corresponding functions.
    bool  CustomSymbolCreate(
       const string        symbol_name,       // custom symbol name
       const string        symbol_path="",    // name of the group in which the symbol will be created
       const string        symbol_origin=NULL // name of the symbol based on which the custom symbol will be created
       );
    The name of the symbol, from which the properties of for the custom symbol should be copied, is specified in the "symbol_origin" parameter.

  19. The StringToTime function converting the string with date/time to a datetime value has been updated. Now it supports the following date formats:

    • yyyy.mm.dd [hh:mi]
    • yyyy.mm.dd [hh:mi:ss]
    • yyyymmdd [hh:mi:ss]
    • yyyymmdd [hhmiss]
    • yyyy/mm/dd [hh:mi:ss]
    • yyyy-mm-dd [hh:mi:ss]

  20. MQL5: New TERMINAL_VPS property in the ENUM_TERMINAL_INFO_INTEGER enumeration; it shows that the terminal is running on the MetaTrader Virtual Hosting server (MetaTrader VPS). If an application is running on a hosting server, you can disable all its visual functions, since the virtual server does not have a graphical user interface.
  21. MQL5: New SYMBOL_EXIST property in the ENUM_SYMBOL_INFO_INTEGER enumeration, means that the symbol under this name exists.
  22. MQL5: Fixed typing when using template function pre-declarations.
  23. MQL5: Added re-initialization of indicators when changing a trading account.
  24. MQL5: Optimized StringSplit function.
  25. MQL5: Fixed errors in the standard library operation.
  26. Tester: Added TesterStop function — routine early shutdown of an Expert Advisor on a test agent. Now you can forcibly stop testing after reaching the specified number of losing trades, a preset drawdown level or any other criterion.

    Testing completed using this function is considered successful. After the function call, the trading history obtained during testing and all trade statistics are passed to the terminal.

  27. Tester: Disabled ability to test and optimize Expert Advisors through MQL5 Cloud Network in the real tick mode. This mode can only be used on local agents and local network farms.
  28. Tester: Improved work with indicators during visual testing. Now the price chart and indicator lines are drawn synchronously, even for the maximum visualization speed.
  29. Tester: Optimized and significantly accelerated testing and optimization.
  30. Tester: Fixed debugging of indicators on historical data. Now the OnInit and OnDeinit indicator functions can be properly debugged.
  31. Tester: Implemented faster access to historical data when testing multicurrency Expert Advisors.
  32. Tester: Fixed occasional freezing of the visual tester during debugging on historical data.
  33. Tester: Implemented faster start of optimization passes when processing a task package by an agent.
  34. Tester: Changed policy of distributing task packages to testing agents. The package size has been increased and thus resource consumption on network operations has been significantly reduced.
  35. Tester: Changed behavior of options enabling the use of local, network and cloud agents. Now, when you switch off the options, the agents complete processing of received tasks, while no more new tasks are given to them. In earlier versions, the behavior was similar to the "Disable" command, which immediately stopped agent operation.




  36. MetaEditor: Added support for non-ANSI characters in the debugger. Now, the expressions are properly displayed even if the variable name is specified in Cyrillic.
  37. Added user interface translation into Croatian.
  38. Documentation has been updated.

The update will be available through the LiveUpdate system.

Fernando Morales
1363
Fernando Morales  

Great improvements! Thanks

Any chance that agents will use GPU cores for optimization processes?

Roberto Spadim
2682
Roberto Spadim  

i can't run metatrader with wine+docker+linux

Internal error 534

Any help?

Sergey Golubev
Moderator
109059
Sergey Golubev  
Roberto Spadim:

i can't run metatrader with wine+docker+linux

Internal error 534

Any help?

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform Build 1755

MetaQuotes Software Corp., 2018.01.18 11:08

We recommend anyone who has long been using 32-bit Wine for MetaTrader 5 due to the past incompatibility with the 64-bit terminal to upgrade Wine to the latest 64-bit version and re-install MetaTrader 5 in 64 bits.

Besides, make sure to set the Wine compatibility mode to at least Windows 7 instead of the default Windows XP. No more updates for Windows XP/2003/Vista will be released.

We are also halting the development of the 32-bit versions of the MetaTrader 5 terminals. The updates for 32-bit MetaTrader 5 are to be completely stopped soon.
Roberto Spadim
2682
Roberto Spadim  
Sergey Golubev:

this didn't solved sergey


i can run the terminal (it open), but when i try to compile the Indicators / Examples, it simple don't compile, and give "internal error", any .EX5 file don't run, Internal Error 534

when i do the same outside docker, it runs without problem

even mounting the same wine directory from outside docker, inside the docker don't work (internal erro continue)


i'm using wine = windows 8.1, and using wine64

Roberto Spadim
2682
Roberto Spadim  

Here the full problem (version 1940, but same problem with last beta version):


---

Hi guys, i'm with problem running metatrader in linux

I'm using ubuntu 18, wine 4.0.4, 64bits version

I install metatrader without problems, but when i try to start any compiled indicator or anything else, i get a Internal Error 534

I didn't found the error in manual, could you help me identifing the problem? I can create a docker image with the exact problem if you need it 

Here the log output, and the problem:


~/.wine/drive_c/Program Files/MetaTrader 5/logs$ cat 20190210.log  
MP    0       14:02:06.274    Terminal        update C:\Program Files\MetaTrader 5\MQL5 folder started 
CE      0       14:02:06.457    Terminal        update C:\Program Files\MetaTrader 5\MQL5 folder finished 
KQ      0       14:02:06.516    Migration       profiles copied from 'C:\Program Files\MetaTrader 5\profiles\charts' to 'C:\Program F
iles\MetaTrader 5\MQL5\Profiles\Charts' 
GD      0       14:02:06.522    Migration       symbolsets copied from 'C:\Program Files\MetaTrader 5\profiles\symbolsets' to 'C:\Pro
gram Files\MetaTrader 5\MQL5\Profiles\Symbolsets' 
QF      0       14:02:06.524    Migration       templates copied from 'C:\Program Files\MetaTrader 5\profiles\templates' to 'C:\Progr
am Files\MetaTrader 5\MQL5\Profiles\Templates' 
EL      0       14:02:06.771    Terminal        MetaTrader 5 x64 build 1940 started (MetaQuotes Software Corp.) 
EG      0       14:02:06.773    Terminal        Windows 7 Service Pack 1 (build 7601) on Wine 4.0 x64, IE 11, Intel Pentium 4  2.40GH
z, Memory: 10076 / 15929 Mb, Disk: 3 / 137 Gb, GMT-3 
RN      0       14:02:06.773    Terminal        C:\Program Files\MetaTrader 5 
PD      0       14:02:06.783    Compiler        full recompilation has been started 
LM      0       14:02:11.732    Compiler        full recompilation has been finished:  0 file(s) compiled 
DI      0       14:02:22.224    Network demo account '15098111' was allocated on MetaQuotes-Demo 
DP      0       14:02:23.670    LiveUpdate      new version build 1983 (IDE: 1983, Tester: 1983) is available 
HL      2       14:02:23.686    Network '15098111': authorization on 78.140.180.201:443 failed (Service is not available) 
HH      0       14:02:31.734    Terminal        exit initiated 
RQ      0       14:02:31.947    Terminal        stopped


the full recompilation returned 0 compiled files

at MetaEditor trying to compile any program return:

Internal compiler error    AccountInfoSample.mq5


trying to execute an previously compiled file, i get this :

KP      2       14:18:29.918    Scripts loading of Teste (AUDUSD,H1) failed [532] 
HG      2       14:18:34.102    Scripts loading of Teste (AUDUSD,H1) failed [532]

malanda20
5
malanda20  
Calendar         use Co lour is easy to see    example  red is very impotent   orgen    yellow    as  forex factory   
Romeu Bertho
5345
Romeu Bertho  

Bug report:

MT5 build 1997

Description: Cannot sync symbol when running as Services, and I guess this is why Bars is not working as well. EAs and scripts are fine, only in Services this piece of code does not work.

Sample code to run as Services:

void OnStart()
  {
//---
   string symbol="EURUSD";
//--- data on the symbol might be not synchronized with data on the server 
   bool synchronized=false;
//--- loop counter 
   int attempts=0;
   while(attempts<5)
     {
      if(SeriesInfoInteger(symbol,0,SERIES_SYNCHRONIZED))
        {
         //--- synchronization done, exit 
         synchronized=true;
         break;
        }
      //--- increase the counter 
      attempts++;
      Print("Attempt: ",attempts);
      //--- wait 1000 milliseconds till the next iteration 
      Sleep(1000);
     }
   Print(SeriesInfoInteger(symbol,0,SERIES_SYNCHRONIZED));
   int bars=Bars(symbol,PERIOD_D1);
   Print(bars);
  }

Best regards,

Romeu Bertho.

Romeu Bertho
5345
Romeu Bertho  
Romeu Bertho:

Bug report:

MT5 build 1997

Description: Cannot sync symbol when running as Services, and I guess this is why Bars is not working as well. EAs and scripts are fine, only in Services this piece of code does not work.

Sample code to run as Services:

Best regards,

Romeu Bertho.

Bars() fixed at Build 2005, but SeriesInfoInteger() like the code below still not working. This applies only to Services.

SeriesInfoInteger(symbol,0,SERIES_SYNCHRONIZED)

Best regards,

Romeu Bertho.

Anton
2040
Anton  
Romeu Bertho:

Bars() fixed at Build 2005, but SeriesInfoInteger() like the code below still not working. This applies only to Services.

Best regards,

Romeu Bertho.

SeriesInfoInteger(symbol,0,SERIES_SYNCHRONIZED)

For Services you can't use 0 for timeframe parameter. Usage of predefined timeframe (or symbol name) of the current chart forbidden in this case, because there is no current chart.

Romeu Bertho
5345
Romeu Bertho  
Anton:

For Services you can't use 0 for timeframe parameter. Usage of predefined timeframe (or symbol name) of the current chart forbidden in this case, because there is no current chart.

Thank you!! :)
To add comments, please log in or register