You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I think you might have it here. I will copy your code here and test it. I will get back and let you guys know if it solved the problem. Thank you all for your help.
I found a problem with what you had coded, so I made a minor change, I also corrected the print out so that it will tell us which column/row we are seeing in the output, finally, I added a print statement in the comparison condition that will allow us to see the data before we attempt to insert it. Here is the code:
Here is the output:
It is easy to see that in the loop we still have the data, but it never gets inserted into the array.
I have and idea, I think I need to loop through frequency array first to see if the number exists, if not, then outside of the frequency array loop, I need to add the value of linearray. However, this still does not resolve why I am not getting any data into the frequency array. I will make this modification now.
Here is the focal point of the problem:
Here is the latest output of the print statement in this code:
regardless of any other code in the file, when we assign the value of one array to another array, we should get the value appearing in the second array on the output.Here is a very simplified snippet of what I am doing:
Here is the result I get:
Why am I not getting this on the code I am trying to actually run? Why isn't the value being put into the second array?The second value is the column sizing, which MQL does not allow you to change the number of columns only the number of rows. The first value is the number of rows which is what I want to resize anyway. The declaration of [][1] means that I want 2 columns but at the moment no rows.
So the first thing I do in the dual for loop is to increase the rows and then add the data. This way, I am only increasing the needed number of rows as I have data to enter.
I believe that by example where I got the code from this part is correct.
According to my experience, the declaration of [][1] will give you 1 column, not 2 as you require.
I am convenced that there is a bug with the multi-dimensional array. I took the basic little test I made and placed data in multiple element locations and the only one that returned the data was the 0,0 location. Regardless of how many elements I allocated for either the rows or the columns.
If the array size is 5, index is 0 to 4. You are accessing one beyond the array.
The declaration of [][1] means that I want 2 columns but at the moment no rows.
If the array size is 5, index is 0 to 4. You are accessing one beyond the array.
No that means you want 1 column. [][2] means you have 2 columns [][0] and [1]
This increases the arrays size to accomodate the entry.You are not seeing the size increment prior to this entry the following is just above the section you are looking at:
This increases the arrays size to accomodate the entry.You are not seeing the size increment prior to this entry the following is just above the section you are looking at:
That increases the number of rows. Does NOTHING about the number of columns. The declaration must be [][2]
Also in your loop, when
executes you will compare beyond the end of the array. Drop that If and move the x==size to the top:I solved my array problem by avoiding the multiple array scenario. Because the data was finite, I knew what my overall count was going to be so I am living with this solution.
I can also take the output from the log and dump it into excell thanks to using the tabs. Now all I have to do is process it.
I would like to thank everyone who had provided input. I hope my solution helps you too in the future.