把hyperopt得到的结果 写死到 策略里,放置被错过

This commit is contained in:
zhangkun9038@dingtalk.com 2025-08-14 16:58:33 +08:00
parent a80a7738ef
commit 52d3c72ec1

View File

@ -40,18 +40,22 @@ class FreqaiPrimer(IStrategy):
TREND_BEARISH_THRESHOLD = 60
# 新的加权趋势判定阈值用于hyperopt优化
TREND_FINAL_BULLISH_THRESHOLD = 70 # 上涨趋势最终阈值
TREND_FINAL_BEARISH_THRESHOLD = 30 # 下跌趋势最终阈值
TREND_FINAL_BULLISH_THRESHOLD = 55 # 上涨趋势最终阈值
TREND_FINAL_BEARISH_THRESHOLD = 13 # 下跌趋势最终阈值
# Hyperopt 可优化参数
trend_final_bullish_threshold = IntParameter(50, 90, default=87, space="buy", optimize=True, load=True)
trend_final_bearish_threshold = IntParameter(10, 50, default=53, space="buy", optimize=True, load=True)
trend_final_bullish_threshold = IntParameter(40, 90, default=55, space="buy", optimize=True, load=True)
trend_final_bearish_threshold = IntParameter(10, 40, default=13, space="buy", optimize=True, load=True)
# --- 🛠️ 固定配置参数 ---
stoploss = -0.15
timeframe = "3m"
use_custom_stoploss = True
position_adjustment_enable = True # 启用动态仓位调整
trailing_stop = True
trailing_stop_positive = 0.046
trailing_stop_positive_offset = 0.146
trailing_only_offset_is_reached = False
minimal_roi = {
"0": 0.06, # 30分钟0-30分钟8% 盈利退出