Nobody taught me how to backtest a trading strategy.
So I read all the books, documentation, and blogs.
Then, I distilled what I learned into a simple step-by-step guide.
But unlike a 300-page book, this won't take you a month to read.
Here it is in 2 minutes:
So I read all the books, documentation, and blogs.
Then, I distilled what I learned into a simple step-by-step guide.
But unlike a 300-page book, this won't take you a month to read.
Here it is in 2 minutes:
But first, what’s a backtest?
A backtest:
• Tests trading ideas against historic market data
• Is used to check the robustness of trading strategies
• Is a simulation of how a strategy might have performed in the market
And most beginners get it wrong...
A backtest:
• Tests trading ideas against historic market data
• Is used to check the robustness of trading strategies
• Is a simulation of how a strategy might have performed in the market
And most beginners get it wrong...
Here's how:
• Expect backtest results to be the same in real life
• Build their own backtesting framework
• Introduce bias into their backtest
So, how do you avoid these problems?
• Expect backtest results to be the same in real life
• Build their own backtesting framework
• Introduce bias into their backtest
So, how do you avoid these problems?
Use the Backtrader backtest library.
Backtrader is an event-driven backtesting framework designed to remove bias.
It’s easy to build and test trading strategies in a reusable way.
But it’s hard to get started.
Fortunately, I lay it out step-by-step here.
Backtrader is an event-driven backtesting framework designed to remove bias.
It’s easy to build and test trading strategies in a reusable way.
But it’s hard to get started.
Fortunately, I lay it out step-by-step here.
By reading this thread, you will be able to
- Get data from OpenBB
- Build a backtest using Backtrader
- Assess the results using QuantStats
Here's how to do it in Python, step by step.
- Get data from OpenBB
- Build a backtest using Backtrader
- Assess the results using QuantStats
Here's how to do it in Python, step by step.
The strategy underperforms the long-only strategy on an absolute basis.
But, it has better risk-adjusted returns, lower drawdowns, and lower volatility.
It also has a better profit factor—which is important for active strategies.
But, it has better risk-adjusted returns, lower drawdowns, and lower volatility.
It also has a better profit factor—which is important for active strategies.
By reading the thread, you can backtest a real trading strategy with Backtrader.
Now you can get data, backtest the strategy, and analyze the results to test the performance of your strategies.
Now you can get data, backtest the strategy, and analyze the results to test the performance of your strategies.
This thread is packed with information.
If you can't get to it all now, click the link to hop to the top tweet.
Then retweet it (with a comment!) so you can come back to it later.
If you can't get to it all now, click the link to hop to the top tweet.
Then retweet it (with a comment!) so you can come back to it later.
The FREE 7-day masterclass that will get you up and running with Python for quant finance.
Here's what you get:
• Working code to trade with Python
• Frameworks to get you started TODAY
• Trading strategy formation framework
7 days. Big results.
pythonforquantfinancemasterclass.com
Here's what you get:
• Working code to trade with Python
• Frameworks to get you started TODAY
• Trading strategy formation framework
7 days. Big results.
pythonforquantfinancemasterclass.com
Loading suggestions...