AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.36k stars 2.27k forks source link

backtest_plot() have internal problem associated with pandas version #1236

Closed XJTLUmedia closed 1 month ago

XJTLUmedia commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

from finrl.plot import backtest_stats, backtest_plot, get_daily_return, get_baseline

print("==============Compare to DJIA===========")
%matplotlib inline
# S&P 500: ^GSPC
# Dow Jones Index: ^DJI
# NASDAQ 100: ^NDX
backtest_plot(df_account_value, 
              baseline_ticker = '^DJI', 
              baseline_start = df_account_value.loc[0,'date'],
              baseline_end = df_account_value.loc[len(df_account_value)-1,'date'])

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

the backtest_plot got error when running on google colab image image

Expected behavior No error should be happened, it should not conflict with pandas version

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

XJTLUmedia commented 1 month ago

I saw it get fixed. Sorry for bothering. Nvm