Fix 4ac update_total_profit
_update_total_profit() must be executed before "self._position = Positions.Neutral" because _update_total_profit() calls get_unrealized_profit(), which returns 0 if position is neutral and total_profit is not updated
This commit is contained in:
parent
b52f05923a
commit
51d21b413d
@ -73,8 +73,8 @@ class Base4ActionRLEnv(BaseEnvironment):
|
||||
trade_type = "short"
|
||||
self._last_trade_tick = self._current_tick
|
||||
elif action == Actions.Exit.value:
|
||||
self._position = Positions.Neutral
|
||||
self._update_total_profit()
|
||||
self._position = Positions.Neutral
|
||||
trade_type = "neutral"
|
||||
self._last_trade_tick = None
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user