本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=5
indicator('PumpC Opening Range Breakout (ORB) Stretch Range', shorttitle='PumpC Stretch ORB', overlay=true)
// === ⚙️ ORB_Stretch Setup ===
custom_timeframe = input.timeframe("D", "Stretch Timeframe")
Stretch_length = input(10, "stretch Length")
// === 📂 Level Settings: Individual Show/Multiplier/Color Inputs
group_levels = "Stretch Levels"
// === 🎨 ORB Open Line Color
color_ORB_Open = input.color(color.green, "ORB Open", inline="CurrentOpen", group=group_levels)
show_level_1 = input(true, "ORB Stretch Range", inline="lvl1", group=group_levels)
mult_level_1 = 1.0
color_level_1_plus = input.color(color.black, "+ORB", inline="lvl1", group=group_levels)
color_level_1_minus = input.color(color.black, "-ORB", inline="lvl1", group=group_levels)
show_level_2 = input(true, "Level 2", inline="lvl2", group=group_levels)
mult_level_2 = input.float(0.382, "", step=0.01, inline="lvl2", group=group_levels)
color_level_2_plus = input.color(color.gray, "+", inline="lvl2", group=group_levels)
color_level_2_minus = input.color(color.gray, "-", inline="lvl2", group=group_levels)
show_level_3 = input(false, "Level 3", inline="lvl3", group=group_levels)
mult_level_3 = input.float(1.5, "", step=0.01, inline="lvl3", group=group_levels)
color_level_3_plus = input.color(color.gray, "+", inline="lvl3", group=group_levels)
color_level_3_minus = input.color(color.gray, "-", inline="lvl3", group=group_levels)
show_level_4 = input(true, "Level 4", inline="lvl4", group=group_levels)
mult_level_4 = input.float(2.0, "", step=0.01, inline="lvl4", group=group_levels)
color_level_4_plus = input.color(color.gray, "+", inline="lvl4", group=group_levels)
color_level_4_minus = input.color(color.gray, "-", inline="lvl4", group=group_levels)
show_level_5 = input(false, "Level 5", inline="lvl5", group=group_levels)
mult_level_5 = input.float(2.5, "", step=0.01, inline="lvl5", group=group_levels)
color_level_5_plus = input.color(color.gray, "+", inline="lvl5", group=group_levels)
color_level_5_minus = input.color(color.gray, "-", inline="lvl5", group=group_levels)
// === 📈 Data Source
ORB_Open = request.security(syminfo.tickerid, custom_timeframe, open, gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)
stretch_min_range = request.security(syminfo.tickerid, custom_timeframe, ta.sma(math.min(open - low, high - open), Stretch_length), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)
// === ⚪ ORB Open Line
plot(ORB_Open, color=color_ORB_Open, title="ORB Open", linewidth=1, style=plot.style_circles)
// === 📊 Plot ORB_Stretch Levels
plot(show_level_1 ? ORB_Open + stretch_min_range * mult_level_1 : na, color=color_level_1_plus, title="+ORB Range", linewidth=2, style=plot.style_circles)
plot(show_level_1 ? ORB_Open - stretch_min_range * mult_level_1 : na, color=color_level_1_minus, title="-ORB Range", linewidth=2, style=plot.style_circles)
plot(show_level_2 ? ORB_Open + stretch_min_range * mult_level_2 : na, color=color_level_2_plus, title="+Level 2", linewidth=2, style=plot.style_circles)
plot(show_level_2 ? ORB_Open - stretch_min_range * mult_level_2 : na, color=color_level_2_minus, title="-Level 2", linewidth=2, style=plot.style_circles)
plot(show_level_3 ? ORB_Open + stretch_min_range * mult_level_3 : na, color=color_level_3_plus, title="+Level 3", linewidth=2, style=plot.style_circles)
plot(show_level_3 ? ORB_Open - stretch_min_range * mult_level_3 : na, color=color_level_3_minus, title="-Level 3", linewidth=2, style=plot.style_circles)
plot(show_level_4 ? ORB_Open + stretch_min_range * mult_level_4 : na, color=color_level_4_plus, title="+Level 4", linewidth=2, style=plot.style_circles)
plot(show_level_4 ? ORB_Open - stretch_min_range * mult_level_4 : na, color=color_level_4_minus, title="-Level 4", linewidth=2, style=plot.style_circles)
plot(show_level_5 ? ORB_Open + stretch_min_range * mult_level_5 : na, color=color_level_5_plus, title="+Level 5", linewidth=2, style=plot.style_circles)
plot(show_level_5 ? ORB_Open - stretch_min_range * mult_level_5 : na, color=color_level_5_minus, title="-Level 5", linewidth=2, style=plot.style_circles)