绿色通道入场机制
This commit is contained in:
parent
55c25baf51
commit
c5b35e9c09
@ -901,6 +901,10 @@ class FreqaiPrimer(IStrategy):
|
||||
hold_time = (current_time - trade.open_date_utc).total_seconds() / 60
|
||||
profit_ratio = (current_rate - trade.open_rate) / trade.open_rate
|
||||
|
||||
# 检测趋势状态(必须先定义才能使用)
|
||||
trend_status = self.detect_trend_status(dataframe, {'pair': pair})
|
||||
logger.info(f"{pair} 当前趋势状态: {trend_status}")
|
||||
|
||||
# 检测当前持仓订单数量
|
||||
open_trades = len(self.active_trades) if hasattr(self, 'active_trades') else 0
|
||||
|
||||
@ -916,10 +920,6 @@ class FreqaiPrimer(IStrategy):
|
||||
logger.info(f"{pair} 首次入场金额: {initial_stake_amount:.2f}, 当前持仓金额: {trade.stake_amount:.2f}, "
|
||||
f"加仓次数: {trade.nr_of_successful_entries - 1}, 趋势得分: {trend_score:.2f}")
|
||||
|
||||
# 检测趋势状态
|
||||
trend_status = self.detect_trend_status(dataframe, {'pair': pair})
|
||||
logger.info(f"{pair} 当前趋势状态: {trend_status}")
|
||||
|
||||
# 根据趋势状态调整仓位管理参数
|
||||
if trend_status == "bullish":
|
||||
# 上涨趋势:积极加仓,放宽止盈
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user