设置了roi, 精简了log
This commit is contained in:
parent
4fa29de956
commit
03a60457a6
@ -1,7 +1,12 @@
|
||||
{
|
||||
"strategy_name": "FreqaiPrimer",
|
||||
"params": {
|
||||
"roi": {},
|
||||
"roi": {
|
||||
"0": 0.067,
|
||||
"400": 0.025,
|
||||
"1000": 0.015,
|
||||
"4000": 0
|
||||
},
|
||||
"stoploss": {
|
||||
"stoploss": -0.14
|
||||
},
|
||||
@ -15,35 +20,34 @@
|
||||
"max_open_trades": 5
|
||||
},
|
||||
"buy": {
|
||||
"bb_std": 3.0,
|
||||
"bb_width_threshold": 0.012,
|
||||
"h1_max_candles": 200,
|
||||
"h1_max_consecutive_candles": 3,
|
||||
"max_entry_adjustments": 2,
|
||||
"rsi_bull_threshold": 54,
|
||||
"rsi_length": 16,
|
||||
"stochrsi_bull_threshold": 36,
|
||||
"volume_multiplier": 1.6,
|
||||
"add_position_callback": 36,
|
||||
"bb_length": 14,
|
||||
"bb_lower_deviation": 1.05,
|
||||
"h1_rapid_rise_threshold": 0.065,
|
||||
"add_position_callback": 0.042,
|
||||
"adjust_multiplier": 0.2,
|
||||
"bb_length": 16,
|
||||
"bb_lower_deviation": 1.04,
|
||||
"bb_std": 2.8,
|
||||
"bb_width_threshold": 0.018,
|
||||
"h1_max_candles": 264,
|
||||
"h1_max_consecutive_candles": 4,
|
||||
"h1_rapid_rise_threshold": 0.139,
|
||||
"max_entry_adjustments": 3,
|
||||
"min_condition_count": 2,
|
||||
"rsi_oversold": 42,
|
||||
"stake_divisor": 2.793,
|
||||
"step_coefficient": 1.45,
|
||||
"stochrsi_neutral_threshold": 29
|
||||
"rsi_bull_threshold": 50,
|
||||
"rsi_length": 11,
|
||||
"rsi_oversold": 39,
|
||||
"stochrsi_bull_threshold": 40,
|
||||
"stochrsi_neutral_threshold": 20,
|
||||
"volume_multiplier": 1.7
|
||||
},
|
||||
"sell": {
|
||||
"exit_bb_upper_deviation": 0.99,
|
||||
"exit_volume_multiplier": 1.7,
|
||||
"roi_param_a": -6e-05,
|
||||
"roi_param_k": 132,
|
||||
"roi_param_t": 0.168,
|
||||
"max_reduce_adjustments": 3,
|
||||
"reduce_coefficient": 0.289,
|
||||
"reduce_profit_base": 0.05,
|
||||
"rsi_overbought": 58
|
||||
},
|
||||
"protection": {}
|
||||
},
|
||||
"ft_stratparam_v": 1,
|
||||
"export_time": "2025-10-05 16:38:39.948030+00:00"
|
||||
"export_time": "2025-11-16 20:08:10.436302+00:00"
|
||||
}
|
||||
|
||||
@ -83,28 +83,28 @@ class FreqaiPrimer(IStrategy):
|
||||
|
||||
# [propertiesGrp_List]--------------------------------------------------------------------------------------------------------------------------------------
|
||||
# [propertiesGrp id="1" name="第一轮优化" epochs="85" space="buy" description="入场基础条件优化"]
|
||||
bb_std = DecimalParameter(1.5, 3.0, decimals=1, default=2.9, optimize=False, load=True, space='buy')
|
||||
rsi_length = IntParameter(7, 21, default=18, optimize=False, load=True, space='buy')
|
||||
bb_lower_deviation = DecimalParameter(1.01, 1.05, decimals=2, default=1.03, optimize=False, load=True, space='buy')
|
||||
stochrsi_bull_threshold = IntParameter(30, 40, default=33, optimize=False, load=True, space='buy')
|
||||
volume_multiplier = DecimalParameter(1.2, 2.0, decimals=1, default=1.5, optimize=False, load=True, space='buy')
|
||||
min_condition_count = IntParameter(2, 4, default=2, optimize=False, load=True, space='buy')
|
||||
bb_std = DecimalParameter(1.5, 3.0, decimals=1, default=2.9, optimize=True, load=True, space='buy')
|
||||
rsi_length = IntParameter(7, 21, default=18, optimize=True, load=True, space='buy')
|
||||
bb_lower_deviation = DecimalParameter(1.01, 1.05, decimals=2, default=1.03, optimize=True, load=True, space='buy')
|
||||
stochrsi_bull_threshold = IntParameter(30, 40, default=33, optimize=True, load=True, space='buy')
|
||||
volume_multiplier = DecimalParameter(1.2, 2.0, decimals=1, default=1.5, optimize=True, load=True, space='buy')
|
||||
min_condition_count = IntParameter(2, 4, default=2, optimize=True, load=True, space='buy')
|
||||
|
||||
# [propertiesGrp id="2" name="第二轮优化" epochs="120" space="buy" description="入场确认条件优化"]
|
||||
bb_length = IntParameter(10, 30, default=28, optimize=False, load=True, space='buy')
|
||||
rsi_oversold = IntParameter(30, 50, default=40, optimize=False, load=True, space='buy')
|
||||
rsi_bull_threshold = IntParameter(45, 55, default=53, optimize=False, load=True, space='buy')
|
||||
stochrsi_neutral_threshold = IntParameter(20, 30, default=26, optimize=False, load=True, space='buy')
|
||||
bb_width_threshold = DecimalParameter(0.01, 0.03, decimals=3, default=0.013, optimize=False, load=True, space='buy')
|
||||
bb_length = IntParameter(10, 30, default=28, optimize=True, load=True, space='buy')
|
||||
rsi_oversold = IntParameter(30, 50, default=40, optimize=True, load=True, space='buy')
|
||||
rsi_bull_threshold = IntParameter(45, 55, default=53, optimize=True, load=True, space='buy')
|
||||
stochrsi_neutral_threshold = IntParameter(20, 30, default=26, optimize=True, load=True, space='buy')
|
||||
bb_width_threshold = DecimalParameter(0.01, 0.03, decimals=3, default=0.013, optimize=True, load=True, space='buy')
|
||||
# [/propertiesGrp]
|
||||
|
||||
# [propertiesGrp id="3" name="第三轮优化" epochs="250" space="buy" description="剧烈拉升检测与加仓策略优化"]
|
||||
h1_max_candles = IntParameter(100, 300, default=260, optimize=False, load=True, space='buy')
|
||||
h1_rapid_rise_threshold = DecimalParameter(0.05, 0.15, decimals=3, default=0.148, optimize=False, load=True, space='buy')
|
||||
h1_max_consecutive_candles = IntParameter(1, 4, default=2, optimize=False, load=True, space='buy')
|
||||
max_entry_adjustments = IntParameter(2, 5, default=4, optimize=False, load=True, space='buy') # 最大加仓次数
|
||||
add_position_callback = DecimalParameter(0.03, 0.06, decimals=3, default=0.03, optimize=False, load=True, space='buy') # 加仓回调百分比
|
||||
adjust_multiplier = DecimalParameter(0.05, 0.6, decimals=2, default=0.59, optimize=False, load=True, space='buy') # 加仓金额分母
|
||||
h1_max_candles = IntParameter(100, 300, default=260, optimize=True, load=True, space='buy')
|
||||
h1_rapid_rise_threshold = DecimalParameter(0.05, 0.15, decimals=3, default=0.148, optimize=True, load=True, space='buy')
|
||||
h1_max_consecutive_candles = IntParameter(1, 4, default=2, optimize=True, load=True, space='buy')
|
||||
max_entry_adjustments = IntParameter(2, 5, default=4, optimize=True, load=True, space='buy') # 最大加仓次数
|
||||
add_position_callback = DecimalParameter(0.03, 0.06, decimals=3, default=0.03, optimize=True, load=True, space='buy') # 加仓回调百分比
|
||||
adjust_multiplier = DecimalParameter(0.05, 0.6, decimals=2, default=0.59, optimize=True, load=True, space='buy') # 加仓金额分母
|
||||
# [/propertiesGrp]
|
||||
|
||||
# [propertiesGrp id="4" name="第四轮优化" epochs="100" space="sell" description="出场与减仓策略优化"]
|
||||
@ -625,7 +625,7 @@ class FreqaiPrimer(IStrategy):
|
||||
additional_stake = (self.adjust_multiplier.value * initial_stake) ** (entry_count)
|
||||
additional_stake = max(min_stake, min(additional_stake, max_stake - trade.stake_amount))
|
||||
current_time_str = current_time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
logger.info(f"[{pair}] 触发加仓: 时间={current_time_str}, 第{entry_count}次开仓,初始金额{initial_stake:.2f},金额{additional_stake:.2f},跌幅{price_diff_pct:.2%}")
|
||||
# logger.info(f"[{pair}] 触发加仓: 时间={current_time_str}, 第{entry_count}次开仓,初始金额{initial_stake:.2f},金额{additional_stake:.2f},跌幅{price_diff_pct:.2%}")
|
||||
return additional_stake
|
||||
|
||||
return 0.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user