Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cost #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix cost #17

wants to merge 3 commits into from

Conversation

ydup
Copy link

@ydup ydup commented Dec 11, 2020

Hi, if the abs(action)=100 > self.state[index+STOCK_DIM+1]=110, the cost at this step will be 0 because the state[index+STOCK_DIM+1] is updated before cost calculation.

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

So I move the cost before updating the state

put the cost calculation before updating the stock shares
@ydup ydup changed the title Update EnvMultipleStock_trade.py Update cost Dec 11, 2020
@ydup ydup changed the title Update cost Fix cost Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant