Yedelkin: I find it hard to answer. I re-read your messages but didn't get the idea of changing the array's size. Your answer to the code also depends on understanding the concept. Maybe somebody else will answer.
double masCenPoc[20];
for(int i=0; i<20; i++){
if((cena_poc < high && cena_poc < low)||(cena_poc > high && cena_poc > low))
//как вот дальше обозначить чтоб он запомнил значение цены уровня Рос? masCenPoc[i] = cena_poc;else//и удалил значение из массива, если нашлось пересечение с ценой этого уровня Рос?
Top2n: I don't really care about changing the size of the array; I'll set it to, for example, 20.
Here you have an array of 20 elements. Let's assume that the if condition holds - we assign a price value to the first element of the array: masCenPoc[0] = cena_poc;
What will we assign to the second element of the array?
Here you have an array of 20 elements. Let's assume that the if condition holds - we assign a price value to the first element of the array: masCenPoc[0] = cena_poc;
What should we assign to the second element of the array?
The next value of Ros which will be in n amount of time. The Ros lines appear at the beginning of each day, based on the results of the previous day. If the price does not touch the level, the value of this Ros level will be stored in the array.
Top2n: The next value of Ros, which will be in n amount of time. The Ros lines appear at the beginning of each day, based on the previous day's results. If price does not touch the level, then the value of this Ros level will be stored in the array.
I see. I would do the following. I would create an array of 20 elements and assign value -1 to all of them. At the beginning of each day, I would run the loop for(int i=0; i<20; i++) and look for the first element with value -1 in the array. After finding such an element, it would check trade conditions(if((cena_poc < high && cena_poc < low)||(cena_poc > high && cena_poc > low)) and if successful, assign value of cena_poc to the found array element. This would gradually fill the array with the required values.
Yes, if you use a non-dynamic array (as in your last example), you don't need this function either. If you need a dynamic array, declare and size it in the first lines of code, before the loop.
I don't really care about changing the size of the array, I'll give it 20, for example.
It has to make sense. In this case, an array may not be necessary. In one loop with further calculations, maybe 1 variable is enough. I think you want to get history data, therefore it would be more logical to loop from some bar to 0. And then your data will be built. If you need an array, it should accumulate as a stack in your case.
If you want to build by online quotes, then it is still according to stack rules.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I find it hard to answer. I re-read your messages but didn't get the idea of changing the array's size. Your answer to the code also depends on understanding the concept. Maybe somebody else will answer.
I don't really care about changing the size of the array, I'll give it 20, for example.
Here you have an array of 20 elements. Let's assume that the if condition holds - we assign a price value to the first element of the array: masCenPoc[0] = cena_poc;
What will we assign to the second element of the array?
Here you have an array of 20 elements. Let's assume that the if condition holds - we assign a price value to the first element of the array: masCenPoc[0] = cena_poc;
What should we assign to the second element of the array?
I don't really care about changing the size of the array, I'll give it 20, for example.
It has to make sense. In this case, an array may not be necessary. In one loop with further calculations, maybe 1 variable is enough. I think you want to get history data, therefore it would be more logical to loop from some bar to 0. And then your data will be built. If you need an array, it should accumulate as a stack in your case.
If you want to build by online quotes, then it is still according to stack rules.
http://algorus.blogspot.ru/2012/12/blog-post_7.html
https://ru.wikipedia.org/wiki/%D0%A1%D1%82%D0%B5%D0%BA
Hello. When I try to copy indicator data to an array using the CopyBuffer function I get values like -6.99999999999999999e-005
What can be the reason?
Hello. When I try to copy indicator data to an array using the CopyBuffer function I get values like -6.99999999999999999e-005
What can be the reason?
The indicator has different data in the data window. I attach the EA to the H1 chart and it copies the data from the M5 M15 and H1 timeframes.