For Business

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

What's new in MetaTrader 5

28 January 2022

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.