# Optimizing many parameter

#### ezraluandre

Hi,

I want to optimize a strategy with many parameter. It is advise to do it maximum 3 parameter per optimization to avoid overfitting, so the optimization will be run twice. Let's say I have 6 parameter to optimize 3 parameter for entry (indicator parameter) and the other 3 for exit (tp sl).

As far as I know for strategy to work it needs both entry and exit to work simultaneously to give a great confidence result that it is the optimum combination. For example if I want to optimize the indicator parameter with tp 400 points and sl 200 points, the best result (parameterA) for indicator parameter optimization only works in favor for those tp and sl. If we optimize all 6 parameter the best result would be parameterB with tp 600 and sl 300 points.

I understand about the over-fitting that may come with optimizing more than 3 parameter, but when we optimizing 3 parameters first and 3 afterwards, doesn't it we will miss the optimum value? What your thoughts about this?

#### Enivid

Staff member
You overcome overfitting by running additional backtests on the out-of-sample data with the optimal parameters that you find. So, you first divide your test data into several periods and only use part of them for actual optimization. Then you find several optimal parameter sets and run them on the out-of-sample periods to find out whether they got overfitted.

#### ezraluandre

So it doesn't matter whether I optimized all 6 parameter or doing it recursively as long as the parameter from the first optimization be carried over to the next optimization then it bounds to become more over-fitted than before?

#### Enivid

Staff member
So it doesn't matter whether I optimized all 6 parameter or doing it recursively as long as the parameter from the first optimization be carried over to the next optimization then it bounds to become more over-fitted than before?
It does matter. It will be slightly less overfitted, but it will also be less optimal. The goal of the optimization is to find an optimal full set of parameters that would work best independent on the chosen period of time.

• 👍
Phill88

Replies
3
Views
3K
Replies
3
Views
455
Replies
0
Views
2K
Replies
0
Views
1K