Kostis-S-Z / trading-rl

Deep Reinforcement Learning for Financial Trading using Price Trailing @ ICASSP 2019
218 stars 45 forks source link

self.prev_fin_pos doubt #12

Open mg64ve opened 4 years ago

mg64ve commented 4 years ago

I am reviewing my code but I am still not able to publish yet. I have my function for pnl calculation, I am not sure if it is correct. But now, reviewing my code I got a doubt on the following:

self.action = SELL
self.value -= self.value * self.turn  # Update s(t+1) = s(t) + [s(t) * a]
self.short_actions.append([self.position, c_val])
self.prev_fin_pos = SELL

Shouldn't be the following?

self.prev_fin_pos = self.action
self.action = SELL
self.value -= self.value * self.turn  # Update s(t+1) = s(t) + [s(t) * a]
self.short_actions.append([self.position, c_val])

Kindly let me know what you think about it. Thanks