phase块换成了propertiesGrp块
This commit is contained in:
parent
0812014041
commit
3c614fb191
@ -81,53 +81,44 @@ class FreqaiPrimer(IStrategy):
|
||||
timeframe = "3m" # 主时间框架为 3 分钟
|
||||
can_short = False # 禁用做空
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
# [PHASE_START id="1" name="第一轮优化" space="buy" description="入场基础条件优化"]
|
||||
# 自定义指标参数 - 使用Hyperopt可优化参数
|
||||
bb_std = DecimalParameter(1.5, 3.0, decimals=1, default=2.9, optimize=False, load=True, space='buy') # [PARAM]
|
||||
rsi_length = IntParameter(7, 21, default=18, optimize=False, load=True, space='buy') # [PARAM]
|
||||
# 入场条件阈值参数
|
||||
bb_lower_deviation = DecimalParameter(1.01, 1.05, decimals=2, default=1.03, optimize=False, load=True, space='buy') # [PARAM]
|
||||
stochrsi_bull_threshold = IntParameter(30, 40, default=33, optimize=False, load=True, space='buy') # [PARAM]
|
||||
volume_multiplier = DecimalParameter(1.2, 2.0, decimals=1, default=1.5, optimize=False, load=True, space='buy') # [PARAM]
|
||||
min_condition_count = IntParameter(2, 4, default=2, optimize=False, load=True, space='buy') # [PARAM]
|
||||
# [PHASE_END]
|
||||
# [propertiesGrp_List]--------------------------------------------------------------------------------------------------------------------------------------
|
||||
# [propertiesGrp id="1" name="第一轮优化" space="buy" description="入场基础条件优化"]
|
||||
bb_length = IntParameter(10, 30, default=20, optimize=False, load=True, space='buy') # [PARAM]
|
||||
bb_std = DecimalParameter(1.5, 3.5, decimals=1, default=2.5, optimize=False, load=True, space='buy') # [PARAM]
|
||||
rsi_length = IntParameter(10, 20, default=14, optimize=False, load=True, space='buy') # [PARAM]
|
||||
bb_lower_deviation = DecimalParameter(1.01, 1.05, decimals=2, default=1.020, optimize=False, load=True, space='buy') # [PARAM]
|
||||
stochrsi_bull_threshold = IntParameter(30, 40, default=35, optimize=False, load=True, space='buy') # [PARAM]
|
||||
volume_multiplier = DecimalParameter(1.2, 2.0, decimals=1, default=1.800, optimize=False, load=True, space='buy') # [PARAM]
|
||||
min_condition_count = IntParameter(2, 4, default=3, optimize=False, load=True, space='buy') # [PARAM]
|
||||
# [/propertiesGrp]
|
||||
|
||||
# [PHASE_START id="2" name="第二轮优化" space="buy" description="入场确认条件优化"]
|
||||
# 自定义指标参数 - 使用Hyperopt可优化参数
|
||||
bb_length = IntParameter(10, 30, default=28, optimize=False, load=True, space='buy') # [PARAM]
|
||||
rsi_oversold = IntParameter(30, 50, default=40, optimize=False, load=True, space='buy') # [PARAM]
|
||||
|
||||
# 入场条件阈值参数
|
||||
# [propertiesGrp id="2" name="第二轮优化" space="buy" description="入场确认条件优化"]
|
||||
bb_length = IntParameter(10, 30, default=20, optimize=False, load=True, space='buy') # [PARAM]
|
||||
bb_std = DecimalParameter(1.5, 3.5, decimals=1, default=2.5, optimize=False, load=True, space='buy') # [PARAM]
|
||||
rsi_length = IntParameter(10, 20, default=14, optimize=False, load=True, space='buy') # [PARAM]
|
||||
rsi_bull_threshold = IntParameter(45, 55, default=53, optimize=False, load=True, space='buy') # [PARAM]
|
||||
stochrsi_neutral_threshold = IntParameter(20, 30, default=26, optimize=False, load=True, space='buy') # [PARAM]
|
||||
bb_width_threshold = DecimalParameter(0.01, 0.03, decimals=3, default=0.013, optimize=False, load=True, space='buy') # [PARAM]
|
||||
# [PHASE_END]
|
||||
# [/propertiesGrp]
|
||||
|
||||
# [PHASE_START id="3" name="第三轮优化" space="buy" description="剧烈拉升检测与加仓策略优化"]
|
||||
# 剧烈拉升检测参数 - 使用Hyperopt可优化参数
|
||||
# [propertiesGrp id="3" name="第三轮优化" space="buy" description="剧烈拉升检测与加仓策略优化"]
|
||||
h1_max_candles = IntParameter(100, 300, default=260, optimize=False, load=True, space='buy') # [PARAM]
|
||||
h1_rapid_rise_threshold = DecimalParameter(0.05, 0.15, decimals=3, default=0.148, optimize=False, load=True, space='buy') # [PARAM]
|
||||
h1_max_consecutive_candles = IntParameter(1, 4, default=2, optimize=False, load=True, space='buy') # [PARAM]
|
||||
|
||||
# 加仓策略参数
|
||||
max_entry_adjustments = IntParameter(2, 5, default=4, optimize=False, load=True, space='buy') # [PARAM] 最大加仓次数
|
||||
add_position_callback = DecimalParameter(0.03, 0.06, decimals=3, default=0.03, optimize=False, load=True, space='buy') # [PARAM] 加仓回调百分比
|
||||
adjust_multiplier = DecimalParameter(0.05, 0.6, decimals=2, default=0.59, optimize=False, load=True, space='buy') # [PARAM] 加仓金额分母
|
||||
# [PHASE_END]
|
||||
# [/propertiesGrp]
|
||||
|
||||
# [PHASE_START id="4" name="第四轮优化" space="sell" description="出场与减仓策略优化"]
|
||||
# 出场条件阈值参数
|
||||
# [propertiesGrp id="4" name="第四轮优化" space="sell" description="出场与减仓策略优化"]
|
||||
exit_bb_upper_deviation = DecimalParameter(0.98, 1.02, decimals=2, default=0.99, optimize=True, load=True, space='sell') # [PARAM]
|
||||
exit_volume_multiplier = DecimalParameter(1.5, 3.0, decimals=1, default=2.2, optimize=True, load=True, space='sell') # [PARAM]
|
||||
|
||||
rsi_overbought = IntParameter(57, 59, default=58, optimize=True, load=True, space='sell') # [PARAM]
|
||||
# 减仓策略参数
|
||||
reduce_profit_base = DecimalParameter(0.05, 0.12, default=0.05, space='sell', optimize=True) # [PARAM] 减仓基础盈利阈值
|
||||
reduce_coefficient = DecimalParameter(0.1, 0.6, default=0.289, space='sell', optimize=True) # [PARAM] 减仓金额系数
|
||||
max_reduce_adjustments = IntParameter(1, 3, default=3, space='sell', optimize=True) # [PARAM] 最大减仓次数
|
||||
# [PHASE_END]
|
||||
# --------------------------------------------------------------------------------------------------------------------------------------
|
||||
# [/propertiesGrp]
|
||||
# [/propertiesGrp_List]-----------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def informative_pairs(self):
|
||||
pairs = self.dp.current_whitelist()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user