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