让gemini给我优化了一版rl+3
This commit is contained in:
parent
72934129df
commit
77919d9ea9
@ -46,7 +46,9 @@ class MyCoolRLModel(ReinforcementLearner):
|
||||
pnl = self.get_unrealized_profit() # 当前浮动盈亏 (百分比,如 0.01 代表 1%)
|
||||
|
||||
# 获取持仓时间 (K线数量)
|
||||
trade_duration = self._current_tick - self._last_trade_tick
|
||||
trade_duration = 0
|
||||
if self._last_trade_tick is not None:
|
||||
trade_duration = self._current_tick - self._last_trade_tick
|
||||
|
||||
# 读取配置中的最大持仓时间,默认 100 根 K 线
|
||||
max_trade_duration = self.rl_config.get("max_trade_duration_candles", 100)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user