AI4Finance-Foundation / AI4Finance-Foundation/FinRL

Incorrect initialization in env_stocktrading for single asset

未关闭
#1,175 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Jupyter Notebook
星标
16.3k
派生
3.5k
PR 合并指标
30 天内没有已合并 PR

描述

In finrl/meta/env_stock_trading/env_stocktrading.py in function _initiate_state when the environment initializated for single stock - it always initialize as zero.

From line 419
else:
# for single stock
state = (
[self.initial_amount]
+ [self.data.close]
+ [0] * self.stock_dim
+ sum(([self.data[tech]] for tech in self.tech_indicator_list), [])
)
I think it should be something like that:
else:
# for single stock
state = (
[self.initial_amount]
+ [self.data.close]
+ [self.num_stock_shares[0]] * self.stock_dim
+ sum(([self.data[tech]] for tech in self.tech_indicator_list), [])
)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。