AI4Finance-Foundation / AI4Finance-Foundation/FinRL_Podracer

StockTrading_Demo.ipynb does not run

Aberta
#8 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
507
Forks
121
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Issues:
1. The file being written is `StockTradingEnv-v2_0` so the code to load the file for backtesting should be: `args.cwd = './AgentPPO/StockTradingEnv-v2_0'` instead of `v1_0`
2. Even when making above change, the following error occurs in backtesting:
```
KeyError Traceback (most recent call last)
~/opt/anaconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
3079 try:
-> 3080 return self._engine.get_loc(casted_key)
3081 except KeyError as err:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'single-stock-baseline'
```

UPDATE:
I believe the fix is to change in file `env.py`, method `get_daily_return`:
```
return pd.Series(df["single-stock-baseline"], index=df.index)
```
to
```
return pd.Series(df["daily_return"], index=df.index)
```

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.