admin管理员组文章数量:1122846
I am using Backtrader in order to analysis multiple stocks until today (2024-11-22). I have a problem with Deslisted stocks that they have end datetime different (for example: ABMD finished at 2022-12-21, and today is 2024-11-22).
The behaviour of backtarder is to use the last days line (2022-12-21), with open and close prices of that day until 2024-11-22. Is there any filter or something to solve these and complete with zero or NaN? Any Idea?
The last line of the CSV data of ABMD stock is:
- Date: 2022-12-21,
- Open: 380.78, (this value is used to complete all the data until 2024-11-22)
- High: 381.28,
- Low: 380.51,
- Close: 381.02, (this value is used to complete all the data until 2024-11-22)
- Volume: 20612256
In my example, I have the following log:
- 2023-04-06, Pre Buy - Stock: Delisted_ABMD - Price: 381.02 (Close Price)
- 2023-04-10, Buy Executed - Stock: Delisted_ABMD - Price: 380.78 (Next day Open Price)
Looking in backtrader guide or stackoverflow, but not find anything! I am expecting backtrader complete the empty data until 2024-11-22 with zero o NaN values.
Thanks for all :)
本文标签: pythonBacktrader Multiple Stocks with different end datetime problemStack Overflow
版权声明:本文标题:python - Backtrader Multiple Stocks with different end datetime problem - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736303052a1931752.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论