Questions from a "dummy" - page 155

 
input string Periods = "1 2 3 56 78 67";
 
TheXpert:
Interesting. But I would like to be able to optimise periods from the tester.
 
gpwr:
Interesting. But I would like to be able to optimise periods.
Optimisation would be better done on each instrument separately. If it is possible, of course.
 
gpwr:
Interesting. But it would be nice to be able to optimize periods from the tester.

Then you have to write an enumeration, with all possible options.

Enums can be commented and the parameters will show the comments instead of the enum value, as usual.

enum ENUM_CUSTOM
{
 tf1_1_1,//1 1 1
 tf1_2_1,//1 2 1
 tf1_2_3,//1 2 3
 tf2_1_1,//2 1 1 
};

For large enums, the body can be filled in programmatically.

 
Urain:

Then you have to write an enumeration, with all the possibilities.

Nah, that's clumsy and blunt.

We can do it in the same way, with a string and just the number of the run as a separate parameter. We could use the number of the run and the optimization string to get the values.

But in this case the genetics will not work properly.

 
TheXpert:
Optimisation would be more appropriately done on each instrument separately. If it is possible, of course.
It's understandable. In the tester I will choose only parameters with the same index (for example, MAPer[0], Trig[0], MaxPrice[0],MinPrice[0]) and optimize only them. Oh, the developers should have decided to add this feature. The compiler would not have found it too difficult to first create an array and then write the input data into it. What is the problem here? Why aren't arrays allowed as input data?
 
gpwr:
This is understandable. In the tester I will choose only parameters with the same index (for example, MAPer[0], Trig[0], MaxPrice[0],MinPrice[0]) and optimize only them. Oh, the developers should have decided to add this feature. The compiler would not have found it too difficult to first create an array and then write the input data into it. What is the problem here? Why aren't arrays allowed as input data?
The problem is in the size of the tester's lookup.
 

I started to write the same MACD based on the MACD source but based on LWMA (difference between short and long LWMA and a signal line based on the difference).

I replaced it to LinearWeightedMAOnBuffer but it has one "extra" formal parameter weightsum. I surely understand that it is a sum of weights and understand the meaning, but how can I generate it programmatically?

Документация по MQL5: Основы языка / Переменные / Формальные параметры
Документация по MQL5: Основы языка / Переменные / Формальные параметры
  • www.mql5.com
Основы языка / Переменные / Формальные параметры - Документация по MQL5
 
progma137:

I started to write the same MACD based on the MACD source but based on LWMA (difference between short and long LWMA and a signal line based on the difference).

I replaced it with LinearWeightedMAOnBuffer but it has one "extra" formal parameter weightsum. I should certainly understand that it is the sum of weights and understand the meaning, but how can I programmatically generate it?

It doesn't need to be generated. You just need to create a variable for intermediate storage of this weightsum, so that you don't have to recalculate its values every time you call it up.

This way, at each call weightsum is modified, not completely recalculated, which greatly speeds up calculations

 
stringo:

It doesn't need to be generated. You just need to create a variable for intermediate storage of this weightsum, so that you don't have to recalculate its values every time you call it up.

This way, at next call weightsum is modified, not completely recalculated, which greatly speeds up calculations

Thank you. It worked. I declared this variable as a global variable.