Topic: Generating with OOS and an Initial Optimization

When I`m generating strategy and I have switch on "Out of sample testing, percent of OOS bars" and while I've switch on "Perform an initial optimization",  is the optimization making with data from the entire array, or with data just from "sample"?

Re: Generating with OOS and an Initial Optimization

My assumption is that when you have "Out of sample testing, percent of OOS bars 30%" enabled, that it only looks at the first 70% of the dataset for all operations (including initial optimization). But I'm not sure about this and it would be great to have a developer confirm this.

Here is what the manual says about the Initial Optimization:

Initial Optimization

Perform an initial optimization is a default option. It makes the generator try to improve the strategy. This can be done in several ways:

    by removing the indicator slots which have no significance for the strategy;
    by changing the digital parameters of the indicators, bringing them closer to their default values;
    by adjusting the Permanent Stop Loss and Take Profit (if the changing is allowed).

The initial optimization aims at making the strategy more orderly without trying to achieve a higher profit. To achieve optimal optimization, use the Strategy Optimizer.

The Generator starts several optimization attempts only when it founds a more profitable strategy. After the optimization finishes, the Generator continues generating new strategies.

Note the section I've bolded. Based on what I'm reading, it seems that perhaps this initial optimization step is not necessarily looking at any data except final statistics.

For example, if you have an unneeded indicator that can be deleted with no change to the final statistics, then perhaps that is the type of improvement it would make. Again, would be great to have a developer shed more light on exactly what is happening with the "perform an initial optimization" feature.

I do personally use initial optimization myself on both new and existing strategies at the start of every Generator run.

Re: Generating with OOS and an Initial Optimization

Please someone from the developers to respond. I think it is important whether the optimization in the generation results adapts to the chart, using the entire data set, or optimized with data just from "sample" ", which prevents in part the curve fit.

Re: Generating with OOS and an Initial Optimization

Initial Optimization algorithm uses completely the same logic for evaluating strategy as the main generating algorithm.

What Initial Optimization does is (in the following order):
1. Generates new numeric parameters' values of the indicators
2. Changes Permanent Stop loss
3. Changes Permanent Take Profit
4. Changes Break Even
5. Removes needles logical conditions
6. Changes Same and Opposite Signal Behaviour logic
7. Removes Permanent Stop loss
8. Removes Permanent Take Profit
9. Removes Break Even
10. Reduces numeric parameters' values of the indicators towards their default values.

For every step the Initial Optimization program calculates the strategy balance and if the balance is higher or equal than the previous, it accept the changed parameters. We assume that even with the same Balance, the optimized strategy will be better looking.
Initial Optimization doesn't change the indicators (except removing useless) and indicators logic rules. If you use OOS, it uses OOS Balance for criterion (balance at OOS bar). For all limitations are used all data (including OOS data).

Re: Generating with OOS and an Initial Optimization

Code of the Initial Optimization is here: GeneratorOptimization.cs The code is pretty clean and understandable.

Actually Initial Optimization accepts changed strategy with equal balance for the following steps:
5. Removes needles logical conditions
6. Changes Same and Opposite Signal Behaviour logic
7. Removes Permanent Stop loss
8. Removes Permanent Take Profit
9. Removes Break Even
10. Reduces numeric parameters' values of the indicators towards their default values.

For the other methods, optimizer accepts strategies with higher balance only.

Re: Generating with OOS and an Initial Optimization

The Initial Optimizer performs all of the previous steps.
If some of the steps founds a better strategy, Initial Optimization runs again two times.
There is also 10% chance the cycle to be repeated even if there is no better strategy found out.
Every single steps has different chance to be executed again depending on the result.

Re: Generating with OOS and an Initial Optimization

Many thanks to Mr. Popov for comprehensive response.