Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1166

 
Александр:

There are many numbers - 1,3,4,8,9,........1000. How do I ELIGIBLY compare them, in the EA body, to a variable. Without equating each number to some variable ? Thank you !


Is your set of numbers stored where? In an array? Then just compare in a loop.

...

There is no such data type as a set in µl.

 

Hello. How to separate programmatically and manually generated events in OnChartEvent? Or maybe there is an option to unsubscribe temporarily from the ChartEvent event? I need it to work only for "manual" events and ignore program events, such as deletion, change of properties from Expert Advisor.

 
Vitalii Ananev:

Is your set of numbers stored where? In an array? Then you simply compare them in a loop.

...

There's no such data type as a set in µl.

I haven't figured out where to store it yet. Either in a comma-separated file, or directly in the Expert Advisor to make it faster. I think the latter is more likely.

 
Александр:
I haven't figured out where to store it yet. Either in a comma separated file, or directly in the EA to speed up the process. The latter is more likely.


In any case, you need to put this sequence into an array. If the data is in a file, then read the file and write it to the array or initialise the array with the required data directly in the code.

 

Is it possible to copy the list of graph objects so that it can be pasted into Excel?

It's not convenient to open the properties of each individual line - it's too long, as there are too many objects.


 
Aleksandr Novikov:

Is it possible to copy the list of graph objects so that it can be pasted into Excel?

It's not convenient to open the properties of each individual line - it's too long, as there are too many objects.


It is possible to simply write the names and other parameters of the objects on the chart into a .csv file

 
Vitalii Ananev:

In any case, you need to put this sequence into an array. If the data is in a file, then read the file and write the array or initialise the array with the required data directly in the code.

I.e. you have to arrange a loop and fill the array. Only so ?

 
Александр:

I.e. I have to arrange a loop and fill the array. Only like this ?


Yes, you will need a loop to fill the array if you are reading data from a file.

If you are going to write digits into the array directly in the code, you don't need the loop. You may just write it this way:

double A[10];

A[0] = 1.343;

A[1] = 1.4567; and so on.

or double A[10] = {1.344,1.34354,...... };

 
Александр:

Maybe so.




I figured it out, it's about dynamic arrays, if a dynamic array is assigned as an indicator buffer, I don't need to worry about its dimensions, MT will find (will it find? or will it just take the maximum?) number of elements, the same situation with the ArrayCopy function. What should I do, if I don't know beforehand what size my array needs?ArrayResize? With each new element? Is there a more elegant solution?

Oh, I've found it!:The function can be applied only todynamic arrays. However, you should bear in mind that dynamic arrays assigned as indicator buffers by theSetIndexBuffer() function cannot be resized. For indicator buffers, all resizing operations are performed by the executive subsystem of the terminal.

It's a little confusing for a beginner in the language - at first we don't manage the dimensionality of arrays, then we strictly control it. And I remembered there was a catch, but I've forgotten what it was =)

Объект динамического массива - Типы данных - Основы языка - Справочник MQL4
Объект динамического массива - Типы данных - Основы языка - Справочник MQL4
  • docs.mql4.com
Объект динамического массива - Типы данных - Основы языка - Справочник MQL4
 
Why is the Expert Advisor showing positive equity growth in the tester, but in real time trading at zero or minus?