You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.
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.
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.
So I got it right the first time after all.
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.
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".
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.
Exactly. Only you forgot to write the verdict whether you can or cannot.
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.