---
title: "MetaTrader 5 build 3210: New matrix methods and control over indicator minimum/maximum values - Release Notes"
description: "Revised Sharpe Ratio calculation algorithm to match the traditional formula, in which the value corresponds to a one-year interval. - Release Notes"
image: "https://www.metatrader5.com/c/17/0/fix_values__1.png"
url: "https://www.metatrader5.com/en/releasenotes/terminal/2226"
---

# MetaTrader 5 build 3210: New matrix methods and control over indicator minimum/maximum values

## Revised Sharpe Ratio calculation algorithm to match the traditional formula, in which the value corresponds to a one-year interval

11 February 2022

### MQL5

1. Added Min, Max, [ArgMin](https://www.mql5.com/go?link=https://numpy.org/doc/stable/reference/generated/numpy.argmin.html), [ArgMax](https://www.mql5.com/go?link=https://numpy.org/doc/stable/reference/generated/numpy.argmax.html) 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](https://www.mql5.com/en/docs/runtime/errors) 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](https://www.mql5.com/en/docs/standardlibrary/mathematics/stat). 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.

   ![](https://www.metatrader5.com/c/17/0/fix_values__1.png)

### 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:

### 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.

**Earlier publications:**

- [MetaTrader 5 platform build 3180: Vectors and matrices in MQL5 and improved usability](https://www.metatrader5.com/en/releasenotes/terminal/2223)
- [MetaTrader 5 platform build 3091: Improvements](https://www.metatrader5.com/en/releasenotes/terminal/2215)
- [MetaTrader 5 build 3090: Improvements and fixes](https://www.metatrader5.com/en/releasenotes/terminal/2214)
- [MetaTrader 5 build 3081: Improvements in MQL5 services and design updates](https://www.metatrader5.com/en/releasenotes/terminal/2212)
- [MetaTrader 5 build 2980: Push notifications for trade operations](https://www.metatrader5.com/en/releasenotes/terminal/2199)
