Duplicate of#20
Description
Hi, I like the direction where backtesting.py is going, but I am missing some backtrader functionality... Maybe the most important - currently only one stock is supported right?
Because if I have a strategy which uses 2 stocks, how would I deal with that? The backtrader way was using self.datas instead of data, which then becomes an array with all the stock datas, and then obviously the buy/sell functions would need a ticker parameter...
Or is there already a way to achieve this?
Activity
JustinGuese commentedon Jan 12, 2024
or is that functionality actually already there?
so would I pass something like
data = { "MSFT" : yf.download("MSFT"), "AAPL" : ...?
PabloCanovas commentedon Mar 24, 2024
Check out https://github.com/dodid/minitrade, a fork from this project which allows for multiasset backtesting.
Would love to have this functionality here under @kernc project though!
BradKML commentedon May 29, 2024
Seconding this since it is getting more important to mess with pair trading. Also @PabloCanovas do you know of any equivalents for
bt
?s-kust commentedon Aug 14, 2024
You may want to take a look at https://github.com/s-kust/python-backtesting-template/
kernc commentedon Feb 19, 2025
Duplicate of either #20 or #508.