Merge pull request #7906 from initrv/fix-base-env-done-condition
fix base4 env done condition
This commit is contained in:
commit
439914caef
@ -88,7 +88,8 @@ class Base4ActionRLEnv(BaseEnvironment):
|
|||||||
{'price': self.current_price(), 'index': self._current_tick,
|
{'price': self.current_price(), 'index': self._current_tick,
|
||||||
'type': trade_type})
|
'type': trade_type})
|
||||||
|
|
||||||
if self._total_profit < 1 - self.rl_config.get('max_training_drawdown_pct', 0.8):
|
if (self._total_profit < self.max_drawdown or
|
||||||
|
self._total_unrealized_profit < self.max_drawdown):
|
||||||
self._done = True
|
self._done = True
|
||||||
|
|
||||||
self._position_history.append(self._position)
|
self._position_history.append(self._position)
|
||||||
|
Loading…
Reference in New Issue
Block a user