Questions from a "dummy" - page 154

 
pusheax:

It doesn't suit me, I've managed to cram dozens of gigabytes of test variants.

Maybe there is another way to make the ...MQL5\Include folder shared?

Then you should think about creating a single library for all your projects and place it in the repository.

And all the rest could be stored internally, if necessary.

Renat:

In my opinion, this is an excellent solution with MQL5 Storage.

Personally, I've managed to synchronize the entire MQL5 folder on several computers, and I've stopped losing sources. There are no particular restrictions on storing data in the repository.

I think it's the only true variant.

 
Have you already done a name sharing for your projects?
 
MetaDriver:
Will you do name-sharing for projects?
Yes, we will.
 
Can you tell me how to transfer a quote, for example, low and high to an OpenCL buffer with the float type? The only way to do this is to manually transfer it to a float array.
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
  • www.mql5.com
Основы языка / Типы данных / Вещественные типы (double, float) - Документация по MQL5
 

Good afternoon!

There is a need to access an element of an object, by a sequential number. For example:

struct Struct
{
   int j;
   int k;
   int l;
};
Is it possible to access the second element? After some time, the element may swap places, but we would still be accessing the second element. I'm talking about calling at compile time (not at runtime), i.e. by constant . I'm writing in C++.
 
220Volt:

Good afternoon!

There is a need to access an element of an object, by a sequential number. For example:

Is it possible to get the second element to be accessed? After some time, the elements may swap, but we would still be accessing the second element. I'm talking about referencing at compile time (not at runtime), i.e. by constant . I'm writing in C++.

If I understood the question correctly, I would do this:

struct Struct
{
   int array[3];
};
Struct struct_var;

And then knock: struct_var.array[1]

 

According to the documentation, arrays cannot be used as input parameters. That is, as I understand it, this is not allowed:

input int MAPer[0] = 12; // Период МА для пары 0

input int MAPer[1] = 14; // Период МА для пары 1

Such input parameters are very much needed for multicurrency, where the same strategy is used on several pairs but with different input parameters. What should I do in such a case? Maybe there is something nicer than this:

input int MAPer_0 = 12; // Период МА для пары 0

input int MAPer_1 = 14; // Период МА для пары 1

int MAPer[NumSymb];

MAPer[0]=MAPer_0;

MAPer[1]=MAPer_1; 

 
gpwr:

According to the documentation, arrays cannot be used as input parameters. That is, as I understand it, this is not allowed:

Use strings.
 
TheXpert:
Use the lines.
I don't get it. How? How about an example?
 
Yedelkin:

If I understood the question correctly, I would do it like this:

And then knock: struct_var.array[1]

It's a bit more confusing, the structure is of this form:

struct Struct
{
int var;

double var2;

...
};

everything is already implemented and I don't want to have to redo it. But I've already found the way out, thanks for the answer.