New MetaTrader 5 Platform build 3260: Bulk operations, matrix and vector functions, and chat enhancements

 

The MetaTrader 5 platform update will be released on Friday, April 15, 2022.

In the new version, we have added a set of commands for bulk position closing and pending order cancellation operations. Now, the relevant actions can be executed with a couple of mouse clicks.

We have also expanded the capabilities of the MQL5 language. The update provides new matrix and vector functions, as well as built-in array and string methods.

New MetaTrader 5 Platform build 3260: Bulk operations, matrix and vector functions, and chat enhancements

Furthermore, we have improved built-in chats. Now, chats support citing and combined messages containing text, images and attachments.

In addition, we have implemented multiple fixes and improvements in MQL5 service purchasing processes and have optimized the terminal graphics system.

These changes, along with other new features of the updated MetaTrader 5 platform version, are described in detail below:

  1. Terminal: 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.


    Bulk position closing and order deletion


    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. Terminal: 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.


    Reply feature in chats


  3. Terminal: Optimized and accelerated operation of the terminal's graphical system. Interface rendering will require less resources.
  4. Terminal: 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. Terminal: 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. Terminal: 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. Terminal: Fixed accounting for certain deal types when generating the history of positions.
  8. MQL5: 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

  9. MQL5: 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

  10. MQL5: 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
    • MQL5: 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.

    • MQL5: 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.

    • MQL5: 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.

    • MQL5: 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.

    The update will be available through the Live Update system.

     

    Hi, 

    I've done the beta update to beta 3247 today.

    My EA was succesfully optimising with no errors before the update of this beta version.

    Now, I receive errors : 'invalid data of symbol GBPAUD.a'. This is on an IC-Markets platform.

    See attachment

    Files:
     
    Daniel Weckhuyzen # :

    Hi, 

    I've done the beta update to beta 3247 today.

    My EA was succesfully optimising with no errors before the update of this beta version.

    Now, I receive errors : 'invalid data of symbol GBPAUD .a'. This is on an IC-Markets platform.

    See attachment

    The message 'invalid data' occurs in a class in a procedure

    //+------------------------------------------------------------------+
    //| Set name                                                         |
    //+------------------------------------------------------------------+
    bool CSymbolInfo::Name(const string name)
      {
       string symbol_name=StringLen(name)>0 ? name : _Symbol;
    //--- check previous set name
       if(m_name!=symbol_name)
         {
          m_name=symbol_name;
          //---
          if(!CheckMarketWatch())
             return(false);
          //---
          if(!Refresh())
            {
             m_name="";
             Print(__FUNCTION__+": invalid data of symbol '"+symbol_name+"'");
             return(false);
            }
         }
    //--- succeed
       return(true);
      }

    - that is, if there was an error in the procedure 'Refresh' (CSymbolInfo::Refresh)


    (This is just for information.)

     
    Vladimir Karputov #:

    The message 'invalid data' occurs in a class in a procedure

    - that is, if there was an error in the procedure 'Refresh' (CSymbolInfo::Refresh)


    (This is just for information.)

    Thx for the reply; 

    So, where is the problem now ? 

    The problem comes up with this new beta version. Before, everything was working perfectly.

    I've recompiled my EA, and I've downloaded again the history of the symbol 'GBPAUD.a'.

    I've switched again over to build 3213 and this works fine again.

     
    Daniel Weckhuyzen # :

    Thx for the reply; 

    So, where is the problem now ? 

    The problem comes up with this new beta version. Before, everything was working perfectly.

    I've recompiled my EA, and I've downloaded again the history of the symbol 'GBPAUD.a'.

    I've switched again over to build 3213 and this works fine again.

    I checked build 3247 - I have no errors (I checked the RSI_MAonRSI_Dual_EA code).

    RSI_MAonRSI_Dual_EA
    RSI_MAonRSI_Dual_EA
    • www.mql5.com
    Strategy based on the signals of the custom indicator 'RSI_MAonRSI_Dual'
     
    I can't wait for this new special update What time is it going to be avalaible ???
     
    Ugochukwu Mobi # :
    I can't wait for this new special update What time is it going to be avalaible ???

    The version has just become available:

    2022.04.15 12:07:53.664 Terminal        MetaTrader 5 x64 build 3252 started for MetaQuotes Software Corp.
    
     

    ArgSort is very slow compared to introspective sort or radix sort.

    This implementation of radix sort can be modified to handle indexes, as well.

    https://www.mql5.com/en/code/38763

    https://github.com/eloj/radix-sorting#immutability--returning-indeces
    Radix sort (The fastest numeric sort)
    Radix sort (The fastest numeric sort)
    • www.mql5.com
    Sorts the values of a one-dimensional numeric array in the ascending order. It is 3-10 times faster than any other sorting algorithm.
     
    How I invest in this app
     
    Muhammad Faisal #:
    How I invest in this app

    https://www.mql5.com/en/forum/381853#comment_25845157

     
    in mt5 build 3260 , metaqoute Fixed operation of CopyTicks and CopyTicksRange functions. When expert advisor (EA) get history tick from many symbol and then calculation. I found that EA receive wrong history ticker .  An error could cause the return of outdated data when crossing through midnight