Download MetaTrader 5
To add comments, please log in or register
Publish your articles and improve your rating!
Carl Schreiber
6161
Carl Schreiber 2015.12.12 10:18  

The problem is your program logic to resize the array there is something wrong.

Go through your code using the debugger and look always at the size of your arrays when where and how do you change it!

ffoorr
996
ffoorr 2015.12.12 11:53  

try to print the size of the array

Jason Crossfield
155
Jason Crossfield 2015.12.12 12:14  

Solved thanks gooly and ffoorr for your input.

 

My problem was using the ArrayResize variable when setting the Array values without a de-increment -1 to align with Array index sequence. 

 

So I was using this:

ArrayResize(Closed,++closecnt);
Closed[closecnt][0] = "one";

 

When the correct method is:

 

ArrayResize(Closed,++closecnt);
Closed[closecnt-1][0] = "one";
ffoorr
996
ffoorr 2015.12.12 12:29  
yep that's right
whroeder1
13982
whroeder1 2015.12.12 12:32  
This is wrong. You want to increase the size to one and set element zero
    closecnt=closecnt++;
    ArrayResize(Closed,closecnt);
:
    Closed[closecnt][0]="one";
Like this.
//    closecnt=closecnt++;
    ArrayResize(Closed,closecnt+1);
:
    Closed[closecnt][0]="one";
    ++closecnt; // Now you have one.
Jason Crossfield
155
Jason Crossfield 2015.12.12 13:59  
Got it thanks WHRoeder :-)
/ /12
To add comments, please log in or register