Terminal
Terminal
MQL5
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
void OnStart() { string test="some string"; PrintFormat("String length is %d",test.Length()); } // Result log: // String length is 11
MQL5
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:
Tester
Terminal
Terminal
MQL5
VPS
MetaEditor
Tester
>
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); };
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.
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 numberOnly simple operations are currently available for complex numbers: =, +, -, *, /, +=, -=, *=, /=, ==,!=.
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;
Documentation has been updated.
void func(int &arr[ ][ ][ ][ ]) { }
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.
Documentation has been updated.
ENUM_FP_CLASS MathClassify( double value // real number );The enumeration contains the following values:
if(MathClassify(value)>FP_ZERO) { Print("value is not a valid number"); }
We have revised optimization criteria which include two variables, one of which is the balance. Now, the
criteria only take into account the second variable and ignore the
balance. The new optimization criteria are easier to analyze.
We have gathered feedback from Trade Master 9 iOS users and redesigned the application considerably