Errors, bugs, questions - page 738

 
MetaDriver:

Question:

You need to pass an array of object pointers to a function. By reference, of course (an array).

What syntax to use?

Or should I use it in some other way?

Pointer declaration (type, variable type): MyObject* hobject

Declaration ofan array of pointers (type, array of type variables): MyObject* hobject[].

It turns out that when passed by reference (type, passed type variable array): MyObject* &hobject[]

What is confusing is that I haven't found information about passing pointers and pointer arrays as function parameters. But it's not even a question, just a disclaimer.

 
Karlson:
I faced such a need. Crooked and brutal, but the correct result is obtained. Flags are enabled on all three input data.And then blocked at false.

I'm not much of an explainer. Let me try again. The task is to form a portfolio of currencies, each currency with its own parameters. In an optimized portfolio a currency may not participate. I've calculated six currencies in 21 optimization steps for each currency, and the total sum is in billions.

Now the question. If we forbid a currency to trade with a flag then there is no sense to optimize its parameters, anyway they will not affect the result in any way, but the optimizer will continue trying to fit parameters that do not affect the result. Kind of like I know myself that you can not, but the hope is still thriving.

 
ivandurak:

I'm not much of an explainer. Let me try again. The task is to form a portfolio of currencies, each currency with its own parameters. In an optimized portfolio a currency may not participate. I've calculated six currencies in 21 optimization steps for each currency, and the total sum is in billions.

Now the question. If we forbid a currency to trade with a flag then there is no sense to optimize its parameters, anyway they will not affect the result in any way, but the optimizer will continue trying to fit parameters that do not affect the result. Like myself I know you can not, but the hope is still thriving.

So I still told you all the same right the first time.

You should not check these parameters in the tester.

In order for the parameters to be involved in the optimization, you have to check these checkboxes. If the checkboxes are not selected, these parameters will not be optimised.

P.S. Or you may perform optimization separately for each tool. Now I see what you mean. :) And after all the optimisations, switch on all the tools and see the cumulative result.

 
tol64:

So I got it right the first time after all.

No, you didn't. Judging by further explanations, the author starts optimization by all his input parameters at once, and at the same time he wonders if he can somehow skip some of the passes if trpair2==false. There are no manual "checkboxes in the tester" here.
 
Yedelkin:
No, it's not right. Judging by further explanations, the author starts optimization for all his input parameters at once, and wonders if some of the passes can somehow be skipped if trpair2==false. You cannot manually set "checkboxes in the tester" here.
Well, then I myself am curious to know if there is such a solution. I remember sending a request to Service Desk for programmable parameters. That is, depending on which parameter is selected (for example, in the dropdown list) is a common list of all external parameters. There was no response, so it's not that simple. And this question is from the same thread. Depending on which parameter is selected for optimisation, a list (checkboxes) of optimised parameters is set in the general list.
 
tol64:
Well, then I myself am curious to know if there is such a solution.
I haven't found any solution for this situation, either. Of course, it is possible to screw in int OnInit() some block which would store optimizable parameters value for other symbols when setting trpair2 to false, and in case of second pass with trpair2==false and with 'stored values of optimizable parameters for other symbols' it would generate non-zero return code (i.e. generate Deinit event with REAS_INIT reason code).would generate Deinit event with REASON_INITFAILED deinitialization reason code). But this all looks a bit cumbersome.
 
Yedelkin:
No, it's not. Judging by further explanations, the author starts optimization for all his input parameters at once, and wonders if some of the passes can somehow be skipped if trpair2==false. There are no manual "checkboxes in the tester".
Exactly so. Only you forgot to write the verdict whether it is possible or not.
 
Yedelkin:
I haven't found any solution for this situation, either. Of course, it is possible to combine in int OnInit() some block which would store optimizable parameters value by other symbols when assigning to trpair2 parameter false, and in case of second pass with trpair2==false and with 'stored values of optimizable parameters by other symbols' it would generate non-zero return code (i.e. generate Deinit event with code of deinitialization reason.i.e. it would generate Deinit event with deinitialization reason code REASON_INITFAILED). But this all looks rather tedious.
It is much simpler. When a condition is executed, the Expert Advisor can simply delete it - ExpertRemove(). I have implemented it in case of a drawdown. If the drawdown has reached the set value, for example, during optimization, we remove it and start the next pass.
 
ivandurak:
Exactly. Only you forgot to write the verdict whether you can or cannot.
You can. As in the previous post try it.
 
tol64:
It is much simpler. When a condition is executed, you can simply delete the Expert Advisor - ExpertRemove(). I have implemented it in case of a drawdown. If the drawdown has reached the set value, for example, during optimization, we remove it and start the next pass.

How can it be "easier"? :) The conditions for deleting an EA or for REASON_INITFAILED still have to be tracked. This is what is so troublesome.