diff --git a/3in1 copy.pine b/3in1 copy.pine index dd2a258..a4f6360 100644 --- a/3in1 copy.pine +++ b/3in1 copy.pine @@ -1226,7 +1226,7 @@ is_cooldown_over(last_alert_time, cooldown_minutes) => time_diff = (time - last_alert_time) / 60000 // 转换为分钟 time_diff >= cooldown_minutes -// 做多条件检查(时间窗口内,加入成交量确认) +// 做多条件检查(时间窗口内,加入成交量确认和SRBR过滤) check_long_conditions() => if not enable_advanced_alerts false @@ -1234,14 +1234,17 @@ check_long_conditions() => // 成交量确认(使用预先计算的结果) volume_confirm = enable_volume_filter ? long_volume_trend : true + // SRBR过滤确认(新增) + srbr_confirm = enable_srbr_filter ? srbr_bullish_signal : true + // 条件2(时间窗口,启动前后5分钟),1分钟时间周期下 - condition2_1m = in_time_window(long_trigger_time, time_window_5min) and rsi_overbought_1m and price_above_r1_1m and ma200_far_1m and ma50_above_mean_1m and volume_confirm + condition2_1m = in_time_window(long_trigger_time, time_window_5min) and rsi_overbought_1m and price_above_r1_1m and ma200_far_1m and ma50_above_mean_1m and volume_confirm and srbr_confirm // 条件3(时间窗口,启动前后15分钟),5分钟时间周期下 - condition3_5m = in_time_window(long_trigger_time, time_window_15min) and rsi_overbought_5m and price_above_mean_5m and ma200_far_5m and ma50_above_mean_5m and volume_confirm + condition3_5m = in_time_window(long_trigger_time, time_window_15min) and rsi_overbought_5m and price_above_mean_5m and ma200_far_5m and ma50_above_mean_5m and volume_confirm and srbr_confirm // 条件4(时间窗口,启动前后10分钟),15分钟时间周期下:S1和价格的距离> 阈值 - condition4_15m = in_time_window(long_trigger_time, time_window_10min) and distance_to_s1_15m > get_r1s1_distance_threshold() + condition4_15m = in_time_window(long_trigger_time, time_window_10min) and distance_to_s1_15m > get_r1s1_distance_threshold() and srbr_confirm // 根据配置决定是否需要所有条件都满足 conditions_met = require_all_conditions ? (condition2_1m and condition3_5m and condition4_15m) : (condition2_1m or condition3_5m or condition4_15m) @@ -1251,7 +1254,7 @@ check_long_conditions() => conditions_met and cooldown_ok -// 做空条件检查(时间窗口内,加入成交量确认) +// 做空条件检查(时间窗口内,加入成交量确认和SRBR过滤) check_short_conditions() => if not enable_advanced_alerts false @@ -1259,14 +1262,17 @@ check_short_conditions() => // 成交量确认(使用预先计算的结果) volume_confirm = enable_volume_filter ? short_volume_trend : true + // SRBR过滤确认(新增) + srbr_confirm = enable_srbr_filter ? srbr_bearish_signal : true + // 条件2(时间窗口,启动前后5分钟),1分钟时间周期下 - condition2_1m = in_time_window(short_trigger_time, time_window_5min) and rsi_oversold_1m and price_below_s1_1m and ma200_far_1m and ma50_below_mean_1m and volume_confirm + condition2_1m = in_time_window(short_trigger_time, time_window_5min) and rsi_oversold_1m and price_below_s1_1m and ma200_far_1m and ma50_below_mean_1m and volume_confirm and srbr_confirm // 条件3(时间窗口,启动前后15分钟),5分钟时间周期下 - condition3_5m = in_time_window(short_trigger_time, time_window_15min) and rsi_oversold_5m and price_below_mean_5m and ma200_far_5m and ma50_below_mean_5m and volume_confirm + condition3_5m = in_time_window(short_trigger_time, time_window_15min) and rsi_oversold_5m and price_below_mean_5m and ma200_far_5m and ma50_below_mean_5m and volume_confirm and srbr_confirm // 条件4(时间窗口,启动前后10分钟),15分钟时间周期下:R1和价格的距离> 阈值 - condition4_15m = in_time_window(short_trigger_time, time_window_10min) and distance_to_r1_15m > get_r1s1_distance_threshold() + condition4_15m = in_time_window(short_trigger_time, time_window_10min) and distance_to_r1_15m > get_r1s1_distance_threshold() and srbr_confirm // 根据配置决定是否需要所有条件都满足 conditions_met = require_all_conditions ? (condition2_1m and condition3_5m and condition4_15m) : (condition2_1m or condition3_5m or condition4_15m) @@ -1440,16 +1446,16 @@ plot(show_ma_lines ? ma200 : na, color=color.rgb(25, 58, 243), linewidth=4, titl //************************************************************************************************************ if show_info_table and barstate.islast - // 创建扩展的信息表格(包含高级警报状态和成交量信息) + // 创建扩展的信息表格(包含高级警报状态、成交量信息和SRBR信息) var table info_table = table.new( position = position.bottom_right, // 固定在右下角 - columns = 12, // 扩展为12列:原6列 + 高级警报4列 + 成交量2列 + columns = 13, // 扩展为13列:原6列 + 高级警报4列 + 成交量2列 + SRBR1列 rows = 4, // 4行:标题 + 数值 + 状态 + 信号 bgcolor = color.new(color.white, 85), border_width = 1) // 清空表格 - table.clear(info_table, 0, 0, 11, 3) + table.clear(info_table, 0, 0, 12, 3) // 获取配置的文字大小 text_size = get_text_size()