hackthemarket / gym-trading

Environment for reinforcement-learning algorithmic trading models
MIT License
699 stars 214 forks source link

Potential bug in the trading_env.py? #10

Closed yutingsz closed 5 years ago

yutingsz commented 5 years ago

If I understand the code correctly, there is one bug: Line 123 of the code trading_env.py: self.posns[self.step] = action - 1
self.trades[self.step] = self.posns[self.step] - bod_posn

Should be self.posns[self.step] = bod_posn + action - 1 self.trades[self.step] = action - 1

Does the variable self.trade represent the trades, and posns represent the position after the trades are executed?

yutingsz commented 5 years ago

Just different ways of defining actions. Solved