AI4Finance-Foundation / AI4Finance-Foundation/FinRL-Meta

关于China_A_share_market_tushare的一个疑惑

未关闭
#203 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
discussion
主要语言
Python
星标
1.9k
派生
751
PR 合并指标
30 天内没有已合并 PR

描述

China的股票采用T+1的交易制度。我在跑China_A_share_market_tushare的例子的时候,val_start_date='20220619', val_stop_date='20220701';在account的输出中包含20220701的账户余额,但是在actions的输出中未包含20220701的账户操作,使用的是stablebaselines3的SAC Agent。但是我现在的需求是在盘尾根据OHLCV预测Action。我看了一下DRL_prediction的实现方式:
for i in range(len(environment.df.index.unique())):
action, _states = model.predict(test_obs, deterministic=deterministic)
# account_memory = test_env.env_method(method_name="save_asset_memory")
# actions_memory = test_env.env_method(method_name="save_action_memory")
test_obs, rewards, dones, info = test_env.step(action)
if i == (len(environment.df.index.unique()) - 2):(在循环到df的倒数第二行就形成结果了)
account_memory = test_env.env_method(method_name="save_asset_memory")
actions_memory = test_env.env_method(method_name="save_action_memory")
# state_memory=test_env.env_method(method_name="save_state_memory") # add current state to state memory
if dones[0]:
print("hit end!")
break
return account_memory[0], actions_memory[0]
这种设计的用意何在?如果我需要实现盘尾根据OHLCV预测Action,该如何修改?

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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