AI4Finance-Foundation / AI4Finance-Foundation/FinRL

ZeroDivisionError on stock trades

Ouverte
#772 9 commentaires 0 réactions 1 personne assignée Réclamée par @zhumingpassional Voir sur GitHub
bug
Langage dominant
Jupyter Notebook
Étoiles
16.3k
Forks
3.5k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**Describe the bug**
Divide by zero errors / warnings during model training.

`ZeroDivisionError: float divmod()`
`RuntimeWarning: divide by zero encountered in double_scalars`

**To Reproduce**
Steps to reproduce the behavior:
1. Run training (e.g. as in the notebook here: https://github.com/AI4Finance-Foundation/FinRL-Tutorials/blob/master/1-Introduction/Stock_NeurIPS2018_SB3.ipynb)
2. Will frequently report `RuntimeWarning: divide by zero encountered in double_scalars`
3. Will infrequently crash completely with `ZeroDivisionError: float divmod()` on the same line

Line in question: https://github.com/AI4Finance-Foundation/FinRL/blob/master/finrl/meta/env_stock_trading/env_stocktrading.py#L179

**Expected behavior**
Either the trade should be blocked, or the agent should receive a significant negative reward for making an illegal trade, rather than the environment crashing.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.