ターミナル:
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
行列要素のアドレスを計算するための擬似コード:
ulong row=index / mat.Cols(); ulong col=index % mat.Cols(); mat[row,col]
たとえば「matrix mat(3,3)」の場合、要素へのアクセスは次のように記述できます。
テスター
ターミナル
ターミナル
MQL5
VPS
MetaEditor
テスター
>
ドキュメントを更新しました。
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; // 実数部分 double imag; // 虚数部分 };「complex」型は、MQL5関数のパラメータとして値で渡すことができます(通常の構造体が参照によってのみ渡されるのとは対照的です)。DLLからインポートされた関数の場合、「complex」型は参照によってのみ渡されます。
complex square(complex c) { return(c*c); } void OnStart() { Print(square(1+2i)); // 定数がパラメータとして渡される } // 複素数の文字列表現である「(-3,4)」が出力される現在、複素数には単純な演算(=, +, -, *, /, +=, -=, *=, /=, ==,!=)のみが使用できます。
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;
void func(int &arr[ ][ ][ ][ ]) { }
struct MyStruct { string Array[]; }; void OnStart() { MyStruct a1,a2; ArrayResize(a1.Array,3); ArrayResize(a2.Array,1); a1=a2; }以前は、関数呼び出し後の「a1」配列サイズは3でした。サイズは1になります。
ドキュメントが更新されました。
ENUM_FP_CLASS MathClassify( double value // real number );列挙には次の値が含まれます。
if(MathClassify(value)>FP_ZERO) { Print("value is not a valid number"); }
残高とその他の2つの変数を含む最適化基準を改訂しました。基準では2番目の変数のみが考慮され、残高は無視されるようになりました。新しい最適化基準では分析が容易になります。
MetaTrader 5 iOSユーザからフィードバックを収集し、アプリケーションを見直しました。