2025年8月2日 06:09
This commit is contained in:
@@ -675,6 +675,10 @@ get_mtf_rsi(tf) =>
|
||||
rsi_mtf := request.security(syminfo.tickerid, tf, ma(ta.rsi(rsi_src, rsiLength), smoothP, maType, sig), lookahead=barmerge.lookahead_off)
|
||||
rsi_mtf
|
||||
|
||||
// 多时间框架SRBR计算函数
|
||||
get_mtf_srbr(tf) =>
|
||||
request.security(syminfo.tickerid, tf, calcSupportResistance(close, srbr_lookback_period), lookahead=barmerge.lookahead_off)
|
||||
|
||||
//************************************************************************************************************
|
||||
// 指标计算
|
||||
//************************************************************************************************************
|
||||
@@ -788,6 +792,8 @@ meanline_1m = mtf_1m ? request.security(syminfo.tickerid, "1", supersmoother(sou
|
||||
meanrange_1m = mtf_1m ? request.security(syminfo.tickerid, "1", supersmoother(ta.tr, length), lookahead=barmerge.lookahead_off) : na
|
||||
upband1_1m = mtf_1m and not na(meanline_1m) and not na(meanrange_1m) ? meanline_1m + meanrange_1m * (2 * math.asin(1) * innermult) : na
|
||||
loband1_1m = mtf_1m and not na(meanline_1m) and not na(meanrange_1m) ? meanline_1m - meanrange_1m * (2 * math.asin(1) * innermult) : na
|
||||
// SRBR 1分钟数据
|
||||
[srbr_supportLevel_1m, srbr_resistanceLevel_1m, srbr_brekout_res_1m, srbr_res_holds_1m, srbr_sup_holds_1m, srbr_brekout_sup_1m, srbr_vol_1m, srbr_vol_hi_1m, srbr_vol_lo_1m] = mtf_1m ? get_mtf_srbr("1") : [na, na, na, na, na, na, na, na, na]
|
||||
|
||||
// 5分钟数据
|
||||
rsi_5m = mtf_5m ? get_mtf_rsi("5") : na
|
||||
@@ -1607,16 +1613,16 @@ if show_info_table and barstate.islast
|
||||
|
||||
// ═════════ 多时间框架表格显示 ═════════
|
||||
if show_mtf_table and barstate.islast
|
||||
// 创建多时间框架表格(右上角)- 增加MEAN距离列
|
||||
// 创建多时间框架表格(右上角)- 增加MEAN距离列和SRBR列
|
||||
var table mtf_table = table.new(
|
||||
position = position.top_right,
|
||||
columns = 13, // 增加到13列:时间框架 + RSI + RSI状态 + 穿越次数 + 价格位置 + 价格MEAN位置 + MA50位置 + MA200距离 + MEAN距离 + R1距离 + S1距离 + 信号 + 判断
|
||||
columns = 14, // 增加到14列:时间框架 + RSI + RSI状态 + 穿越次数 + 价格位置 + 价格MEAN位置 + MA50位置 + MA200距离 + MEAN距离 + R1距离 + S1距离 + SRBR + 信号 + 判断
|
||||
rows = mtf_table_rows,
|
||||
bgcolor = color.new(color.white, 85),
|
||||
border_width = 1)
|
||||
|
||||
// 清空表格
|
||||
table.clear(mtf_table, 0, 0, 12, mtf_table_rows - 1)
|
||||
table.clear(mtf_table, 0, 0, 13, mtf_table_rows - 1)
|
||||
|
||||
// 获取配置的文字大小
|
||||
text_size = get_text_size()
|
||||
@@ -1636,8 +1642,9 @@ if show_mtf_table and barstate.islast
|
||||
table.cell(mtf_table, 8, 0, "MEAN距离", text_color=color.white, bgcolor=color.new(color.purple, 30), text_size=text_size)
|
||||
table.cell(mtf_table, 9, 0, "R1距离", text_color=color.white, bgcolor=color.new(color.purple, 30), text_size=text_size)
|
||||
table.cell(mtf_table, 10, 0, "S1距离", text_color=color.white, bgcolor=color.new(color.purple, 30), text_size=text_size)
|
||||
table.cell(mtf_table, 11, 0, "信号", text_color=color.white, bgcolor=color.new(color.purple, 30), text_size=text_size)
|
||||
table.cell(mtf_table, 12, 0, "判断", text_color=color.white, bgcolor=color.new(color.purple, 30), text_size=text_size)
|
||||
table.cell(mtf_table, 11, 0, "SRBR", text_color=color.white, bgcolor=color.new(color.maroon, 30), text_size=text_size)
|
||||
table.cell(mtf_table, 12, 0, "信号", text_color=color.white, bgcolor=color.new(color.purple, 30), text_size=text_size)
|
||||
table.cell(mtf_table, 13, 0, "判断", text_color=color.white, bgcolor=color.new(color.purple, 30), text_size=text_size)
|
||||
|
||||
// ═════════ 1分钟时间框架数据 ═════════
|
||||
if mtf_1m and not na(rsi_1m)
|
||||
|
||||
Reference in New Issue
Block a user