THANK YOU for the reply. Full code. Increased static array size. Removed zero control entry in operators... Common "dummy". Still want to understand WHY it doesn't count addition. What is missing in my code now? Thanks for the tips. I haven't worked with static arrays in mql5 yet.....
Can you tell me if it's possible to loop through variables with names: L1, L2, L3 ... Ln to write to a two-dimensional array.
Example with three variables (in fact there are more variables, it's cumbersome):
First, we need to decide on the number of values in the second dimension of the future array. Already now we can see that the number of elements is not equal. Probably, we should take maximal one, and where there are redundant ones we should fill with zeros or -1, for example. And it wouldn't hurt to define the first dimension beforehand if it is known. And then in the nested loop take L1 and write everything you need into the array, then the second iteration of the outer loop writes into the next index everything in L2 and so on.
And quite correctly, it's better to stick it in a structure.
struct name
{
double L1[];
double L2[];
double Ln[];
}arr[];
Then the array will be able to change dimension in the first and in the second dimension. That is, it will be a one-dimensional array in a one-dimensional array.
It was me who shortened the code and Tf - I just didn't notice it. The question is fundamental, why elements from static array are not processed for calculation?
Here I have checked, compilation without errors))) Calculation result is the same - NULL !!! arrays open[], close[] etc - not so important....
Допускается объявление не более чем 4-мерного массива. При объявлении динамического массива (массива с неуказанным значением в первой паре квадратных скобок) компилятор автоматически создает переменную указанной выше структуры (объект динамического массива) и обеспечивает код для правильной инициализации. Статические массивы При явном...
I was shortening the code and Tf - I just didn't notice it. The question is fundamental, why elements from static array are not processed for calculation?
Here I checked, compilation without errors))) Calculation result is the same - NULL !!! arrays open[], close[] etc - not so important....
Compilation does not check for logical errors of the programmer himself - this is left to the conscience of the programmer, because the compiler is not yet able to read minds.
The compilation does not check for logical errors of the programmer himself - this is left to the conscience of the programmer, because the compiler is not yet able to read minds.
I am fundamentally looking for the reason where? in writing the existing code or is there something else in the code to process the static array?
I can't know what I don't know... So I ask an outside observer, with experience, to point out where I don't know)))
Допускается объявление не более чем 4-мерного массива. При объявлении динамического массива (массива с неуказанным значением в первой паре квадратных скобок) компилятор автоматически создает переменную указанной выше структуры (объект динамического массива) и обеспечивает код для правильной инициализации. Статические массивы При явном...
Can you tell me if it's possible to loop through variables with names: L1, L2, L3 ... Ln to write to a two-dimensional array.
Example with three variables (in fact there are more variables, it's cumbersome):
THANK YOU for the reply. Full code. Increased static array size. Removed zero control entry in operators... Common "dummy". Still want to understand WHY it doesn't count addition. What is missing in my code now? Thanks for the tips. I haven't worked with static arrays in mql5 yet.....
I UPDATED THE CODE. The question is the same...
here are errors when compiling your code
Can you tell me if it's possible to loop through variables with names: L1, L2, L3 ... Ln to write to a two-dimensional array.
Example with three variables (in fact, there are more variables, it's cumbersome):
Of course, the topic is "crooked" (in MQL4 and MQL5), so it would be good to specify the platform to which the question is addressed ))))
Can you tell me if it's possible to loop through variables with names: L1, L2, L3 ... Ln to write to a two-dimensional array.
Example with three variables (in fact there are more variables, it's cumbersome):
And quite correctly, it's better to stick it in a structure.
Then the array will be able to change dimension in the first and in the second dimension. That is, it will be a one-dimensional array in a one-dimensional array.here are errors when compiling your code
It was me who shortened the code and Tf - I just didn't notice it. The question is fundamental, why elements from static array are not processed for calculation?
Here I have checked, compilation without errors))) Calculation result is the same - NULL !!! arrays open[], close[] etc - not so important....
I was shortening the code and Tf - I just didn't notice it. The question is fundamental, why elements from static array are not processed for calculation?
Here I checked, compilation without errors))) Calculation result is the same - NULL !!! arrays open[], close[] etc - not so important....
Compilation does not check for logical errors of the programmer himself - this is left to the conscience of the programmer, because the compiler is not yet able to read minds.
Of course, the topic is "crooked" (in MQL4 and MQL5), so it would be good to specify the platform to which the question is addressed)))
MQL4.
The compilation does not check for logical errors of the programmer himself - this is left to the conscience of the programmer, because the compiler is not yet able to read minds.
I am fundamentally looking for the reason where? in writing the existing code or is there something else in the code to process the static array?
I can't know what I don't know... So I ask an outside observer, with experience, to point out where I don't know)))am i principally looking for the reason where? in writing existing code or is there something else in the code to process the static array?
I can't know what I don't know... So I'm asking an outside observer with experience to point out where I don't know)))it doesn't get to the calculations.
here's an initialization
and here's a test condition