NavigationUser loginWho's new
Who's onlineThere are currently 1 user and 32 guests online.
Online users:
|
More about ArraysHi folks! We have studied Arrays here and here. Please give them a review! Arrays are tables:The best model that the arrays are look like is the tables. You have a table that includes only your monthly profits/losses in Forex; this is one dimensional array. For the complex data you need more columns in the table and more dimensions in the array. For example the table (array) which will hold all the opened trades information maybe looks like that:
Could you guess how much dimensions the array above have? No! It's 2 dimensional array! "Whatever the number of the fields, whatever the number of columns, the 2 dimensional arrays are for your all purposes" Saying of mine :)! The array above has 2 dimensions; the first dimension is the fields of the array (we have three fields in the table above). The second dimension is the columns of the array (we have 6 columns in the table above). So, in code our array will be like that: double myarray[2][5]; No! it's not a typo! In the world of MQL4 arrays (and the most of programming language arrays) the first element of the array starts from 0. so the 3 fields and 6 columns arrays will be "myarray[2][5]" (We always subtract 1 from the total elements of the array). Note: There are 3 dimensional arrays and 4 dimensional arrays in MQL4 but they are abandoned topics. Just for your knowledge the maximum dimension of the arrays in MQL4 is 4 dimensional arrays. How to access the 2 dimensional array?Let's MQLing!
|