Algorithm Optimisation Championship. - page 4

 
Dmitry Fedoseev:
Look at the universal method laid out above. And if a one-off call via an intermediary, that would require a very serious adaptation of the lookup function, that's exactly what no one will do.
Don't exaggerate. There is a solution. Think about how you can get rid of the internal FF call from your algorithm library.
 
Andrey Dik:
Don't exaggerate. There is a solution. Think about how you can get rid of the internal FF call from your algorithm library.
You shouldn't even think about it, there's no reason to waste effort on it.
 
Dmitry Fedoseev:

...

There are no other options. Unless one can pass a pointer to a function, if possible (but so far no one has suggested where to look in the help). The member must have a full-fledged ability to call a ff function.

It was mentioned here with an example:New version of MetaTrader 5 platform build 1325: Trading with hedging and testing by real ticks >>>

Example:

MQL5: To facilitate organization of event models, support for pointers to functions has been added.

To declare a pointer to a function, define the "pointer to function" type, for example:

typedef int (*TFunc)(int,int);

TFunc is now a type and you can declare a function pointer variable:

TFunc func_ptr;

The address of a function can be stored in the func_ptr variable so that it can be called later:

int sub(int x,int y) { return(x-y); }
int add(int x,int y) { return(x+y); }
int neg(int x)       { return(~x);  }

func_ptr=sub;
Print(func_ptr(10,5));

func_ptr=add;
Print(func_ptr(10,5));

func_ptr=neg;           // ошибка: neg не имеет тип  int (int,int)
Print(func_ptr(10));    // ошибка: должно быть два параметра

Pointers to functions can be stored and passed as a parameter. You cannot get a pointer to a non-static method of a class.

 

Here's my method from the class, for example:

      void Evolution(){ 
         

         for(int c=0;c<GenerationsCount;c++){
         
            f0(); // расчет значений фф для каждого индивида
            f1();         
            f2();
            f3();
            f4();
            
         }
         
         f5();
         f6();

      }

Well, how can we do that? And most importantly, why think about it when in reality it is never necessary. The championship of optimization algorithms turns into the championship of adapting the function to work through the gio.

A function can count how many times it has been called. If a contestant does an import, the number can be written to the file and zeroed out before it is run.

It is best to use a class, then the quantity will just be available. Cheating is ruled out here.

 
Dmitry Fedoseev:
You should not even think about it, there is no reason to waste effort on it.

OK. There are no problems. Then there are two options for the championship to operate the algorithms:

1. With calling FF from inside the algorithm (after all, the algorithm will not know what FF is inside a closed bible with FF)

2. without calling the FF from within the algorithm, simply passing the result to the algorithm.

I suppose these two options can cover all possible variations in the use of optimization algorithms. We need to meet the participants, not everyone has a high level of programming knowledge (I'm not a pro, for example, it took me several months to saw the algorithm into parts for universality))))

 

Thanks.

No easier than with a class. I'd even say it's easier with a class.

 
Andrey Dik:

OK. There are no problems. Then there are two options for the championship to operate the algorithms:

1. With calling FF from inside the algorithm (after all, the algorithm will not know what FF is inside a closed bible with FF)

2. without calling the FF from within the algorithm, simply passing the result to the algorithm.

I suppose these two options can cover all possible variations in the use of optimization algorithms. We need to meet the participants, not everyone has a high level of programming knowledge (I'm not a pro, for example, it took me several months to saw the algorithm into parts for universality))))

If you have extra time, you are welcome. Only in. 2 will not be in demand.
 
Dmitry Fedoseev:
If you have extra time, you're welcome. Only in. 2 will not be in demand.
Well, that's not for us to judge. You have option 1 and I have option 2. And who knows what the other participants will do. And what's the time? - The example script above was written in 5 minutes, we'll come to the established 2 options, I guess.
 
Andrey Dik:
Well, we're not allowed to judge that. You have option 1 and I have option 2. And who knows how the other participants will do. And what's the time? - example of a script written above in 5 minutes, so we'll come to the established 2 options, I suppose.
Can not even think of anything to guess how so could option 2? It's not natural.
 
Dmitry Fedoseev:
I cannot even think of anything that would make a guess how Variant 2 could happen? It is not natural.

A simple example. The optimization algorithm hangs on a chart somewhere. The Expert Advisor is optimized in the built-in tester by a full search. So you can use your own optimization algorithm instead of the regular one.

Another example. The Expert Advisor works in the chart and trades. It saves the trade results after some time to the algorithm (can be inside or outside of the Expert Advisor) together with its parameters and receives new parameters back and then continues trading (in your case we would need to run a historical run, while in my case we can use a "live" optimization).

And so on. That is, in these examples the algorithm is completely independent of the task.

I deliberately applied these examples to trading. We are traders.

Reason: