移除了一个对populate_indicate的手动调用

This commit is contained in:
zhangkun9038@dingtalk.com 2025-07-04 15:42:51 +00:00
parent 4a225f4507
commit 8c0b6669d8

View File

@ -567,20 +567,10 @@ class FreqaiPrimer(IStrategy):
return True
def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
rate: float, time_in_force: str, exit_reason: str,
current_time: datetime, **kwargs) -> bool:
adjusted_rate = rate * (1 + 0.005)
# 获取最新的 dataframe 以提取触发条件
dataframe = self.dp.get_pair_dataframe(pair=pair, timeframe=self.timeframe)
dataframe = self.populate_indicators(dataframe, {'pair': pair})
dataframe = self.populate_exit_trend(dataframe, {'pair': pair})
# 获取退出条件信息
exit_conditions = dataframe['exit_conditions'].iloc[-1] if 'exit_conditions' in dataframe.columns and not dataframe['exit_conditions'].isna().iloc[-1] else "Unknown"
logger.info(f"[{pair}] 退出交易,原因:{exit_reason}, 原始利润:{trade.calc_profit_ratio(rate):.2%}, "
f"调整后卖出价:{adjusted_rate:.6f}, 触发条件:{exit_conditions}")
rate: float, time_in_force: str, exit_reason: str,
current_time: datetime, **kwargs) -> bool:
adjusted_rate = rate * (1 + 0.0025)
logger.info(f"[{pair}] 退出交易,原因:{exit_reason}, 原始利润:{trade.calc_profit_ratio(rate):.2%},"f"调整后卖出价:{adjusted_rate:.6f}")
return True
def custom_roi(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int,