加仓逻辑更新

This commit is contained in:
zhangkun9038@dingtalk.com 2025-08-22 20:24:50 +08:00
parent 1d4f85b102
commit b7ec81e280

View File

@ -1367,12 +1367,13 @@ class FreqaiPrimer(IStrategy):
return None
if drop_baseline <= current_add_threshold and hold_time > 5: # 使用正确跌幅基准
# 统一加仓倍数
multipliers = [1, 2, 4, 8] # 固定倍数序列 [首次, 第二次, 第三次, 第四次]
# 新的加仓逻辑:基于标准入场金额一半(37.5)的递进倍数
base_add_amount = initial_stake_amount / 2 # 37.5 USDT
multipliers = [1, 4, 8, 16] # 递进倍数序列 [首次, 第二次, 第三次, 第四次]
if add_count < len(multipliers):
multiplier = multipliers[add_count]
add_amount = initial_stake_amount * multiplier
add_amount = base_add_amount * multiplier
if min_stake is not None and add_amount < min_stake:
logger.warning(f"{pair} 加仓金额 {add_amount:.2f} 低于最小下注金额 {min_stake:.2f}")
@ -1382,8 +1383,8 @@ class FreqaiPrimer(IStrategy):
logger.info(f"{pair}{add_count + 1} 次加仓触发: "
f"跌幅 {profit_ratio*100:.2f}% <= 阈值 {current_add_threshold*100:.2f}%, "
f"加仓金额 {add_amount:.2f} (倍数{multiplier}x)")
return (add_amount, f"Add {add_count + 1}: Drop {profit_ratio*100:.2f}% <= {current_add_threshold*100:.2f}%, add {add_amount:.2f}")
f"加仓金额 {add_amount:.2f} (基于37.5×{multiplier})")
return (add_amount, f"Add {add_count + 1}: Drop {profit_ratio*100:.2f}% <= {current_add_threshold*100:.2f}%, add {add_amount:.2f} (37.5×{multiplier})")
# 统一减仓逻辑(移除趋势判断)
if profit_ratio >= exit_position_ratio: