What's new in MetaTrader 5

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

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 DMG package for easy MetaTrader 5 installation on macOS computers. With this package, the platform can be installed similarly to any other application: drag the platform icon to Applications and wait for the installation to complete.
        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.software.corp/mt5/MetaTrader5.dmg
      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.
    26 March 2021
    MetaTrader 5 build 2860: Improvements for Wine and SQL integration enhancements

    Terminal

    1. Added ability to enable/disable additional MQL5.community services. For example, if you are not interested in MQL5 programming articles or copy trading features of the Signals service, you can disable the relevant section to optimize resources and terminal workspace.


      All services are enabled by default.

    2. We have significantly optimized terminal operation under Wine on macOS and Linux:
      • Now undocked service windows (Navigator, Toolbox) cannot be dragged beyond terminal borders. Previously, this could cause difficulty in dragging windows back to the terminal.
      • Fixed resizing of service window contents when resizing the window.
      • Fixed display of performance metrics in Task Manager.
      • Improved display of icons on the toolbar.
      • Fixed unread message counter in chats.
      • Fixed display of chart system commands: Hide, Expand and Close.
      • Fixed log display.
      • Fixed display of chart tooltips.
      • Fixed chart print commands.
      • Fixed display of the top menu when using Linux skins.
      • Fixed search in GitHub, MSDN and Stack Overflow in MetaEditor.
      We recommend all users to update Wine to the latest stable version. This will increase the platform performance and reliability.
    3. Added support for "Market To Limit" orders when trading on BORSA Istanbul. Such an order is initially executed as a market order. If liquidity is not enough, the remaining volume is added to the order book as a limit order with the last deal price.
    4. Fixed volatility chart display. Now, the chart is built in accordance with the expiry date selected on the options board.
    5. Fixed adding of trading instruments to the Market Depth via the quick search bar. If the symbol name has a space, this symbol will not be added to the list.



    MQL5

    1. Expanded possibilities for working with SQL databases. Queries now support a variety of statistical and mathematical functions.

      Statistical functions
      • mode
      • median (50th percentile)
      • percentile_25
      • percentile_75
      • percentile_90
      • percentile_95
      • percentile_99
      • stddev or stddev_samp — sample standard deviation
      • stddev_pop — population standard deviation
      • variance or var_samp — sample variance
      • var_pop — population variance

      Mathematical functions

      Example
      select
        count(*) as book_count,
        cast(avg(parent) as integer) as mean,
        cast(median(parent) as integer) as median,
        mode(parent) as mode,
        percentile_90(parent) as p90,
        percentile_95(parent) as p95,
        percentile_99(parent) as p99
      from moz_bookmarks;
    2. Added new macros:

      • __COUNTER__ — increases by one on each call. Separate counters are provided when used in templates and macros.
      • __RANDOM__ — generates a random ulong number; it is an analogue of the MathRand function.

    3. Fixed operation of synchronous chart requests in cases when the chart symbol does not exist. Now, the functions return a relevant error instead of waiting indefinitely for a result. A situation with a non-existent symbol be caused by switching between trading accounts with different sets of trading instruments.
    4. Optimized and accelerated CopyTicks* functions.

    MetaEditor

    1. Changed order of profiling and debugging using historical data.

      Profiling now always runs in non-visual mode. Default debugging also runs in non-visual mode. The appropriate option can be enabled manually in MetaEditor settings:



    2. Added ability to profile services. The process is similar to other MQL5 programs.
    3. Fixed display of function names in the profiler report. Under certain conditions, the names could be specified as <unknown>.

    Documentation has been updated.

    26 February 2021
    MetaTrader 5 build 2815: Access to the Depth of Market from Python, revamped Debugger, and Profiler improvements

    Terminal

    1. Added ability to access Depth of Market data via the Python API.
      Three new functions allow quick obtaining of data for statistical calculations and machine learning tasks, which can be implemented using a plethora of out-of-the-box Python libraries.
      • market_book_add — subscribes the MetaTrader 5 terminal to receive events related to changes in the Depth of Market for the specified symbol.
      • market_book_get — returns a tuple from BookInfo containing the Depth of Market records for the specified symbol.
      • market_book_release — cancels MetaTrader 5 terminal subscription to events related to changes in the Depth of Market for the specified symbol.

    2. The maximum length of Push messages has been increased from 256 to 1024 characters. Now, you can send more information from your MQL5 programs on mobile devices.
    3. Added a preliminary version of the Task Manager, which can be called by pressing the F2 key.
      The Task Manager enables monitoring of resources consumed by the platform. You can view the amount of memory consumed by charts, CPU resources used by Expert Advisors and other performance metrics. If your platform performance slows down, you can easily detect and fix the problem.




    4. Enhanced Subscriptions service. A special indication has been added for symbols having delayed quotes:
      • Symbols in Market Watch are marked with a clock icon, and the delay value is displayed in the tooltip
      • Data delay notification is displayed on charts



    5. Fixed display of the Subscriptions list when there is no trading account connection.
    6. Fixed links in emails and newsletters. All links now open in the default browser. Previously, links opened only in Internet Explorer.
    7. Fixed connections from the WebRequest function to hosts with IPv6 addresses and Cloudflare protection.
    8. Improved functionality and responsiveness of the VPS service.
    9. Improved operation under Wine and MacOS/Crossover, including the version for macOS Big Sur with the M1 processor.

    MQL5

    1. Fixed error in the ArrayPrint function. The function could occasionally fail to print arrays.
    2. Optimized file operations performed by File* functions. Now, file reading and writing operations run much faster.
    3. Removed the restriction requiring the specification of size for the second, third and fourth dimensions of a dynamic array, when the array is used as a function parameter. This increases code reuse and flexibility.
      void func(int &arr[ ][ ][ ][ ])
        {
        }
    4.  Fixed ArrayBsearch function operation. The function could return an incorrect index of the found element during a binary search.

    MetaEditor

    1. More new features have become available in the revamped debugger.
      • Arrays are now displayed in the observation window in accordance with the sorting set by ArraySetAsSeries.
      • Added support for local static variables.
      • Fixed display of the specified array element value.
      • Fixed handling of 'static' class fields.
      • Other improvements for more accurate and reliable debugging.

    2. Added option "Enable optimizations in profiling".
      Code optimization mode can be disabled in order to include more details in the profiling report. Code speed without optimization can be several times slower, but this mode provides a wider code coverage. Please note that with optimization code bottlenecks can be imprecise.
      A milder profiling mode can be set by disabling the "Enable inlining in profiling".


      The optimization management option has also been added to project settings.
      • If optimization is disabled in the project, then the new option is ignored, and thus optimization will always be disabled for profiling (including inlining operations).
      • If optimization is enabled in the project, then the new option will be taken into account during profiling compilation.

    3. Added logging for debugging and profiling processes. Environment settings are logged at operation start; collected data statistics is logged at operation stop.
      MQL5 profiler    starting 'ExpertMACD.ex5' on history with parameters:
      MQL5 profiler       symbol: 'EURUSD'
      MQL5 profiler       period: 'H1'
      MQL5 profiler       date from: '2021.01.01'
      MQL5 profiler       date to: '2021.02.22'
      MQL5 profiler       ticks mode: 'every tick'
      MQL5 profiler       execution delay: 0 ms
      MQL5 profiler       deposit: 10000
      MQL5 profiler       currency: 'USD'
      MQL5 profiler       leverage: 1:100
      MQL5 profiler       profit in pips: NO
      MQL5 profiler    profile data received (4640 bytes)
      MQL5 profiler    758 total measurements, 0/0 errors, 470 kb of stack memory analyzed
      MQL5 profiler    7782 total function frames found (1929 mql5 code, 342 built-in, 1403 other, 4108 system)

    Tester

    1. Fixed specification of non-trading hours in advanced testing settings.

    Updated documentation.
    15 January 2021
    MetaTrader 5 build 2755: Popup Prices window and Debugger improvements

    Terminal

    1.  Revised Popup Prices window which allows viewing financial symbol prices on any screen size.

      The window now supports multi-column presentation, enabling the efficient utilization of screen space. To switch the display mode, use the window properties dialog.


      Further improvements in this window are as follows:

      • Added column selection menu. The menu features the same symbol properties which are available in Market Watch.
      • Optimized operation with a large number of financial instruments. The window performance is now equally high for 10 and for 1000 instruments.
      • Added display of brief instrument information in a tooltip.
      • Fixed applying of color settings for displaying rising and falling prices.

    2. Added display of deals on the tick chart of the synthetic Market Depth.

      Synthetic Market Depth is used for the symbols, for which Level 2 prices are not provided. In this case, levels are built automatically, at distances equal to a price change step, starting from the best Bid and Ask prices. Now, if the last deal price and volume data is provided for a symbol, the relevant data is displayed on the tick chart. The information is displayed as circles:
      • Red circles show Sell transactions.
      • Blue circles show Buy transactions.
      • Green circles appear when the direction of the transaction is undefined.

      The larger the circle, the greater the volume of the transaction.



    3. Fixed calculation of Greeks in the options board. An error could occur if the option's underlying asset had a zero last deal price.
    4. We continue implementing the new "Subscriptions" service, which enables the provision of additional trading services. Recently, we have fixed the display of dependent subscriptions. Such subscriptions are used for bundled services.
    5. Improved platform operation under Wine.

    MQL5

    1. Added generation of ChartEvent events upon the release of the right and middle mouse buttons. This event can be utilized when creating graphical panels. To enable the events, disable the chart context menu via the CHART_CONTEXT_MENU property.
    2. Fixed a bug causing a significant error in the Sleep function waiting time.

    MetaEditor

    1. We have initiated the global update of the debugger. The window of observed expressions has been significantly improved. Now, it allows viewing the contents of arrays and objects as drop-down lists, as well as pointer values.



      To view an array or object, double-click on it in the observation window.

    2. Fixed freezing when opening some projects.

    Documentation has been updated.
    26 November 2020
    MetaTrader 5 build 2715: General improvements

    Terminal

    1. Fixed platform freezing when using the options board. Freezing could be caused by a zero tick size specified in trading instrument settings.
    2. Fixed UI display errors on HiDPI displays.

    MQL5

    1. Fixed string to time conversion by the StringToTime function. An error could occur when specifying time as "yyyymmdd [hhmiss]".
    2. Fixed operation of implicit copy operator for objects containing dynamic arrays. Now, the operation reduces the destination object size to the copied object size.
      struct MyStruct
      {
        string Array[];
      };
      
      void OnStart()
      {
        MyStruct a1,a2;
        ArrayResize(a1.Array,3);
        ArrayResize(a2.Array,1);
        a1=a2;
      }
      Earlier, the "a1" array size was equal to 3 after the function call. Now, the size will be 1.

    MetaTester

    1. Updated rating calculation algorithm for MQL5 Cloud Network testing agents. The rating is now determined more accurately and is changed less frequently.

    Documentation has been updated.
    12 November 2020
    MetaTrader 5 Platform Build 2690: MetaEditor improvements

    Terminal

    1. Fixed display of the synthetic Market Depth feature. Previously, this feature could be unavailable for some symbols.

      Synthetic Market Depth is used for the symbols, for which Level 2 prices are not provided. In this case, levels are built automatically, at distances equal to a price change step, starting from the best Bid and Ask prices. This is a convenient tool for placing, modifying and deleting orders, quickly and with maximum clarity.



    MQL5

    1. Optimized and greatly accelerated access to Last prices from MQL5 programs, using the SymbolInfoTick function.
    2. Fixed resetting of Ichimoku Kinko Hyo indicator parameters from a dialog box.




    3. Fixed freezing of Copy* functions when history is not available for a trading instrument.
    4. More improvements within the total update of the code profiler. The following improvements have been implemented, in addition to the innovations presented in build 2650:
      • Improved data presentation
      • Shorter column names are now used in the report
      • Ability to save profiling reports to a file
      • Added display of a tooltip with a row number for functions in the report.



    MetaEditor

    1. Added ability to disable clipboard tracking and to clear clipboard history.

      The clipboard tracking function improves the source code usability by providing quick access to recently used data. Press Alt+V in any source code position, select any of the earlier copied lines from the menu, and the line will be inserted in the selected position.
      Use the appropriate toolbar command or editor settings to enable/disable tracking.



    2. Fixed calculation of some observed expressions during program debugging.

    Tester

    1. Trading is now prohibited for Expert Advisors running in the Strategy Tester in the frame receiving mode.
    2. Fixed importing of optimization results in the Strategy Tester. An error could cause timeframe values to be imported incorrectly.

    Documentation has been updated.
    previous123456789101112131415