AI4Finance-Foundation / AI4Finance-Foundation/FinRL-Trading
Does the cost is updating with new value of shares or old ones ?
- 主要語言
- Python
- 星號
- 3.7k
- 分支
- 1.1k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
When the selling of stock happens, and the cost is updated, I think this update with new amount of shares.
I mean, first time `self.state[index+STOCK_DIM+1]` is updated and this updated version is participated to compute costs
```
self.cost +=self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \
TRANSACTION_FEE_PERCENT ```
`Where I am wrong? The amount of shares (self. state[index+STOCK_DIM+1]) in cost is a new one or an old one?
`
```
def _sell_stock(self, index, action):
# perform sell action based on the sign of the action
if self.state[index+STOCK_DIM+1] > 0:
#update balance
self.state[0] += \
self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \
(1- TRANSACTION_FEE_PERCENT)
self.state[index+STOCK_DIM+1] -= min(abs(action), self.state[index+STOCK_DIM+1])
self.cost +=self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \
TRANSACTION_FEE_PERCENT
self.trades+=1
else:
pass
```
`Here is the full version of codes from the training environment`
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。