What's new in MetaTrader 5

The history of updates of the desktop, mobile and web platforms

9 December 2022
MetaTrader 5 platform build 3540: 2FA/TOTP authentication and improved Market Watch in Web Terminal

Web Terminal

  1. Added support for 2FA/TOTP authentication using Google Authenticator and similar apps.

    The 2FA/TOTP authentication protects a trading account from unauthorized access even if its login and password are leaked. Authentication using Time-based One-time Password Algorithm (TOTP) can be implemented using various mobile apps. The most popular of them are Google Authenticator, Microsoft Authenticator, LastPass Authenticator and Authy. Now you can connect to your account in the MetaTrader 5 client terminal using one-time passwords generated by such Authenticator apps.

    To enable the two-factor authentication option, connect to your account via MetaTrader 5 Web Terminal. Then click on your account in the menu and select "Enable 2FA/TOTP" in the newly opened dialog. Run the Authenticator app on your mobile device, click "+" to add your trading account and scan the QR code from the terminal. Enter the generated code in the "One-time password" field and click "Enable 2FA". A secret will be registered for your account on the broker's trading server.


    Added support for 2FA/TOTP authentication using Google Authenticator and similar apps


    The saved secret will be used in the Authenticator app to generate an OTP code every time you connect to your account. Each password is valid for 30 seconds. After that a new one is generated.


    An additional OTP from the Authenticator app will be required for connecting to the account


    A backup code is also displayed in the QR code dialog for linking to the generator. Save it in a secure place. If you lose access to your linked device, the code will allow you to add your account to the Authenticator app again.

    If you decide to remove the stored secret from the Authenticator app, you should first disable 2FA/TOTP authentication using the appropriate account menu command. If the new 2FA/TOTP authentication method is not available on your account, please contact your broker.

  2. Expanded the amount of data displayed in the Market Watch. Now, in addition to the current Bid/Ask prices and the price change percentage, you can see:

    • Maximum and minimum Bid/Ask price for the current trading session
    • Open prices of the current trading session and close prices of the previous trading session

    Use the context menu to customize the displayed information:


    Additional Market Watch data


  3. Added risk notification display when a corresponding setting is enabled on the broker's side. Some regulators require that traders read and accept the notification before trading.
  4. Fixed display of the top toolbar on iPhone models featuring a notch at the top of the screen. Previously, it occasionally could cover the panel buttons.
  5. Fixed display of the account final financial parameters (profit, equity, etc.) in the Google Chrome browser. Sometimes, they were not updated.

Terminal

  1. Optimized and greatly accelerated the demo account opening dialog.
  2. Updated translations of the user interface.
  3. Fixes based on crash logs.

MQL5

  1. Added new methods to the COpenCL class of the Standard Library:

    • BufferFromMatrix — filling the device buffer with data from the matrix
    • BufferToMatrix — reading data from the device buffer into the matrix
    • ContextCreate — creating the device context (the first part of the Initialize method)
    • ProgramCreate — creating a program based on the OpenCL source code (the second part of the Initialize method)
    • ContextClean — releasing all data belonging to the device context (similar to the Shutdown method but without removing the context)
    • GetDeviceInfoInteger — receiving an integer device property
    • GetKernelInfoInteger — receiving an integer kernel property
    • GetDeviceInfo — receiving any single integer device property not present in the ENUM_OPENCL_PROPERTY_INTEGER enumeration

    GetDeviceInfo usage example:
    long preferred_workgroup_size_multiple=OpenCL.GetDeviceInfo(0x1067);
  2. Added the TERMINAL_CPU_NAME and TERMINAL_OS_VERSION values to the ENUM_TERMINAL_INFO_STRING enumeration. They allow receiving the user's CPU and OS names.
    void OnStart()
      {
       string cpu,os;
    //---
       cpu=TerminalInfoString(TERMINAL_CPU_NAME);
       os=TerminalInfoString(TERMINAL_OS_VERSION);
       PrintFormat("CPU: %s, OS: %s",cpu,os);
      }
    
    Result:
    CPU: Intel Xeon  E5-2630 v4 @ 2.20GHz, OS: Windows 10 build 19045
  3. Fixed operation of the "table_or_sql" parameter in the DatabasePrint and DatabaseExport functions. Now it is able to pass a table name in addition to a SQL query.

MetaEditor

  1. Fixed the check for the maximum number of displayable columns in the database. Up to 64 columns can now be displayed.
  2. Fixed operation of breakpoints in short constructions like IF[ if(cond) break; ].
25 November 2022
MetaTrader 5 build 3520: 2FA/TOTP authentication using Google Authenticator

Terminal

  1. Added 2FA/TOTP authentication using Google Authenticator and similar apps.

    The 2FA/TOTP authentication protects a trading account from unauthorized access even if its login and password are leaked. Authentication using Time-based One-time Password Algorithm (TOTP) can be implemented using various mobile apps. The most popular of them are Google Authenticator, Microsoft Authenticator, LastPass Authenticator and Authy. Now you can connect to your account in the MetaTrader 5 client terminal using one-time passwords generated by such Authenticator apps.

    To enable the two-factor authentication option, connect to your account and execute the "Enable 2FA/TOTP" command in the account context menu. Run the Authenticator app on your mobile device, click "+" to add your trading account and scan the QR code from the terminal. Enter the generated code in the "One-time password" field and click "Enable 2FA". A secret will be registered for your account on the broker's trading server.


    Added support for 2FA/TOTP authentication using Google Authenticator and similar apps.

    The saved secret will be used in the Authenticator app to generate an OTP code every time you connect to your account. Each password is valid for 30 seconds. After that a new one is generated.



    An additional OTP from the Authenticator app will be required for connecting to the account

    If you decide to remove the stored secret from the Authenticator app, you should first disable 2FA/TOTP authentication using the appropriate account context menu command. If the new 2FA/TOTP authentication method is not available on your account, please contact your broker.

MQL5

  1. Fixed operation of the CopyTicks function for custom trading instruments. When working with custom symbols, previous session's initial ticks could be returned instead of requested data, under certain conditions.

  2. Added new enumeration values to get the last OpenCL error code and text description.
    1. Value CL_LAST_ERROR (code 4094) has been added to the ENUM_OPENCL_PROPERTY_INTEGER enumeration

      When obtaining the last OpenCL error via CLGetInfoInteger, the handle parameter is ignored. Error descriptions: https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_SUCCESS.
      For an unknown error code, the string "unknown OpenCL error N" is returned, where N is the error code.

      Example:
      //--- the first handle parameter is ignored when obtaining the last error code
      int code = (int)CLGetInfoInteger(0,CL_LAST_ERROR);

    2. Value CL_ERROR_DESCRIPTION (4093) has been added to the ENUM_OPENCL_PROPERTY_STRING enumeration.
      A text error description can be obtained using CLGetInfoString. Error descriptions: https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_SUCCESS.

      When using CL_ERROR_DESCRIPTION, an error code should be passed as the handle parameter in CLGetInfoString. If CL_LAST_ERROR is passed instead of the error code, the function will return the last error description.

      Example:
      //--- get the code of the last OpenCL error
      int    code = (int)CLGetInfoInteger(0,CL_LAST_ERROR);
      string desc; // to get the text description of the error
      
      //--- use the error code to get the text description of the error
      if(!CLGetInfoString(code,CL_ERROR_DESCRIPTION,desc))
         desc = "cannot get OpenCL error description, " + (string)GetLastError();
      Print(desc);
      
      
      //--- to get the description of the last OpenCL error without receiving the code, pass CL_LAST_ERROR  
      if(!CLGetInfoString(CL_LAST_ERROR,CL_ERROR_DESCRIPTION, desc))
         desc = "cannot get OpenCL error description, " + (string)GetLastError();
      Print(desc);
      The internal enumeration name is passed as the error description. Its explanation can be found at https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_SUCCESS. For example, the CL_INVALID_KERNEL_ARGS value means "Returned when enqueuing a kernel when some kernel arguments have not been set or are invalid."

  3. Fixed operation of the matrix::MatMul method. When working with large matrices, the terminal could crash on certain sizes.

Fixed errors reported in crash logs.
18 November 2022
MetaTrader 5 build 3510: Web Terminal improvements

MetaTrader 5 WebTerminal

  1. In the mobile version we have implemented trading history sorting and filtering by depth. Use the top-panel commands to customize the history display:


    Customizable trading history view in the mobile version


    Operations can be sorted by the main parameters, such as date, ticket, symbol and volume, among others.

  2. Improved access to trading account details.

    • In the desktop version the current account data is clickable. Click on the account to view its details.
    • In the mobile version the current account is displayed under the Settings section. Click on the account to view its details.


    Improved access to trading account data

  3. Fixed display of the account type in the account management window.
  4. Fixed equity and free margin display after refreshing the web terminal page in mobile browsers.
  5. Fixed bottom bar display in Firefox mobile browser

Terminal

  1. Fixed equity and balance graph calculations in the trading report.

MQL5

  1. New behavior of typename(expr). The updated function returns the full type with modifiers and dimensions (for arrays):
    class A
      {
      };
    
    void OnStart(void)
      {
       const A *const arr[][2][3]={};
       Print(typename(arr));
      }
    
    Result:
    "class A const * const [][2][3]"
Fixed errors reported in crash logs.



11 November 2022
MetaTrader 5 build 3500: Improvements and fixes

Terminal

  1. A new command has been added to the context menu of the Trade and History sections, to enable access to the new trading report.

    Added command to access the new trading report


    The trading report provides the following performance data:
    • Graphs and tables visualizing monthly growth metrics
    • Equity chart
    • Radar chart which enables quick account state evaluation
    • Trading statistics by instrument
    • A variety of additional metrics for trading analysis

  2. Fixed initial deposit calculations in the trading report.
  3. Fixed setting of Stop Loss and Take Profit levels when using using the quick trading panel in the chart and Market Watch. The levels could be inherited from previously opened positions even when the inheritance was not required (the relevant functionality is implemented for FIFO-based accounts).
  4. Updated user interface translations.

MQL5

  1. Fixed a compiler bug which enabled access to a structure field using a constant string with the field name value.
  2. MQL5: Fixed checking of key states using the TerminalInfoInteger(TERMINAL_KEYSTATE_*) function.

Fixed errors reported in crash logs.

MetaTrader 5 WebTerminal build 3500

  1. Fixed position closing upon requotes.
  2. Fixed reconnection to the server after maximizing a browser window which has been inactive for a long time.
  3. Fixed display of credit funds.
  4. ther improvements and fixes.

4 November 2022
MetaTrader 5 build 3490: Mobile Web Terminal version and new matrix methods in MQL5
Mobile version of the web platform

The new Web Terminal provides full-featured support for mobile devices. The interface will automatically adapt to the screen size, enabling efficient operations from iOS and Android phones and tablets:

Added support for mobile devices in the new web terminal

Also, the Web Terminal features a lot of fixes and improvements.

The new MetaTrader 5 Web Terminal supports the full set of trading functions. It enables users to:

  • Work with demo and live accounts
  • Receive any financial symbol quotes
  • Trade in any markets
  • Analyze symbol quotes using more than 30 indicators and 20 graphical objects
  • Use Economic Calendar data for fundamental analysis


Terminal

  1. Extended task manager features. The new version enables more accurate monitoring of consumed resources.

    • Added stack size display for threads.
    • Added display of the number of context switches.
    • Added recognition of system and third-party DLL threads.
    • Added display of kernel mode operating time. An increase in this metric compared to the time spent in user mode can indicate system-level issues: drivers problems, hardware errors or slow hardware. For further details, please read the Microsoft Documentation.
    • Added display of user mode operating time.

    Terminal: Extended task manager features. The new version enables more accurate monitoring of consumed resources


  2. New OpenCL tab in terminal settings for managing available devices. The new OpenCL manager enables explicit specification of devices to be used for calculations.

    OpenCL manager to control available devices

  3. Added indication of Stop Loss and Take Profit levels in the Depth of Market for accounts operating in FIFO mode (the mode can be enabled on the broker's side).

    According to the FIFO rule, positions for each instrument can only be closed in the same order in which they were opened. To ensure FIFO-compliant position closing by stop levels, the following logic has been implemented on the client terminal side:

    If multiple positions exist for the same instrument, the placing of stop levels for any of the positions causes the same levels to be placed for all other positions as well. Accordingly, if a level triggers, all positions will be closed in a FIFO-compliant order.

    Now, when the user opens the Depth of Market for an instrument which already has open positions for, the levels of existing positions (if any) are automatically specified in the Stop Loss and Take Profit fields.

  4. Fixed deletion of Stop Loss and Take Profit levels using X buttons in the Toolbox\Trade window. The error occurred when the quick trading function was disabled. A click on the button will open a trading dialog with an empty value of the relevant level.

  5. Fixed graph captions and final commission calculations in the trading report. The section could show incorrect Profit in report statistics and incorrect values in Equity and Balance graph tooltips.

MQL5

  1. Added vector and matrix methods CopyTicks and CopyTicksRange. They enable easy copying of tick data arrays into vectors and matrices.
    bool matrix::CopyTicks(string symbol,uint flags,ulong from_msc,uint count);
    bool vector::CopyTicks(string symbol,uint flags,ulong from_msc,uint count);
    
    bool matrix::CopyTicksRange(string symbol,uint flags,ulong from_msc,ulong to_msc);
    bool matrix::CopyTicksRange(string symbol,uint flags,ulong from_msc,ulong to_msc);
    The copied data type is specified in the 'flags' parameter using the ENUM_COPY_TICKS enumeration. The following values are available:
    COPY_TICKS_INFO    = 1,       // ticks resulting from Bid and/or Ask changes
    COPY_TICKS_TRADE   = 2,       // ticks resulting from Last and Volume changes
    COPY_TICKS_ALL     = 3,       // all ticks having changes
    COPY_TICKS_TIME_MS = 1<<8,    // time in milliseconds
    COPY_TICKS_BID     = 1<<9,    // Bid price
    COPY_TICKS_ASK     = 1<<10,   // Ask price
    COPY_TICKS_LAST    = 1<<11,   // Last price
    COPY_TICKS_VOLUME  = 1<<12,   // volume
    COPY_TICKS_FLAGS   = 1<<13,   // tick flags
    If multiple data types are selected (only available for matrices), the order of the rows in the matrix will correspond to the order of values in the enumeration.

  2. Expanded features of matrix::Assign and vector::Assign methods.

    Now the matrix can be assigned a one-dimensional array or vector:
    bool matrix::Assign(const vector &vec);
    The result will be a one-row matrix.

    Also, a matrix can now be assigned to a vector (matrix smoothing will be performed):
    bool vector::Assign(const matrix &mat);
  3. Added Swap methods for vectors and matrices.
    bool vector::Swap(vector &vec);
    bool vector::Swap(matrix &vec);
    bool vector::Swap(double &arr[]);
    bool matrix::Swap(vector &vec);
    bool matrix::Swap(matrix &vec);
    bool matrix::Swap(double &arr[]);
    Each array, vector or matrix refers to a memory buffer which contains the elements of that object. The Swap method actually swaps pointers to these buffers without writing the elements to memory. Therefore, a matrix remains a matrix, and a vector remains a vector. Swapping a matrix and a vector will result in a one-row matrix with vector elements and a vector with matrix elements in a flat representation (see the Flat method).
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //---
      matrix a= {{1, 2, 3}, {4, 5, 6}};
      Print("a before Swap: \n", a);
      matrix b= {{5, 10, 15, 20}, {25, 30, 35, 40}, {45, 50, 55, 60}};
      Print("b before Swap: \n", b);  
    //--- swap matrix pointers
      a.Swap(b);
      Print("a after Swap: \n", a);
      Print("b after Swap: \n", b);
      /*
      a before Swap:
      [[1,2,3]
      [4,5,6]]
      b before Swap:
      [[5,10,15,20]
      [25,30,35,40]
      [45,50,55,60]]
      
      a after Swap:
      [[5,10,15,20]
      [25,30,35,40]
      [45,50,55,60]]
      b after Swap:
      [[1,2,3]
      [4,5,6]]
      */
      vector v=vector::Full(10, 7);
      Print("v before Swap: \n", v);
      Print("b before Swap: \n", b);
      v.Swap(b);
      Print("v after Swap: \n", v);
      Print("b after Swap: \n", b);
      /*
      v before Swap:
      [7,7,7,7,7,7,7,7,7,7]
      b before Swap:
      [[1,2,3]
      [4,5,6]]
      
      v after Swap:
      [1,2,3,4,5,6]
      b after Swap:
      [[7,7,7,7,7,7,7,7,7,7]]
      */
     }
    The Swap() method also enables operations with dynamic arrays (fixed-sized arrays cannot be passed as parameters). The array can be of any dimension but of an agreed size, which means that the total size of a matrix or vector must be a multiple of the array's zero dimension. The array's zero dimension is the number of elements contained at the first index. For example, for a dynamic three-dimensional array 'double array[][2][3]', the zero dimension is the product of the second and third dimension sizes: 2x3=6. So, such an array can only be used in the Swap method with matrices and vectors whose total size is a multiple of 6: 6, 12, 18, 24, etc.

    Consider the following example:
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //--- fill the 1x10 matrix with the value 7.0
      matrix m= matrix::Full(1, 10, 7.0);
      Print("matrix before Swap:\n", m);
    //--- try to swap the matrix and the array
      double array_small[2][5]= {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}};
      Print("array_small before Swap:");
      ArrayPrint(array_small);
      if(m.Swap(array_small))
       {
        Print("array_small after Swap:");
        ArrayPrint(array_small);
        Print("matrix after Swap: \n", m);
       }
      else // the matrix size is not a multiple of the first array dimension
       {
        Print("m.Swap(array_small) failed. Error ", GetLastError());
       }
      /*
      matrix before Swap:
      [[7,7,7,7,7,7,7,7,7,7]]
      array_small before Swap:
               [,0]     [,1]     [,2]     [,3]     [,4]
      [0,]  1.00000  2.00000  3.00000  4.00000  5.00000
      [1,]  6.00000  7.00000  8.00000  9.00000 10.00000
      m.Swap(array_small) failed. Error 4006
      */
    //--- use a larger matrix and retry the swap operation
      double array_static[3][10]= {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
         {2, 4, 6, 8, 10, 12, 14, 16, 18, 20},
         {3, 6, 9, 12, 15, 18, 21, 24, 27, 30}
       };
      Print("array_static before Swap:");
      ArrayPrint(array_static);
      if(m.Swap(array_static))
       {
        Print("array_static after Swap:");
        ArrayPrint(array_static);
        Print("matrix after Swap: \n", m);
       }
      else // a static array cannot be used to swap with a matrix
       {
        Print("m.Swap(array_static) failed. Error ", GetLastError());
       }
      /*
      array_static before Swap:
             [,0]     [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]     [,8]     [,9]
      [0,]  1.00000  2.00000  3.00000  4.00000  5.00000  6.00000  7.00000  8.00000  9.00000 10.00000
      [1,]  2.00000  4.00000  6.00000  8.00000 10.00000 12.00000 14.00000 16.00000 18.00000 20.00000
      [2,]  3.00000  6.00000  9.00000 12.00000 15.00000 18.00000 21.00000 24.00000 27.00000 30.00000
      m.Swap(array_static) failed. Error 4006
      */
    //--- another attempt to swap an array and a matrix
      double array_dynamic[][10];    // dynamic array
      ArrayResize(array_dynamic, 3); // set the first dimension size
      ArrayCopy(array_dynamic, array_static);
    //--- now use a dynamic array for swap
      if(m.Swap(array_dynamic))
       {
        Print("array_dynamic after Swap:");
        ArrayPrint(array_dynamic);
        Print("matrix after Swap: \n", m);
       }
      else //  no error
       {
        Print("m.Swap(array_dynamic) failed. Error ", GetLastError());
       }
      /*
      array_dynamic after Swap:
            [,0]    [,1]    [,2]    [,3]    [,4]    [,5]    [,6]    [,7]    [,8]    [,9]
      [0,] 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000
      matrix after Swap:
      [[1,2,3,4,5,6,7,8,9,10,2,4,6,8,10,12,14,16,18,20,3,6,9,12,15,18,21,24,27,30]]
      */
     }
  4. Added LossGradient method for vectors and matrices. This method calculates a vector or matrix of partial derivatives of the loss function on predicted values. In linear algebra, such a vector is referred to as a gradient and is used in machine learning.
    vector vector::LossGradient(const vector &expected,ENUM_LOSS_FUNCTION loss) const;
    matrix matrix::LossGradient(const matrix &expected,ENUM_LOSS_FUNCTION loss) const;
  5. Enabled use of FOREIGN KEYS in SQLite to enforce relationships between tables in SQL queries.   Example:
    CREATE TABLE artist(
      artistid    INTEGER PRIMARY KEY, 
      artistname  TEXT
    );
    
    CREATE TABLE track(
      trackid     INTEGER, 
      trackname   TEXT, 
      trackartist INTEGER,
      FOREIGN KEY(trackartist) REFERENCES artist(artistid)
    );

  6. Fixed selection of the appropriate class method depending on the method and object constness.

MetaEditor

  1. Increased allowable length of comments in commits to MQL5 Storage. Detailed comments when committing changes to the repository are considered good practice when working in large projects, but previously the comment length has been limited to 128 characters. The allowed length is now up to 260 characters.

MetaTester

  1. Increased sensitivity of the testing speed switch in visual mode.

Fixed errors reported in crash logs.


17 September 2022
MetaTrader 5 build 3440: New trading account report

Terminal

  1. Added new account trading performance report. It is similar to the already familiar Signals reports in terms of statistics availability and data presentation. The following performance data will be available in the platform:
    • Graphs and tables visualizing monthly growth metrics
    • Equity chart
    • Radar chart which enables quick account state evaluation
    • Trading statistics by instrument
    • A variety of additional metrics for trading analysis

    The report can be viewed directly in the platform, without the need to export it to a file. To open it, select Reports in the View menu.



  2. Fixed options board filling for Call and Put contracts with unmatching quantity or symbol type.
  3. Fixed position selection in the Trade dialog during Close by operations. The error occurred for opposite order lists sorted by any column other than the ticket.
  4. Accelerated platform logging.
  5. Fixed display of comments on custom symbol charts.

MQL5

  1. Fixed CArrayList::LastIndexOf function operation. Previously, it always returned -1 instead of the index of the last found element.
  2. Added new matrix and vector method - Assign. It replaces matrix/vector elements with the passed matrix/vector or array data.
    bool vector<TDst>::Assign(const vector<TSrc> &assign);
    bool matrix<TDst>::Assign(const matrix<TSrc> &assign);
    
    Example:
      //--- copying matrices
      matrix b={};
      matrix a=b;
      a.Assign(b);
      
      //--- copying an array to a matrix
      double arr[5][5]={{1,2},{3,4},{5,6}};
      Print("array arr");
      ArrayPrint(arr);
      b.Assign(arr);
      Print("matrix b \n",b);
    /*
    array arr
            [,0]    [,1]    [,2]    [,3]    [,4]
    [0,] 1.00000 2.00000 0.00000 0.00000 0.00000
    [1,] 3.00000 4.00000 0.00000 0.00000 0.00000
    [2,] 5.00000 6.00000 0.00000 0.00000 0.00000
    [3,] 0.00000 0.00000 0.00000 0.00000 0.00000
    [4,] 0.00000 0.00000 0.00000 0.00000 0.00000
    matrix b 
    [[1,2,0,0,0]
     [3,4,0,0,0]
     [5,6,0,0,0]
     [0,0,0,0,0]
     [0,0,0,0,0]]
    
    */
  3. Added new matrix and vector method - CopyRates. It copies price data arrays into vectors and matrices.
    bool matrix::CopyRates(string symbol,ENUM_TIMEFRAMES period,ulong rates_mask,ulong from,ulong count);
    bool vector::CopyRates(string symbol,ENUM_TIMEFRAMES period,ulong rates_mask,ulong from,ulong count);
    The copied data type is specified in the rates_mask parameter using the ENUM_COPY_RATES enumeration. The following values are available:
    COPY_RATES_OPEN
    COPY_RATES_HIGH
    COPY_RATES_LOW
    COPY_RATES_CLOSE
    COPY_RATES_TIME
    COPY_RATES_VOLUME_TICK
    COPY_RATES_VOLUME_REAL
    COPY_RATES_SPREAD
    COPY_RATES_OHLC
    COPY_RATES_OHLCT
    The last two values enable the simultaneous selection of multiple bar parameters: Open, High, Low, Close and time.

    If multiple data types are selected (only available for matrices), the order of the rows in the matrix will correspond to the order of values in the enumeration.

  4. Fixed display of Text Label objects. When using OBJPROP_XOFFSET and OBJPROP_YOFFSET properties, a wrong image fragment could be displayed on the chart.

  5. Fixed error when changing a constant parameter which has been passed to a function as an object pointer reference.

    The const specifier declares a variable as a constant to prevent it from being changed during program execution. It only allows one-time variable initialization during declaration. An example of constant variables in the OnCalculate function:

    int OnCalculate (const int rates_total,      // price[] array size
                     const int prev_calculated,  // bars processed on previous call
                     const int begin,            // meaningful data starts at
                     const double& price[]       // array for calculation
       );
    

    The below example contains a compiler error which allowed an implicit pointer casting for reference parameters:

    class A {};
    const A *a = new A;
    
    void foo( const A*& b )
      {
       b = a;
      }
    
    void OnStart()
      {
            A *b; 
            foo(b);  // not allowed
            Print( a,":",b );
      }
    The compiler will detect such illegal operations and will return the relevant error.

MetaEditor

  1. Fixed display of complex number references in the debugger.
  2. Improved MQL5 Cloud Protector. Previously, file protection could fail under certain conditions.
  3. Fixed errors reported in crash logs.


New MetaTrader 5 Web Terminal

We have released a revised MetaTrader 5 Web Terminal which features an updated interface and a redesigned core. The new interface is similar to the terminal version for iPad:



It also features a plethora of new functions:

  • Ability to request real accounts with the detailed registration form and document submission options
  • Support for price data subscriptions and the ability to receive delayed quotes
  • More analytical objects with convenient management options
  • Market entries and exits displayed on charts
  • Economic Calendar events displayed on charts
  • Convenient configuration of instruments in the Market Watch, along with the daily price change data
  • Simplified interface to assist beginners in getting started with the terminal: removed chart context menu and top menu; all chart control commands, objects and indicators are available on the left-hand side and top panels, while other commands can be accessed through the hamburger menu
  • Interface dark mode

Try the new web terminal at www.mql5.com right now. It will soon become available for your brokers.

4 August 2022
MetaTrader 5 build 3390: Float in OpenCL and in mathematical functions, Activation and Loss methods for machine learning

Terminal

  1. Added automatic opening of a tutorial during the first connection to a trading account. This will assist beginners in learning trading basics and in exploring platform features. The tutorial is divided into several sections, each of which provides brief information on a specific topic. The topic completion progress is shown with a blue line.

    Added automatic opening of a tutorial during the first connection to a trading account.

  2. Fixed 'Close profitable'/'Close losing' bulk operations. Previously, the platform used opposite positions if they existed. For example, if you had two losing Buy positions for EURUSD and one profitable Sell position for EURUSD, all three positions would be closed during the 'Close losing' bulk operation. Buy and Sell would be closed by a 'Close by' operation, while the remaining Buy would be closed by a normal operation. Now the commands operate properly: they only close the selected positions, either profitable or losing.
  3. Fixed display of negative historical prices. Such prices will appear correctly for all timeframes.
  4. Optimized and significantly reduced system resource consumption by the terminal.
  5. Updated fundamental database for trading instruments. The number of data aggregators available for exchange instruments has been expanded to 15. Users will be able to access information on even more tickers via the most popular economic aggregators.

    Updated fundamental database for trading instruments.


    About 7,000 securities and more than 2,000 ETFs are listed on the global exchange market. Furthermore, exchanges provide futures and other derivatives. The MetaTrader 5 platform offers access to a huge database of exchange instruments. To access the relevant fundamental data, users can switch to the selected aggregator's website in one click directly from the Market Watch. For convenience, the platform includes a selection of information sources for each financial instrument.
  6. Fixed Stop Loss and Take Profit indication in the new order placing window. For FIFO accounts, stop levels will be automatically set in accordance with the stop levels of existing open positions for the same instrument. This procedure is required to comply with the FIFO rule.

MQL5

  1. Mathematical functions can now be applied to matrices and vectors.

    We continue expanding algorithmic trading and machine learning capabilities in the MetaTrader 5 platform. Previously, we have added new data types: matrices and vectors, which eliminate the need to use arrays for data processing. More than 70 methods have been added to MQL5 for operations with these data types. The new methods enable linear algebra and statistics calculations in a single operation. Multiplication, transformation and systems of equations can be implemented easily, without extra coding. The latest update includes mathematical functions.

    Mathematical functions were originally designed to perform relevant operations on scalar values. From this build and onward, most of the functions can be applied to matrices and vectors. These include MathAbs, MathArccos, MathArcsin, MathArctan, MathCeil, MathCos, MathExp, MathFloor, MathLog, MathLog10, MathMod, MathPow, MathRound, MathSin, MathSqrt, MathTan, MathExpm1, MathLog1p, MathArccosh, MathArcsinh, MathArctanh, MathCosh, MathSinh, and MathTanh. Such operations imply element-wise handling of matrices and vectors. Example:
    //---
      matrix a= {{1, 4}, {9, 16}};
      Print("matrix a=\n",a);
    
      a=MathSqrt(a);
      Print("MatrSqrt(a)=\n",a);
      /*
       matrix a=
       [[1,4]
        [9,16]]
       MatrSqrt(a)=
       [[1,2]
        [3,4]]
      */
    For MathMod and MathPow, the second element can be either a scalar or a matrix/vector of the appropriate size.

    The following example shows how to calculate the standard deviation by applying math functions to a vector.
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //--- Use the initializing function to populate the vector
      vector r(10, ArrayRandom); // Array of random numbers from 0 to 1
    //--- Calculate the average value
      double avr=r.Mean();       // Array mean value
      vector d=r-avr;            // Calculate an array of deviations from the mean
      Print("avr(r)=", avr);
      Print("r=", r);
      Print("d=", d);
      vector s2=MathPow(d, 2);   // Array of squared deviations
      double sum=s2.Sum();       // Sum of squared deviations
    //--- Calculate standard deviation in two ways
      double std=MathSqrt(sum/r.Size());
      Print(" std(r)=", std);
      Print("r.Std()=", r.Std());    
     }
    /*
      avr(r)=0.5300302133243813
      r=[0.8346201971495713,0.8031556138798182,0.6696676534318063,0.05386516922513505,0.5491195410016175,0.8224433118686484,...
      d=[0.30458998382519,0.2731254005554369,0.1396374401074251,-0.4761650440992462,0.01908932767723626,0.2924130985442671, ...
       std(r)=0.2838269732183663
      r.Std()=0.2838269732183663
    */ 
    //+------------------------------------------------------------------+
    //| Fills the vector with random values                              |
    //+------------------------------------------------------------------+
    void ArrayRandom(vector& v)
     {
      for(ulong i=0; i<v.Size(); i++)
        v[i]=double(MathRand())/32767.;
     }
    

  2. Added support in template functions for notations matrix<double>, matrix<float>, vector<double>, vector<float> instead of the corresponding matrix, matrixf, vector and vectorf types.
  3. Improved mathematical functions for operations with the float type. The newly implemented possibility to apply mathematical functions to 'float' matrix and vectors has enabled an improvement in mathematical functions applied to 'float' scalars. Previously, these function parameters were unconditionally cast to the 'double' type, then the corresponding implementation of the mathematical function was called, and the result was cast back to the 'float' type. Now the operations are implemented without extra type casting.

    The following example shows the difference in the mathematical sine calculations:

    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //---  Array of random numbers from 0 to 1
      vector d(10, ArrayRandom);
      for(ulong i=0; i<d.Size(); i++)
       {
        double delta=MathSin(d[i])-MathSin((float)d[i]);
        Print(i,". delta=",delta);
       }
     }
    /*
       0. delta=5.198186103783087e-09
       1. delta=8.927621308885136e-09
       2. delta=2.131878673594656e-09
       3. delta=1.0228555918923021e-09
       4. delta=2.0585739779477308e-09
       5. delta=-4.199390279957527e-09
       6. delta=-1.3221741035351897e-08
       7. delta=-1.742922250969059e-09
       8. delta=-8.770715820283215e-10
       9. delta=-1.2543186267421902e-08
    */
    //+------------------------------------------------------------------+
    //| Fills the vector with random values                              |
    //+------------------------------------------------------------------+
    void ArrayRandom(vector& v)
     {
      for(ulong i=0; i<v.Size(); i++)
        v[i]=double(MathRand())/32767.;
     }

  4. Added Activation and Derivative methods for matrices and vectors:
    AF_ELU               Exponential Linear Unit
    AF_EXP               Exponential
    AF_GELU              Gaussian Error Linear Unit
    AF_HARD_SIGMOID      Hard Sigmoid
    AF_LINEAR            Linear
    AF_LRELU             Leaky REctified Linear Unit
    AF_RELU              REctified Linear Unit
    AF_SELU              Scaled Exponential Linear Unit
    AF_SIGMOID           Sigmoid
    AF_SOFTMAX           Softmax
    AF_SOFTPLUS          Softplus
    AF_SOFTSIGN          Softsign
    AF_SWISH             Swish
    AF_TANH              Hyperbolic Tangent
    AF_TRELU             Thresholded REctified Linear Unit
    The neural network activation function determines how the weighted input signal sum is converted into a node output signal at the network level. The selection of the activation function has a big impact on the neural network performance. Different parts of the model can use different activation functions. In addition to all known functions, MQL5 also offers derivatives. Derivative functions enable fast calculation of adjustments based on the error received in learning.

  5. Added Loss function for matrices and vectors. It has the following parameters:
    LOSS_MSE            Mean Squared Error
    LOSS_MAE            Mean Absolute Error
    LOSS_CCE            Categorical Crossentropy
    LOSS_BCE            Binary Crossentropy
    LOSS_MAPE           Mean Absolute Percentage Error
    LOSS_MSLE           Mean Squared Logarithmic Error
    LOSS_KLD            Kullback-Leibler Divergence
    LOSS_COSINE         Cosine similarity/proximity
    LOSS_POISSON        Poisson
    LOSS_HINGE          Hinge
    LOSS_SQ_HINGE       Squared Hinge
    LOSS_CAT_HINGE      Categorical Hinge
    LOSS_LOG_COSH       Logarithm of the Hyperbolic Cosine
    LOSS_HUBER          Huber
    The loss function evaluates the quality of model predictions. The model construction targets the minimization of the function value at each stage. The approach depends on the specific dataset. Also, the loss function can depend on weight and offset. The loss function is one-dimensional and is not a vector since it provides a general evaluation of the neural network.

  6. Added matrix::CompareByDigits and vector::CompareByDigits methods for matrices and vectors. They compare the elements of two matrices/vectors up to significant digits.

  7. Added support for MathMin and MathMax functions for strings. The functions will use lexicographic comparison: letters are compared alphabetically, case sensitive.

  8. The maximum number of OpenCL objects has been increased from 256 to 65536. OpenCL object handles are created in an MQL5 program using the CLContextCreate, CLBufferCreate and CLProgramCreate functions. The previous limit of 256 handles was not enough for the efficient use of machine learning methods.

  9. Added ability to use OpenCL on graphical card without 'double' support. Previously, only GPUs supporting double were allowed in MQL5 programs, although many tasks allow calculations using float. The float type is initially considered native for parallel computing, as it takes up less space. Therefore, the old requirement has been lifted.

    To set the mandatory use of GPUs with double support for specific tasks, use the CL_USE_GPU_DOUBLE_ONLY in the CLContextCreate call.
       int cl_ctx;
    //--- Initializing the OpenCL context
       if((cl_ctx=CLContextCreate(CL_USE_GPU_DOUBLE_ONLY))==INVALID_HANDLE)
         {
          Print("OpenCL not found");
          return;
         }

  10. Fixed operation of the CustomBookAdd function. Previously, a non-zero value in the MqlBookInfo::volume_real field prevented the function from creating a Market Depth snapshot. The check is now performed as follows:
    The transmitted data is validated: type, price and volume data must be specified for each element. Also, MqlBookInfo.volume and MqlBookInfo.volume_real must not be zero or negative. If both volumes are negative, this will be considered an error. You can specify any of the volume types or both of them, while the system will use the one that is indicated or is positive:

       volume=-1 && volume_real=2 — volume_real=2 will be used,

       volume=3 && volume_real=0 — volume=3 will be used.

    Increased-precision volume MqlBookInfo.volume_real has a higher priority than MqlBookInfo.volume. Therefore, if both values are specified and are valid, volume_real will be used.

    If any of the Market Depth elements is described incorrectly, the system will discard the transferred state completely.

  11. Fixed operation of the CalendarValueLast function. Due to an error, successive function calls after changes in the Economic Calendar (the 'change' parameter was set a new value after the call) could skip some events when using the currency filter.
    CalendarValueLast(change, result, "", "EUR")
  12. Fixed ArrayBSearch function behavior. If multiple identical elements are found, a link to the first result will be returned, rather than a random one.
  13. Fixed checks for template function visibility within a class. Due to an error, class template functions declared as private/protected appeared to be public.

MetaEditor

  1. Fixed errors and ambiguous behavior of MetaAssist.
  2. Added support for the %terminal% macros which indicates the path to the terminal installation directory. For example, %terminal%\MQL5\Experts. 

    Added support for the %terminal% macros which indicates the path to the terminal installation directory.

  3. Improved display of arrays in the debugger.
  4. Increased buffer for copying values from the debugger.
  5. Improved error hints.
  6. Added indication of relative paths in the *.mproj project file. Previously, absolute paths were used, which resulted in compilation errors in case the project was moved.
  7. Added automatic embedding of BMP resources as globally available 32-bit bitmap arrays in projects. This eliminates the need to call ResourceReadImage inside the code to read the graphical resource.
    'levels.bmp' as 'uint levels[18990]'
    
  8. Improved reading of extended BMP file formats.
  9. Updated UI translations.
  10. Fixed errors reported in crash logs.

2 June 2022
MetaTrader 5 build 3320: Improvements and fixes

Terminal

  1. Extended tooltips for trade objects displayed on charts:
    • Market exit deals now display profits.
    • The relevant indication is displayed for deals executed as a result of Take Profit or Stop Loss activation.

    Similar tooltips are available for the lines joining entry and exit trades.

    Extended tooltips for deal objects


  2. Improved graphical system performance.
  3. Added logging of bulk operations with open orders and positions. When such a command is executed, a relevant log as added to the Journal, for example: "bulk closing of XXX positions started".
  4. Fixed bulk closing of opposite positions.
  5. Fixed updating of on-chart objects displaying trading history. The error occurred when changing the chart symbol.

MQL5

  1. Works on matrix and vector functions are underway: support for 'float' and 'complex' is being implemented.
  2. Operator "!" (LNOT) for a pointer checks its validity via an implicit CheckPointer call. Operator "==" should be used for a quick NULL check. For example: ptr==NULL or ptr!=NULL.

MetaTester

  1. Fixed display of deal objects on testing graphs.
  2. Improved graphical system performance.

MetaEditor

  • Updated UI translations.

Fixed errors reported in crash logs.

20 May 2022
MetaTrader 5 build 3300: Fast compilation and improved code navigation in MetaEditor

Terminal

  1. Added ability to resize the Rectangle graphical object by dragging any of its four corners.


    Modify the rectangle by dragging any of its corners


  2. Faster GUI rendering.
  3. Improved support for IPv6 addresses.
  4. Fixed height calculation for the lower date field and width calculation for the right-hand side price field on the first platform launch.

MQL5

  1. Added function for working with matrices and vectors —  RegressionMetric. It sets the metric for regression evaluation.
     double vector.RegressionError(const enum lr_error);
     double matrix.RegressionError(const enum lr_error);
     vector matrix.RegressionError(const enum lr_error,const int axis);
    The following variables can be used as metrics:
    enum REGRESSION_ERROR
      {
       REGRESSION_MAE,     // Mean absolute error
       REGRESSION_MSE,     // Mean square error
       REGRESSION_RMSE,    // Root mean square error
       REGRESSION_R2,      // R squared
       REGRESSION_MAPE,    // Mean absolute percentage error
       REGRESSION_MSPE,    // Mean square percentage error
       REGRESSION_RMSLE    // Root mean square logarithmic error
      };
  2. Added ability to write arrays with data size greater than INT_MAX (arrays of structures).

MetaEditor

  1. Tab bar improvements:

    • The panel is not hidden even if only one window is open. Thus, the tab context menu commands are always visible to the user.
    • The 'X' closing button has been added to each tab. In addition, tabs can be closed using the middle mouse button or via the context menu.

    Tab bar improvements


  2. Added command for quick program compilation. This mode skips code optimization, which significantly speeds up the creation of an EX5 executable file. Use this mode during the active development stage, when you need to quickly check the written code. During the final program compilation, turn on the maximum optimization mode for enhanced performance.


    Use unoptimized compilation for quick code verification


    The "Maximum optimization" parameter in the project settings performs the same function.

    All compilation-relation operations are available under the "Build" menu.

  3. Code management improvements:

    • Separate commands have been implemented for jumping to definitions and to declarations. Previously, the menu had one command which opened a selection sub-menu. The new commands enable faster switch to necessary code parts.
    • Added substitution of recognized keywords by the "Tab" key, in addition to "Enter".


    Jump to method declaration


  4. Added ability to automatically display local variables in the debugger watch list. The display can be enabled by the "Local" context menu command. As the debugger operation proceeds through the code, variables from the current scope are automatically displayed in the list.


    Display of local variables in the Watch List

  5. Debugger watch list improvements for vectors and matrices.
  6. Fixed paths in project files. An error could cause files to disappear from projects.

Tester

  1. Improved stopping of tester agents at platform shutdown.
  2. The fifth MQL5 Cloud Network node has been added. It is located in Hong Kong. The new node speeds up the optimization of robots via the network in the nearest regions.

Fixed errors reported in crash logs.

29 April 2022
MetaTrader 5 build 3280: Improvements and fixes based on traders' feedback

Terminal

  1. Fixed filling of standard Trailing Stop levels in the context menu of open orders and positions.



  2. Updated user interface translations.
Fixed errors reported in crash logs.
21 April 2022
MetaTrader 5 build 3270: Improvements and fixes

Terminal

  1. Built-in chat improvements.
    • Updated design. Messages now appear without encircling bubbles to optimize display and space utilization. Added avatars and date separators.
    • Copy and Delete commands have been added to the message menu.
    • Bug fixes and stability improvements.



  2. Fixed bulk position closing commands. An error occurred on accounts with the hedging position accounting system.
  3. Fixed accounting for certain deal types when generating the history of positions.

Fixed errors reported in crash logs.
15 April 2022
MetaTrader 5 build 3260: Bulk operations, matrix and vector functions, and chat enhancements

Terminal

  1. Added commands for bulk closing of positions and cancellation of pending orders.
    New "Bulk Operations" command has been added to the context menu of the Trade tab. The list of available commands is formed automatically, depending on the selected operation and on your account type.



    The following commands are always available in the menu:
    • Closing all positions On hedging accounts, the system tries to close positions by opposite ones (Close By), and then it closes the remaining positions following a regular procedure.
    • Close all profitable or all losing positions
    • Delete all pending orders
    • Delete pending orders of certain types: Limit, Stop, Stop Limit

    If you select a position, additional commands appear in the menu:
    • Close all positions for the symbol
    • Close all positions in the same direction (on hedging accounts)
    • Close opposite positions for the same symbol (on hedging accounts)
    • Position reversal (on netting accounts)

    If you select a pending order, additional commands appear in the menu:
    • Delete all pending orders for the same symbol
    • Delete all pending orders of the same type for the same symbol

    These commands are only available if One Click Trading is enabled in platform settings: Tools \ Options \ Trade.
  2. Enhanced internal chart features:
    • Added ability to reply to messages. The source message text will be cited in the reply.
    • Added ability to create messages with different content types, such as images with text and text with attachments, among others.
    • Fixed display of the separator between read and unread messages.
    • Error fixes and stability improvements.



  3. Optimized and accelerated operation of the terminal's graphical system. Interface rendering will require less resources.
  4. Fixed calculation of daily price changes for futures. If the broker provides a clearing price, this price will be used for calculations.
    ((Last - Clearing Price)/Clearing Price)*100
    A detailed description of all calculation types is available in the Documentation.

  5. Fixed errors during MQL5 service purchases:
    • Payment systems could return errors for successful operations under certain conditions.
    • An incorrect price could be displayed at intermediary product renting steps in the Market.

  6. Fixed operation of the "Start" button in the purchased/downloaded Market product page. Now the button correctly launches the application on the first open chart.
  7. Fixed accounting for certain deal types when generating the history of positions.

MQL5

  1. Added new functions for working with matrices and vectors:
    • Median — returns the median of the matrix or vector elements
    • Quantile — returns the q-th quantile of matrix/vector elements or elements along the specified axis
    • Percentile — returns the q-th percentile of matrix/vector elements or elements along the specified axis
    • Std — computes the standard deviation of matrix or vector elements
    • Var — computes the variance of matrix or vector elements
    • CorrCoef — computes the matrix/vector correlation coefficient
    • Correlate — computes the cross-correlation of two vectors
    • Convolve — returns the discrete, linear convolution of two vectors
    • Cov — computes the covariance matrix

  2. We have started adding built-in methods for numeric arrays. The new methods enhance usability, increase code compactness, and improve code compatibility with other languages.

    The following three methods are already available:
    • ArgSort — sorts arrays by the specified dimension; the last one is used by default (axis=-1).
    • Range — returns the number of elements in the specified array dimension. Analogue of ArrayRange.
    • Size — returns the number of array elements. Analogue of ArraySize.

    Example:
    void OnStart()
      {
       int arr[4][5]=
         {
            {22, 34, 11, 20,  1},
            {10, 36,  2, 12,  5},
            {33, 37, 25, 13,  4},
            {14,  9, 26, 21, 59}
         };
       ulong indexes[4][5];
    //--- Sort the array
       arr.ArgSort(indexes,-1,0);
       Print("indexes");  
       ArrayPrint(indexes);
      }
    
    // Result log:
    // indexes
    //     [,0][,1][,2][,3][,4]
    // [0,]   4   2   3   0   1
    // [1,]   2   4   0   3   1
    // [2,]   4   3   2   0   1
    // [3,]   1   0   3   2   4

  3. We have started adding built-in methods for strings.
    The following methods are currently available:
    • BufferSize — returns buffer size allocated for the string.
    • Compare — compares two strings and returns the comparison result as an integer.
    • Length — returns the number of characters in a string.
    • Find — searches for a substring in a string.
    • Upper — capitalizes a string.
    • Lower — converts a string to lowercase.
    • Replace — replaces a substring.
    • Reserve — reserves a buffer for a string.

    All methods are analogous to string functions.

      Example:
      void OnStart()
        {
         string test="some string";
         PrintFormat("String length is %d",test.Length());
        }
      
      // Result log:
      // String length is 11
    • Added SYMBOL_SUBSCRIPTION_DELAY value into the ENUM_SYMBOL_INFO_INTEGER enumeration for the delay in quotes delivery for specific symbols.

      It is only used for subscription-based trading symbols. The delay is usually applicable to data provided in trial mode.

      The property can only be requested for symbols selected in the Market Watch. Otherwise, the ERR_MARKET_NOT_SELECTED (4302) error will be returned.

    • Added ACCOUNT_HEDGE_ALLOWED property into the ENUM_ACCOUNT_INFO_INTEGER enumeration — enables the opening of opposite positions and pending orders. The property is only used for hedging accounts to comply with specific regulatory requirements, according to which an account cannot have opposite positions for the same symbol, while same-direction positions are allowed.

      If this option is disabled, accounts are not allowed to have opposite-direction positions and orders for the same financial instrument. For example, if the account has a Buy position, the user cannot open a Sell position or place a pending Sell order. If the user tries to perform such an operation, the TRADE_RETCODE_HEDGE_PROHIBITED error will be returned.

    • New properties in the ENUM_SYMBOL_INFO_DOUBLE enumeration:
      • SYMBOL_SWAP_SUNDAY
      • SYMBOL_SWAP_MONDAY
      • SYMBOL_SWAP_TUESDAY
      • SYMBOL_SWAP_WEDNESDAY
      • SYMBOL_SWAP_THURSDAY
      • SYMBOL_SWAP_FRIDAY
      • SYMBOL_SWAP_SATURDAY

      Use the values to obtain swap calculation rates for specific days of the week. 1 — single swap, 3 — triple swap, 0 — no swap.

    • Fixed operation of CopyTicks and CopyTicksRange functions. An error could cause the return of outdated data when crossing through midnight. The error occurred when no ticks were provided for the financial instrument.
    • Fixed errors reported in crash logs.

    11 February 2022
    MetaTrader 5 build 3210: New matrix methods and control over indicator minimum/maximum values

    MQL5

    1. Added Min, Max, ArgMin, ArgMax and Sum functions for vectors and matrices. Use the functions to find the minimum and the maximum values, relevant indexes and the sum.
    2. Added support for Flat methods for the matrix. With these methods, a matrix element can be addressed through one index instead of two.
      double matrix::Flat(ulong index) const;      // getter
      void matrix::Flat(ulong index,double value); // setter

      Pseudocode for calculating the address of a matrix element:

      ulong row=index / mat.Cols();
      ulong col=index % mat.Cols();
      
      mat[row,col]

      For example, for 'matrix mat(3,3)', access to elements can be written as follows:

        reading: 'x=mat.Flat(4)', which is equivalent to 'x=mat[1][1]'
        writing: 'mat.Flat(5, 42)', equivalent to 'mat[1][2]=42'

      If the function is called with an invalid matrix index, the OutOfRange critical execution error will be thrown.

    3. Improved formatting of floating-point numbers in MQL5-program input parameters. When reading some real numbers, numbers with many zeros were substituted into the input parameters, for example, 0.4 was represented as 0.400000000002.
    4. Fixed errors in the Math\Stat\Math.mqh math library. The MathSample function from this library has been revised to match the traditional behavior of similar math libraries when sampling with backtracking.
    5. Fixed CopyTicks/CopyTicksRange error which could cause the return of outdated data when crossing over the midnight, when no ticks are provided for the financial instrument.
    6. Added new INDICATOR_FIXED_MINIMUM and INDICATOR_FIXED_MAXIMUM values into the ENUM_CUSTOMIND_PROPERTY_INTEGER enumeration.
      Using these properties, you can fix or unfix the minimum and maximum indicator values using the IndicatorSetInteger function. When calling IndicatorSetInteger(INDICATOR_FIXED_MINIMUM/INDICATOR_FIXED_MAXIMUM, true), the current minimum or maximum value is used.





    Tester

    1. Revised Sharpe Ratio calculation algorithm to match the traditional formula, in which the value corresponds to a one-year interval. The previous algorithm was based on the variability of obtained PnL and it ignored equity fluctuations against open positions. Now the calculation includes equity movements, while the Sharpe ratio is interpreted in a classical way:
      • Sharpe Ratio < 0              The strategy is unprofitable and is not suitable. Bad.
      • 0 < Sharpe Ratio  < 1.0    The risk does not pay off. Such strategies can be considered when there are no alternatives. Indefinite.
      • Sharpe Ratio ≥ 1.0          If the Sharpe ration is greater than one. This can mean that the risk pays off and that the portfolio/strategy can show results. Good.
      • Sharpe Ratio ≥ 3.0          A high value indicates that the probability of obtaining a loss in each particular deal is very low. Very good.

    Terminal

    1. Optimized memory consumption by the terminal.
    2. Improved platform operation with a network subsystem to enhance performance and to reduce network delays.
    3. Removed the display of the zero grid level in indicators when grid rendering is disabled.


    28 January 2022
    MetaTrader 5 platform build 3180: Vectors and matrices in MQL5 and improved usability

    Terminal

    1. Added chart window activation when moving a Market Watch symbol or a trading operation from account history to it.

      Both of these actions change the chart financial instrument to the selected one. Previously, they did not let the chart window become active. Accordingly, some further actions, such as calling a trading dialog (F9) or changing the scale (+/-) using hotkeys, could erroneously be applied to another chart. Now the chart, whose symbol has been changed by dragging, becomes selected for further work right away.

    2. Added opening a new order window when double-clicking on a trade operation in the account history. A financial instrument from the operation a user has clicked on is immediately inserted into the dialog allowing for faster trading. A similar command has been added to the context menu.




    3. Added smart inclusion of real or tick volumes when opening new charts. This data is important when analyzing the market. However, not all traders are aware of its availability in the platform.

      Real trading volumes have a higher priority. If they are provided by a broker, their display is enabled on the chart. Otherwise, the display of tick volumes is enabled.

      The mechanism is used only if the chart is opened with the default.tpl template. Volumes are no longer enabled when reopening a chart if a user has manually disabled them in the chart settings. Custom templates are not affected.

    4. Optimized and greatly accelerated the user interface display.
    5. Improved the chart printing function called via the File menu:
      • Fixed saving print settings
      • Improved the printed page appearance: increased grid lines, removed the program name, updated the header font
      • Enlarged the print dialog for correct interface display

    6. Fixed the volume field operation in the fast trading panel of the chart. Before the fix, the value was reset to the previous one after entering a new value and pressing Tab.
    7. Fixed trading history display on the chart. Previously, operations of the previous account were not removed from charts when switching between accounts.
    8. Fixed paying for MQL5.com via PayPal.
    9. Fixed the platform freeze when displaying an option volatility chart.
    10. Fixed phone number verification in the real account registration window. In some cases, the platform did not allow a user to proceed to the next registration stage after a correct number was entered.
    11. Fixed checking the rights when joining a group chat with MQL5.com members. Previously, a newly joined user could only read messages without being able to write them.
    12. Changed the chart text in case of data absence. Now "Waiting for update" is replaced with a symbol name, timeframe and symbol.
    13. Improved support for negative prices added in build 2450. Zero values can now also be displayed for the appropriate Market Watch symbols.
    14. Fixed display of product logos in the Market when working under Wine.

    MQL5

    1. We continue adding vector and matrix support. The new functions significantly expand the possibilities for neural network-based solution developers.

      Multiple functions are currently ready for use:

      • Eye — construct a matrix with ones on a specified diagonal and zeros elsewhere.
      • Identity — construct a matrix having a specified size with ones on the main diagonal and zeros elsewhere.
      • Ones — construct a matrix having a specified size filled with ones.
      • Zeroes — construct a matrix having a specified size filled with zeros.
      • Full — construct a matrix having a specified size filled with specified values.
      • Copy — construct a copy of a matrix or vector.
      • Diag — extract a diagonal from a matrix and fill in the specified diagonal with values from a vector.
      • Tri — construct a matrix with ones on a specified diagonal and below, and zeros elsewhere.
      • Row — return a matrix row as a vector and fill in the specified row with values from the vector.
      • Col — return a matrix column as a vector and fill in the specified column with values from the vector.
      • Rows — return the number of rows in a matrix.
      • Cols — return the number of columns in a matrix.
      • Transpose — transpose a matrix.
      • * — product of matrices, vectors and scalars — dot product.
      • Power — raise a matrix to a power.
      • Kron — Kronecker product.
      • Cholesky — Cholesky decomposition.
      • QR — QR factorization of a matrix.
      • SVD — singular decomposition.
      • LU — LU decomposition of a matrix.
      • LUP — LUP decomposition of a matrix.
      • Norm — calculate matrix norm.
      • Cond — compute the condition number of a matrix.
      • Spectrum — compute spectrum of a matrix
      • Det — compute the determinant of a matrix.
      • Rank — compute matrix rank.
      • SLogDet — compute the sign and base logarithm of the determinant of a matrix.
      • Trace — compute matrix trace.
      • Solve — solve a system of linear equations.
      • LstSq — solve a system of linear equations using the least squares method.
      • Inv — compute the inverse of a matrix.
      • PInv — compute the pseudo-inverse of a matrix by the Moore-Penrose method.
      • Compare — compare two matrices using epsilon.

      For more details please read the relevant MQL5 documentation.

    2. Fixed errors when handling files and databases related to path length limitation. In particular, the DatabaseOpen function allowed setting the path larger than the acceptable one causing incorrect database creation. Now the function returns the ERR_TOO_LONG_FILE_NAME error code correctly.
    3. Fixed variable constancy control. Previously, the compiler could occasionally skip the "constant variable cannot be passed as reference" error.
    4. Fixed erroneous compiler warnings about using an uninitialized variable.
    5. Fixed ChartWindowOnDropped function operation for indicators. Previously, it always returned zero.
    6. Added support for Python 3.10 to the Python integration module.

    VPS

    1. Fixed displaying the VPS item in the Navigator. Previously, it could occasionally disappear when switching between accounts.

    MetaEditor

    1. Fixed unwrapping of complex expressions in the debug observation window.

    Tester

    1. Fixed export of test reports to files. Some values could be rounded incorrectly if a currency with a precision of 0 decimal places was used as a deposit currency. For example, JPY.
    22 October 2021
    MetaTrader 5 platform build 3091: Improvements

    Terminal

    1. Fixed opening of an empty page when purchasing MQL5 services. Now operation results are immediately displayed to the user.
    2. Fixed excessive compression of document images which users upload when requesting real accounts. This has improved the quality of automatic KYC checks and has facilitated the entire account opening procedure.
    3. Fixed operation of graphs which are opened upon testing completion.

    MQL5

    1. Added support for SQLite 3.36.0.

    MetaEditor

    1. Added background highlighting for matching brackets. The option can be enabled via MetaEditor's general settings.
    2. Improved MQL5 program debugger.

    Fixed errors reported in crash logs.
    21 October 2021
    MetaTrader 5 build 3090: Improvements and fixes

    Terminal

    1. Fixed an error which could cause custom trading symbols to disappear under certain conditions.
    2. Improved menu and toolbar icons.
    3. Three new languages have been added to MQL5.com: French, Italian and Turkish.

      Now the largest community of algorithmic traders MQL5.community is available in 11 languages. We have already localized the website interface, documentation and important forum topics. Articles and Economic Calendar in the new languages will also become available soon.

    4. Fixed errors reported in crash logs.

    MQL5

    1. Fixed bugs in the StringConcatenate function.
    2. Fixed setting of the _LastError value when working with the FileSave function. The variable could contain a null value instead of the description of the function error under certain conditions.
    3. Fixed data import from resources to double type arrays.

    MetaTester

    1. Fixed an error which caused the chart window to freeze during visual testing.
    Updated documentation
    14 October 2021
    MetaTrader 5 build 3081: Improvements in MQL5 services and design updates

    Terminal

    1. Improved navigation in MQL5.community services.

      Market, Signals and VPS sections have been moved from the main platform workspace to the Navigator. The new positioning provides easy access to the desired products and enables efficient management of purchases and subscriptions. "How it works" sections have been added to each service, to provide the basic usage information.


      Improved navigation through MQL5.community services


    2. All menu and toolbar icons have been completely redesigned. The terminal interface has become more user-friendly:

      • Removed small elements from icons
      • Reduced the number of used colors to avoid color noise
      • Fewer gradients are used to improve readability
      • More straightforward metaphors are used


      All menus, toolbars and dialogs have been redesigned in the platform


    3. Added the display of costs resulting from deal execution. The relevant information is shown in the trading history. This feature is used by NFA regulated brokers.


      The account history now shows deal costs>


      If your broker enables cost calculation on the server, the new Costs column will appear in your account trading history. The column shows the deal execution cost relative to the current mid-point price of the symbol (mid-point spread cost).

    4. Launched Korean version of MQL5.com.

      This is the eighth language available at MQL5.community, the largest community of algorithmic traders. The website interface, articles, the Economic Calendar and important forum topics are already available in Korean. MQL5 documentation will be translated soon.

    5. Fixed loading of custom trading instruments. In some cases, newly created symbol settings could overwrite existing symbol settings.
    6. Fixed the on-chart display of the signal trading history. Previously, the relevant option enabled the display of all trades for all financial instruments, and not only for the chart symbols.
    7. Added export of the Fee column to the trading history report. Previously the value was only displayed in the history, but it could not be saved to a file.
    8. Optimized and accelerated operation of one-click trading panels in Market Watch and on charts.
    9. Fixed operation of the Margin Ratios field for custom trading instruments. The values could be reset to zero under certain conditions.
    10. We continue implementing the Subscriptions service through which traders can purchase additional trading services from brokers. Fixed errors in the quotes subscription window.
    11. Fixed display of the Trend Line analytical object. Previously the line could disappear upon scaling or upon chart window resizing.
    12. Fixed display of the Rectangle analytical object. The object could disappear if one of the anchor points was beyond the chart visibility area.
    13. Fixes and operation speed improvements related to operation of built-in MQL5.community charts.
    14. Fixed rounding of the Value parameter in the list of open positions. The fractional part could be hidden in previous versions.
    15. Fixed mobile phone verification during the account opening process. Phone numbers could be identified as incorrect for some Chinese operators.
    16. Added support for MQL5 account passwords longer than 32 characters.
    17. Fixed export of certificates when working in Wine. This option is used for accounts with extended authentication, when migrating such accounts from desktop to mobile.
    18. Fixed buttons opening MQL5 services in the lower panel of the Toolbox window. The buttons were inactive when the window was undocked.
    19. Added limitation on the "File \ New Chart" menu size. Now the menu can contain no more than 128 submenus with symbol groups, each having no more than 32 symbols. The limitation speeds up the terminal operation and avoids freezing when adding a large number of trading symbols (2,000 or more) to Market Watch.

    MQL5

    1. We continue adding vector and matrix support. The new functions will significantly expand the possibilities for neural network-based solution developers.
    2. Added DEAL_SL and DEAL_TP values in the ENUM_DEAL_PROPERTY_DOUBLE enumeration — the Stop Loss and Take Profit levels of a deal.

      The relevant values for entry and reversal deals are set in accordance with the Stop Loss/Take Profit of orders, which initiated these deals. The Stop Loss/Take Profit values ​​of appropriate positions as of the time of position closure are used for exit deals.

    3. Added the MQL_HANDLES_USED value in the ENUM_MQL_INFO_INTEGER enumeration — the number of active class objects (handles) in an MQL program. These include both dynamic (created via new) and non-dynamic objects, global/local variables or class members. The more handles a program uses, the more resources it consumes.

    4. Added new methods for working with the MqlCalendarValue structure which describes an economic calendar event:

      • HasActualValue(void) — returns true if the actual value is set; otherwise returns false
      • HasForecastValue(void) — returns true if the forecast value is set; otherwise returns false
      • HasPreviousValue(void) — returns true if the previous value is set; otherwise returns false
      • HasRevisedValue(void) — returns true if the revised value is set; otherwise returns false
      • GetActualValue(void) — returns the actual value of an event (double) or nan if the relevant value is not set
      • GetForecastValue(void) — returns the forecast value of an event (double) or nan if the relevant value is not set
      • GetPreviousValue(void) — returns the previous value of an event (double) or nan if the relevant value is not set
      • GetRevisedValue(void) — returns the revised value of an event (double) or nan if the relevant value is not set

    5. Fixed debugging of the MQL5 programs which use libraries in the form of EX5 files.
    6. Accelerated compilation of programs containing large arrays initialized by a sequence.
    7. Fixed execution of the CopyTicksRange function with custom trading symbol data. The function could return data out of the requested period.
    8. Fixed verification of the availability of all template parameters during specialization by parameters. Code compilation with debug templates could cause "code generation error" under certain conditions.

    Signals

    1. Added capability to automatically renew Signal subscriptions.

      Your subscription will not end abruptly, as the system will automatically renew it for another month through the payment method that you previously used for the initial subscription purchase.


      Enable auto renewal for your Signal subscription


      If you made your previous payment using a card and the renewal payment fails, the system will try to make a payment from your MQL5 account balance.

      Do not worry about changes in subscription prices. If the price grows, auto-renewal will be canceled. You will receive a relevant notification by email.

      You can enable or disable the auto renewal option at any moment via the My Subscriptions section at MQL5.com.


      Manage auto renewals from the My Subscriptions section at MQL5.com


    2. Fixed display of the Signals showcase. Now the system correctly identifies the compatibility of signals with the current account.

    Market

    1. Added product search by the author's name and login in the Market showcase. Previously, the service only supported search by product name and description.

    VPS

    1. Improved the auto subscription renewal option.

      Previously, the payment for the renewal could only be made from the MQL5 account balance. The user had to make sure the relevant amount is available on their account.

      Now there is no need to top up the MQL5 account. The system will renew the subscription using the same payment method which you used for the initial subscription. If you paid for the VPS with a card and enabled the auto renewal option, the system will use the same payment method for the new subscription period. If the payment fails, the system will try to make a payment from your MQL5 account balance.


      Use cards and other payment methods for auto renewal


      With the new option, you can be sure that your Expert Advisors and signal subscriptions will not stop due to the end of the VPS period. Furthermore, there is no need to check and top up your balance manually.
      The option will only be used for new subscriptions. Payments for the renewal of existing subscriptions will be made from the MQL5 account balance.

    Tester

    1. Fixed visual testing errors. Under certain conditions, charts could fail to display indicators used in Expert Advisors.

    MetaEditor

    1. Fixed jumping to the function or variable declaration using Alt+G. The action could fail if the declaration was below the call line.
    2. Added display of the object type for references to class objects in the debugger.
    3. Added capability to display union in the list of watched expressions.

    MetaTrader 5 iPhone/iPad, MetaTrader 5 Android

    1. Added display of a disclaimer during application start. Please read it carefully. Additionally, some brokers can automatically create a demo account during the first start of the application. In this case, you will see the relevant terms.


      Disclaimers added in MetaTrader 5 for iPhone/iPad

    2. Added capability to connect an account to monitoring in the Signals service directly from the mobile application. This can be done by selecting "Account Monitoring" from the menu. For convenience, the account number and the broker name are automatically added to the registration window. You should additionally specify the signal name and an investor password.

      Connect your account to the monitoring to access advanced trading statistics, to share the results with other traders or to start selling your signals.

    3. Added support for Huawei AppGallery and HMS Services for mobile terminals running on Android OS. Huawei smartphone owners can install the app from the relevant store and use push notifications.
    Updated documentation
    18 June 2021
    MetaTrader 5 build 2980: Push notifications for trade operations

    Terminal

    1. Added ability to receive push notifications from the server. You will be notified of executed trading operations even if your terminal is closed.



      In earlier versions, notifications on a mobile device could only be delivered from the trader's desktop terminal. Upon the execution of a trading operation, the terminal sent the relevant notification to MetaQuotes ID specified in settings. Notifications could only be sent from a running terminal. This requirement has been lifted. If a Take Profit triggers on the server while your computer is turned off, you will receive a notification about a closed position from the server.

      To start receiving notifications from the server, you should:

      • Have a real account as server notifications do not work for demo accounts
      • Install MetaTrader 5 for iOS or Android on your smartphone
      • Open the Messages section in the mobile terminal, find your MetaQuotes ID and specify it in the desktop terminal settings
      • Enable server notifications in desktop terminal settings

      The availability of server notifications should be provided by your broker

      Three notification types are supported: orders, deals and balance operations. When you enable the option, the available notification types will be displayed in the terminal log:
      '1222': subscribed to deals, orders, balance notifications from trade server

    2. Updated MetaTrader VPS Showcase. The VPS section has become more convenient:
      • The interface adapts to any screen width.
      • The showcase takes up less space vertically to fit in the workspace.
      • The necessary information appears only when it is needed. Payment details only appear after you select a payment plan.



      Terminal: In the Strategy Tester panel, added commands for quick switching to MQL5 services and to the Toolbox window. The commands are only displayed in the Overview section, while in other tabs the panel is used to manage testing.



    3. Added saving of window states for MQL5 services. If you leave the Market open before closing the terminal, the relevant window will be open the next time you launch the terminal.
    4. Fixed periodic synchronization of the MQL5 account state. Signal copying could fail under certain conditions due to an error.
    5. Fixed display of a selection of recommended Market products.
    6. Fixed signals context menu in the Navigator. You can use the menu to view the signal to which you are subscribed or to unsubscribe from a signal.

    MQL5

    1. Fixed "-" operator error in the implementation of complex numbers in the Standard Library (file MQL5\Include\Math\Alglib\complex.mqh).
    2. Now you can use any expressions in initialization sequences, not just constant ones. This improves usability and compatibility with C ++ code.
      struct POINT
        {
         int x,y;
        };
      
      int GetYFunc(y)
        {
         return(y * y);
        }
      
      void SomeFunction(int x1,int x2,int y)
        {
         POINT pt={ x1+x2, GetYFunc(y) };
         ProcessPoint(pt);
        };
    3. Fixed an error which occurred during the compilation of union with huge data arrays.
    4. MQL5: Fixed operation of the StringToCharArray function. Now it converts the entire passed string to a Char array instead of stopping at the first terminating null character.
    5. Added control for the explicit presence of a constructor call for classes/structures if their parent class does not have a default constructor.

    MetaEditor

    1. Added display of a call place for inline functions in the profiler report.
      In the below example, the func(); call is now highlighted as follows:




      The func function itself is not highlighted since its full code is placed in OnStart.

    2. Added ability to create empty projects. This is a useful feature for non-standard development projects with specific file structures for which the default templates are not suitable.



      An empty settings file "mqproj" will be created in this case. Source code files should be created manually.

    3. Implemented faster launching of MetaEditor.
    4. Fixed data display in the list of observed expressions during debugging. The list could display incorrect variable values under certain conditions.
    5. Fixed automatic addition of ".py" extension to Python script files created using the MQL Wizard.
    Updated documentation.


    21 May 2021
    MetaTrader 5 Build 2940: Positioning of MQL5 Services showcases in the workspace and updated design

    Terminal

    1. Trading services, including Market, Signals and Virtual Hosting are now conveniently displayed in the platform's main working area.

      In earlier versions, MQL5 Services purchasing areas were located in the small Toolbox window below the main window. The new placement enables the display of fully featured showcases with convenient purchasing options. The removal of unnecessary tabs from the lower area provides more space for other platform functions.



      Access to additional services does not interfere with the major functions, such as trading and chart analysis.

      • Service tabs are located at the end of the bar, after all chart tabs.
      • Unused service windows can be closed. To re-open them, use the Navigator, the toolbar or the "Services" menu.

      We have also completely redesigned the services. The design has become more elegant and lightweight. Signals feature additional data, which were previously available only via the MQL5.community website showcase: a polar diagram with the main characteristics, reliability and activity metrics and other variables.



    2. Added support for IPv6 addresses.

      IPv4 which is used in every network was created more than 30 years ago. It contains IP addresses of 32 bits, which are represented as four 8-bit numbers separated by dots. This algorithm produces more than four billion unique IP addresses. However, the rapidly growing number of users and devices has accelerated the depletion of the pool of available addresses.

      To avoid the depletion problem, some products feature additional support for the modern IPv6 standard. This protocol uses a 128-bit address, represented as x:x:x:x:x:x:x:x, where each x is a hexadecimal value of six 16-bit address elements. Theoretically, this format allows 5 x 10 ^ 28 unique addresses. In addition to an extensive address space, this protocol has other advantages over the older version. For further details please refer to specialized articles.

      The MetaTrader 5 platform is fully IPv6-ready. If your broker or provider switches to the new protocol, the protocol support will be seamlessly enabled in the platform, with no additional action required from your end.

    3. We continue implementing the Task Manager functionality presented in build 2815. We have added an explicit indication for charts, on which MQL program debugging or profiling is running.



    4. Implemented faster platform launching under Wine on macOS and Linux computers. General optimization and bug fixes:
      • Improved display of menus, toolbars and dialog boxes.
      • Fixed errors in displaying the "Market", "Signals" and "VPS" sections. In particular, we have fixed the loading of product logos on the "Market" showcase.
      • Updated package for easy MetaTrader 5 installation on macOS computers. With this package, the platform can be installed similarly to any other application.
        The package includes additional components which enable a more stable and a faster operation. All package users are strongly advised to reinstall MetaTrader 5 by downloading the latest version from https://download.mql5.com/cdn/web/metaquotes.ltd/mt5/MetaTrader5.pkg.zip


      If you are using CrossOver, please completely reinstall MetaTrader 5 to obtain the latest 64-bit platform version.
    5. Fixed "Ctrl+F9" keyboard shortcut action. It activates the Trade tab in the Toolbox.

    MQL5

    1. We continue limiting the circulation of older technologies, including 32-bit components.
      • 32-bit terminals are no longer allowed to load programs from the Market.
      • 32-bit terminals cannot connect to the hosting service.
      • The 32-bit MetaEditor version does not support additional file protection via MQL5 Cloud Protector.
      • MQL5 programs compiled under old MetaEditor versions (released 5 years ago or more) cannot run in the new terminal version.

      Support for the 32-bit platform version was discontinued a year ago, after the release of build 2361. We strongly recommend upgrading to the 64-bit MetaTrader 5 version in order to access all the platform's features without any limitation.
      Furthermore, we recommend all Sellers, who have previously uploaded 32-bit product versions to the Market, to recompile them using the latest 64-bit MetaEditor and to upload the new versions. The ability to run 32-bit MQL5 programs in terminals will be completely disabled soon.

    2. Added support for operations with complex numbers.

      Added new built-in type "complex".
      struct complex
        {
         double             real;   // Real part
         double             imag;   // Imaginary part
        };
      The "complex" type can be passed by value as a parameter for MQL5 functions (in contrast to ordinary structures, which are only passed by reference). For functions imported from DLLs, the "complex" type must be passed only by reference.

      The 'i' suffix is used to describe complex constants:
      complex square(complex c)
        {
         return(c*c);
        }
        
      void OnStart()
        {
         Print(square(1+2i));  // A constant is passed as a parameter
        }
      
      // "(-3,4)" will be output, which is a string representation of the complex number 
      Only simple operations are currently available for complex numbers: =, +, -, *, /, +=, -=, *=, /=, ==,!=.

      Support for additional mathematical functions will be added later, enabling the calculation of the absolute value, sine, cosine and others.

    3. New error code TRADE_RETCODE_HEDGE_PROHIBITED — opening of a position or placing of a pending order is not allowed because hedge positions are prohibited. The error is returned if a user tries to execute a trading operation in case the hedging is disabled for the account and an opposite order or position already exists for the same symbol.

    MetaEditor

    1. Fixed debugging and profiling termination in non-visual mode.
    2. Fixed indicator profiling on real data. Such profiling could fail to start under certain conditions.

    VPS

    1. Fixed environment migration to a VPS. An error could occur for Expert Advisors containing indicators as resources.

    Signals

    1. Fixed trading mode checks for copied signals. Symbol trading can be limited on the broker side, i.e. the broker can set 'long only', 'short only' or 'close only' conditions. In earlier versions, synchronization required full trading conditions and thus copying was not allowed for all other cases. After the update, partially limited conditions will be considered as "trading". This ability will be especially useful for stock brokers' clients who wish to copy signals.

    Tester

    1. Fixed trading session checks during testing. Trading operation execution could fail during testing under certain conditions, in which case the "market closed" error was returned even if the operation was initiated within a trading session.
    Updated documentation.

    2 April 2021
    MetaTrader 5 build 2875: Improvements and fixes

    Terminal

    1. Fixed a bug which caused updated MQL5 standard programs to be copied to the terminal's root data directory instead of the MQL5 subdirectory. Due to this error, additional "Experts", "Images", "Include" and other folders could be created under the data directory.

      After the platform update, these folders will be checked and automatically deleted.
    2. Fixed an error which used to prevent users from logging into the built-in MQL5.community chat.

    Tester

    1. Fixed optimization of Expert Advisors via the MQL5 Cloud Network. The optimization could fail to start under certain conditions.

    MetaEditor

    1. Fixed errors and crashes during MQL5 program debugging and profiling.

    Updated documentation.
    1234567891011121314...16