A simple but effective (I didn’t check it, but in theory nothing contradicts this with local optimization) version of the subject is achieved by including only one includnik in the source code, which includes only two of its functions – iCustom and CopyBuffer.
- When called, it generates the file name based on the input parameters.
- If there is a Common file, it reads it completely at the beginning of the pass and substitutes data from there when the CopyBuffer request is made.
- If there is no Common file, it creates it at the end of the pass and writes the values of the indicator buffers there.
Actually everything. You need to speed up the adviser-you have cut the includnik and it is ready for most cases. It is understood that Rand indicators and similar cases will not work, but for 95% of expert advisors-without problems.
Implement, upload solutions to the Codebase. Acceleration can be tens or hundreds of times. The more complex the indicators are used, the greater the acceleration.
It is clear that this method of accelerating Optimization is suitable not only for indicator buffers, but also for non-indicator expert advisors. You can cache expensive pieces of the expert Advisor code for the Optimizer in the same way.
PS Note, the source code of the indicators is not needed. Acceleration is achieved for free. You only need one includnig to write.
ZZY Acceleration is obtained not only due to caching, but also due to the complete elimination of the architectural connection adviser-indicator.