AI4Finance-Foundation / AI4Finance-Foundation/FinRL-Meta
关于China_A_share_market_tushare的一个疑惑
- Vorherrschende Sprache
- Python
- Sterne
- 1.9k
- Forks
- 751
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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,该如何修改?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.