matrix A(2, 3); matrix B(3, 2); matrix C = A @ B; // Result: Matrix C of size [2,2]Matrix multiplication (matrix × vector)
matrix M(2, 3); vector V(3); vector R = M @ V; // Result: Vector R of 2 elementsMatrix multiplication (vector x matrix)
matrix M(2, 3); vector V(1, 2); vector R = V @ M; // Result: Vector R of 3 elementsScalar multiplication (vector × vector)
vector V1(1, 3), V2(1, 3); double r = V1 @ V2; // Result: Scalar
static vector vector::Random( const ulong size, // vector length const double min=0.0, // min value const double max=1.0 // max value ); static matrix matrix::Random( const ulong rows, // number of rows const ulong cols // number of columns const float min=0.0, // min value const float max=1.0 // max value );
The update will be available through the Live Update system.
The latest versions of the MetaTrader 5 mobile app for iOS introduce a range of convenient chart features, along with important stability improvements for a smoother user experience.
Download the latest version of the app and enhance your trading experience:
![]() |
![]() |
This update fixes an error in the calculation of triple swaps in the strategy tester, which occurred under certain combinations of testing conditions. Additionally, a number of minor enhancements and fixes have been implemented to further improve the platform stability.
matrix<complex<T>> matrix<complex<T>>::TransposeConjugate(void) const;The method returns a new conjugate-transposed matrix in which the elements of the original matrix are transposed and converted to their complex conjugates.
int matrix<T>::CompareEqual(const matrix<T>& mat) constThe return values are:
pip install --upgrade MetaTrader5
Function |
Action |
---|---|
Singular Value Decomposition, divide-and-conquer algorithm; considered the fastest among other SVD algorithms (lapack function GESDD). |
|
Singular Value Decomposition, QR algorithm; considered a classical SVD algorithm (lapack function GESVD). |
|
Singular Value Decomposition, QR with pivoting algorithm (lapack function GESVDQ). |
|
Singular Value Decomposition, bisection algorithm (lapack function GESVDX). |
|
Singular Value Decomposition, Jacobi high-level algorithm (lapack function GEJSV). |
|
Singular Value Decomposition, Jacobi low-level algorithm (lapack function GESVJ). The method computes small singular values and their singular vectors with much greater accuracy than other SVD routines in certain cases. |
|
Singular Value Decomposition, divide-and-conquer algorithm for bidiagonal matrices (lapack function BDSVDX). |
|
Singular Value Decomposition, bisection algorithm for bidiagonal matrices (lapack function BDSVDX). |
|
Compute eigenvalues and eigenvectors of a regular square matrix using the classical algorithm (lapack function GEEV). |
|
Compute eigenvalues and eigenvectors of a symmetric or Hermitian (complex conjugate) matrix using the divide-and-conquer algorithm (lapack functions SYEVD, HEEVD). |
|
A method function for calculating the relative contributions of spectral components based on their eigenvalues |
|
A method function for calculating reconstructed and predicted data using spectral components of the input time series. |
|
A method function for calculating reconstructed components of the input time series and their contributions. |
|
A method function for calculating the reconstructed time series using the first component_count components. |
Terminal
MQL5
Web Terminal
The update will be available through the Live Update system.
MetaTrader 5 Android
Update your mobile apps through Google Play, Huawei AppGallery or by downloading the APK file.
Terminal
MetaTester
Web Terminal
MetaEditor
Terminal
MQL5
MetaTrader 5 Web Terminal
vector<double/complex> operator[](const int i) const; vector<double/complex> operator[](const ulong i) const;They have been replaced by a single method with a constant return value:
const vector<double/complex> operator[](const ulong i) const;This modification will assist in capturing incorrect use of the result in place as in the new Alglib version, the code mat[row][col]=x operates differently from the old version. Previously, this indicated writing to a matrix. Now, the value is written to a temporary object vector<double/complex>, which is immediately destroyed after recording.
bool ArrayToFP16(ushort &dst_array[],const float &src_array[],ENUM_FLOAT16_FORMAT fmt); bool ArrayToFP16(ushort &dst_array[],const double &src_array[],ENUM_FLOAT16_FORMAT fmt); bool ArrayToFP8(uchar &dst_array[],const float &src_array[],ENUM_FLOAT8_FORMAT fmt); bool ArrayToFP8(uchar &dst_array[],const double &src_array[],ENUM_FLOAT8_FORMAT fmt); bool ArrayFromFP16(float &dst_array[],const ushort &src_array[],ENUM_FLOAT16_FORMAT fmt); bool ArrayFromFP16(double &dst_array[],const ushort &src_array[],ENUM_FLOAT16_FORMAT fmt); bool ArrayFromFP8(float &dst_array[],const uchar &src_array[],ENUM_FLOAT8_FORMAT fmt); bool ArrayFromFP8(double &dst_array[],const uchar &src_array[],ENUM_FLOAT8_FORMAT fmt);Since real number formats for 16 and 8 bits may differ, the "fmt" parameter in the conversion functions must indicate which number format needs to be processed. For 16-bit versions, the new enumeration NUM_FLOAT16_FORMAT is used, which currently has the following values:
Improved display of margin requirements in contract specifications. Now, in addition to ratios and initial parameters for calculations, specifications display the final margin values. If the margin amount depends on the position volume, the corresponding levels will be shown in the dialog.
Terminal
MQL5
MetaEditor
Tester
Web Terminal
Terminal
MQL5
MetaTrader 5 Web Terminal
Terminal
MetaTrader 5 Web Terminal
Terminal
MQL5
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { complex a=1+1i; complex b=a.Conjugate(); Print(a, " ", b); /* (1,1) (1,-1) */ vectorc va= {0.1+0.1i, 0.2+0.2i, 0.3+0.3i}; vectorc vb=va.Conjugate(); Print(va, " ", vb); /* [(0.1,0.1),(0.2,0.2),(0.3,0.3)] [(0.1,-0.1),(0.2,-0.2),(0.3,-0.3)] */ matrixc ma(2, 3); ma.Row(va, 0); ma.Row(vb, 1); matrixc mb=ma.Conjugate(); Print(ma); Print(mb); /* [[(0.1,0.1),(0.2,0.2),(0.3,0.3)] [(0.1,-0.1),(0.2,-0.2),(0.3,-0.3)]] [[(0.1,-0.1),(0.2,-0.2),(0.3,-0.3)] [(0.1,0.1),(0.2,0.2),(0.3,0.3)]] */ ma=mb.Transpose().Conjugate(); Print(ma); /* [[(0.1,0.1),(0.1,-0.1)] [(0.2,0.2),(0.2,-0.2)] [(0.3,0.3),(0.3,-0.3)]] */ }
from sys import argv data_path=argv[0] last_index=data_path.rfind("\\")+1 data_path=data_path[0:last_index] from sklearn.datasets import load_iris iris_dataset = load_iris() from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(iris_dataset['data'], iris_dataset['target'], random_state=0) from sklearn.neighbors import KNeighborsClassifier knn = KNeighborsClassifier(n_neighbors=1) knn.fit(X_train, y_train) # Convert into ONNX format from skl2onnx import convert_sklearn from skl2onnx.common.data_types import FloatTensorType initial_type = [('float_input', FloatTensorType([None, 4]))] onx = convert_sklearn(knn, initial_types=initial_type) path = data_path+"iris.onnx" with open(path, "wb") as f: f.write(onx.SerializeToString())Open the created onnx file in MetaEditor:
struct MyMap { long key[]; float value[]; };Here we used dynamic arrays with appropriate types. In this case, we can use fixed arrays because the Map for this model always contains 3 key+value pairs.
//--- declare an array to receive data from the output layer output_probability MyMap output_probability[]; ... //--- model running OnnxRun(model,ONNX_DEBUG_LOGS,float_input,output_label,output_probability);
MetaEditor
MetaTrader 5 Web Terminal build 3980
Terminal
The report is divided into four tabs, each containing aggregated information:
New reports allow you to visually evaluate trading results in a variety of aspects by simply clicking on the tabs. Histograms, graphs and diagrams are interactive and provide additional information when hovering the mouse cursor. Our designers have put much effort into making reports as simple and clear as possible. Just give them a try!
Terminal MetaTrader 5 x64 build 3914 started for MetaQuotes Software Corp.
Terminal Windows 10 build 19045, 20 x Intel Xeon E5-2630 v4 @ 2.20GHz, AVX, 41 / 63 Gb memory, 58 / 280 Gb disk, UAC, GMT+2
VPS Hosting
MQL5
#define MACRO1 /* #define MACRO2 */ void OnStart() { #ifdef MACRO2 Print( 2 ); #else Print( 1 ); #endif }
void OnStart() { Print("CPU name: ",TerminalInfoString(TERMINAL_CPU_NAME)); Print("CPU cores: ",TerminalInfoInteger(TERMINAL_CPU_CORES)); Print("CPU architecture: ",TerminalInfoString(TERMINAL_CPU_ARCHITECTURE)); Print(""); Print("EX5 architecture: ",__CPU_ARCHITECTURE__); } CPU name: 12th Gen Intel Core i9-12900K CPU cores: 24 CPU architecture: AVX2 + FMA3 EX5 architecture: AVX
extern int X=0; void OnStart() { }
extern int X; void OnStart() { }
extern int X; int Y=X; void OnStart(void) { Print("Y=",Y," X=",X); } int X=_Digits;
MetaEditor
Tester
Updated user interface translations.
Fixed errors reported in crash logs.
MetaTrader 5 Web Terminal build 3950
Terminal
MQL5
double vector::RegressionMetric( const vector& vector_true, // true values const ENUM_REGRESSION_METRIC metric // metric ); double matrix::RegressionMetric( const matrix& matrix_true, // true values const ENUM_REGRESSION_METRIC metric // metric ); vector matrix::RegressionMetric( const matrix& matrix_true, // true values const ENUM_REGRESSION_METRIC metric, // metric const int axis // axis );
vector vector::LinearRegression(); matrix matrix::LinearRegression( ENUM_MATRIX_AXIS axis=AXIS_NONE // axis along which regression is calculated );Example:
vector vector_a; //--- fill the vector with prices vector_a.CopyRates(_Symbol,_Period,COPY_RATES_CLOSE,1,100); //--- get a linear regression vector vector_r=vector_a.LinearRegression();The results are visualized in the graph:
ulong vector::HasNan(); ulong matrix::HasNan();When comparing the appropriate pair of elements having NaN values, the Compare and CompareByDigits methods consider these elements equal, while in case of a usual comparison of floating-point numbers NaN != NaN.
Modified the OnnxTypeInfo structure which is used for operations with ONNX (Open Neural Network Exchange) models:
struct OnnxTypeInfo { ENUM_ONNX_TYPE type; // parameter type OnnxTensorTypeInfo tensor; // tensor description OnnxMapTypeInfo map; // map description OnnxSequenceTypeInfo sequence; // sequence description };
The data type is specified in the structure using new substructures:
struct OnnxTensorTypeInfo { ENUM_ONNX_DATATYPE data_type; // data type in the tensor long dimensions[]; // number of elements }; struct OnnxMapTypeInfo { ENUM_ONNX_DATA_TYPE key_type; // key type OnnxTypeInfo type_info; // value type }; struct OnnxSequenceTypeInfo { OnnxTypeInfo type_info; // data type in the sequence };Depending on OnnxTypeInfo::type (ONNX_TYPE_TENSOR, ONNX_TYPE_MAP or ONNX_TYPE_SEQUENCE), the relevant substructure is filled.
bool vector<T>::CopyIndicatorBuffer(long indicator_handle,ulong buffer_index,ulong start_pos,ulong count); bool vector<T>::CopyIndicatorBuffer(long indicator_handle,ulong buffer_index,datetime start_time,ulong count); bool vector<T>::CopyIndicatorBuffer(long indicator_handle,ulong buffer_index,datetime start_time,datetime stop_time);
MetaEditor
Tester
Fixed errors reported in crash logs.
Web Terminal
MQL5.community
Terminal
MQL5
Web Terminal