← All videos >THE FULL PICTURE
Take the algorithmic trading course

algorithmic trading / strategy optimization / overfitting

What is Trading Strategy Optimization? (And How to Avoid Overfitting)

Course walkthrough

Algorithmic Trading Fundamentals

Lesson 12 of 15

All lessons in this series

  1. 1What is Algorithmic Trading? A Beginner's Guide to Automated Strategies
  2. 2What is a Trading Indicator? The Building Blocks of Algorithmic Trading
  3. 3Technical Analysis Indicators Explained: Mean Reversion vs Momentum
  4. 4What Are Fundamental Indicators? Understanding a Company's Financial Health
  5. 5Alternative Data Sources for Trading: Satellite Imagery, Sentiment Analysis & More
  6. 6From Indicators to Conditions: Building Your Trading Rules
  7. 7What is a Trading Condition? Turning Indicators into True/False Logic
  8. 8What Are Trading Actions? The Final Building Block of Algo Trading
  9. 9What is a Trading Strategy? Indicators + Conditions + Actions
  10. 10How to Know if Your Trading Strategy is Actually Good?
  11. 11What is Backtesting? How to Test Your Trading Strategy
  12. 12What is Trading Strategy Optimization? (And How to Avoid Overfitting)
  13. 13Recap: From Building Blocks to Deployment
  14. 14How to Deploy a Trading Strategy: Paper Trading to Live Trading
  15. 15How to Backtest a Trading Strategy on NexusTrade (Beginner Guide)

You've built a profitable strategy. Now you want to make it better by tweaking its parameters.

Should you use a 30-day moving average or 50-day? What about 35? You could test manually - or you could let optimization do it automatically. Optimization is the process of tweaking strategy parameters to maximize performance over a historical period. It's faster and more efficient than manual testing, and lets you explore thousands of combinations. But there's a catch: overfitting.

In this video, I cover: → What optimization actually does → Why it's more efficient than manual parameter testing → The overfitting trap: perfect results on training data, catastrophic results in the future → Why you need rigorous testing outside your optimization period

Stock market returns are non-stationary. What worked from 2020-2024 might fail in 2025. Optimization is powerful - but only if you test properly.

Watch lessons, complete hands-on activities, pass quizzes—and by the end, you'll have a real strategy deployed to the market.

Transcript

0:00Backtesting 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.

0:14Now, 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.

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

0:40Optimization is simply the process of tweaking the parameters of a trading strategy to maximize its performance over a given historical period.

0:52And 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.

1:08But trading strategy optimization isn't flawless.

1:11You 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.

1:26The 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.

1:40You need to be aware of things like overfitting, which is just combining different parameters to perfectly fit very specific market conditions.

1:51This is one of the biggest challenges when it comes to optimization, because like I said again and again, stock market returns are non-stationary.

2:01What was good this year might not work next year.

Join the conversation

Loading conversation…