How to handle multi-products with different date range?
nash_hk last edited by
Let's say we have a macro indicator to buy or sell treasury notes, or any product that expires for that matter. For a given date, there would be a certain set of notes from which to buy or sell. How can Backtrader handle that in data feeds, I can pass all the products data feeds from the note inception to expiry. But then, all data feeds will won't have same start and end date.
ab_trader last edited by
btcan handle as many data feeds as you pass, also it doesn't matter for
btwhat are the data feed lengths. Script written should check if data feed prices are available at the moment, specify what to buy and what to sell etc.
run-out last edited by
@ab_trader Not sure if this is an issue since I did this a long time ago.... But when i was putting in stocks for an asx200 analysis going back a long time, some of the stocks didn't have data either at the beginning or the end. I had to at the time use pandas to fill in the beginning and ends with zeros before passing this into backtrader. Again, I was pretty green with backtrader then so not sure if this practice is necessary or not.