AI4Finance-Foundation / FinRL

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

TypeError: 'type' object is not subscriptable #1183

Closed Alexhk01 closed 6 months ago

Alexhk01 commented 6 months ago

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

To Reproduce Steps to reproduce the behavior:

  1. Go to '...': FinRL_PaperTrading_Demo.ipynb
  2. Click on '....': Import related modules
  3. Scroll down to '....'
  4. See error:

    TypeError Traceback (most recent call last) Cell In[2], line 1 ----> 1 from finrl.config_tickers import DOW_30_TICKER 2 from finrl.config import INDICATORS 3 from finrl.meta.env_stock_trading.env_stocktrading_np import StockTradingEnv

File E:\qw_e\FinRL\finrl__init.py:4 1 from future__ import annotations 3 from finrl.test import test ----> 4 from finrl.trade import trade 5 from finrl.train import train

File E:\qw_e\FinRL\finrl\trade.py:3 1 from future import annotations ----> 3 from finrl.meta.env_stock_trading.env_stock_papertrading import AlpacaPaperTrading 4 from finrl.test import test 7 def trade( 8 start_date, 9 end_date, (...) 22 **kwargs, 23 ):

File E:\qw_e\FinRL\finrl\meta\env_stock_trading\env_stock_papertrading.py:13 10 import pandas as pd 11 import torch ---> 13 from finrl.meta.data_processors.processor_alpaca import AlpacaProcessor 16 class AlpacaPaperTrading: 17 def init( 18 self, 19 ticker_list, (...) 34 ): 35 # load agent

File E:\qw_e\FinRL\finrl\meta\data_processors\processor_alpaca.py:11 9 import pandas as pd 10 import pytz ---> 11 from stockstats import StockDataFrame as Sdf 14 class AlpacaProcessor: 15 def init(self, API_KEY=None, API_SECRET=None, API_BASE_URL=None, api=None):

File ~\AppData\Local\anaconda3\envs\fin\lib\site-packages\stockstats.py:94 43 pass 46 _dft_windows = { 47 # sort alphabetically 48 'ao': (5, 34), (...) 90 'vwma': 14, 91 } ---> 94 def set_dft_window(name: str, windows: Union[int, tuple[int, ...]]): 95 ret = _dft_windows.get(name) 96 _dft_windows[name] = windows

TypeError: 'type' object is not subscriptable

Expected behavior A clear and concise description of what you expected to happen.

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.