WEBVTT

00:00:00.200 --> 00:00:14.533
Backtesting is one of the most powerful tools for evaluating a trading strategy. And if you create a profitable trading strategy, you might want to improve that strategy by tweaking its parameters.

00:00:14.566 --> 00:00:26.933
Now, you can do this manually. You know, you might have a trading strategy that buys when a stock's price is below its 30-day moving average. You might manually try 35-day, or 40-day, or 50-day.

00:00:27.000 --> 00:00:40.433
You might try different combinations of these parameters to figure out what's the best trading strategy. Or you can do this automatically with optimization.

00:00:40.466 --> 00:00:52.066
Optimization is simply the process of tweaking the parameters of a trading strategy to maximize its performance over a given historical period.

00:00:52.133 --> 00:01:06.766
And it has the benefit that it's a lot faster and more efficient than manually tweaking parameters. You can try a large number of parameter combinations to test out different trading strategies.

00:01:08.433 --> 00:01:11.800
But trading strategy optimization isn't flawless.

00:01:11.833 --> 00:01:26.700
You may optimize a trading strategy and have it do really, really good from 2020 to 2024, but when you test it out from 2024 to 2025, it might do catastrophically.

00:01:26.766 --> 00:01:39.966
The trading strategy can still be fragile and not robust. That's why you need to have rigorous testing procedures outside of the optimization training data.

00:01:40.033 --> 00:01:51.000
You need to be aware of things like overfitting, which is just combining different parameters to perfectly fit very specific market conditions.

00:01:51.033 --> 00:02:01.266
This is one of the biggest challenges when it comes to optimization, because like I said again and again, stock market returns are non-stationary.

00:02:01.333 --> 00:02:06.433
What was good this year might not work next year.
