NQ BOI | 3:55 PM High Low

Krisng2105 · study · 56 行 · 点赞 12 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//@version=6
indicator("NQ BOI | 3:55 PM High Low", overlay=true, max_lines_count=500)
 
tz = "America/New_York"
lineColor = color.gray
lineWidth = 1
 
// Get confirmed 3:55 PM candle from 5-minute timeframe
[h5, l5, t5] = request.security(
     syminfo.tickerid, "5",
     [high[1], low[1], time[1]],
     lookahead=barmerge.lookahead_on)
 
// Detect the first bar after the 3:55 candle closes
is355 = hour(t5, tz) == 15 and minute(t5, tz) == 55
new355 = is355 and (na(t5[1]) or t5 != t5[1])
 
var line highLine = na
var line lowLine = na
 
if new355
    startTime = t5
    endTime = startTime + 24 * 60 * 60 * 1000
 
    // Finish previous day's horizontal lines
    if not na(highLine)
        line.set_x2(highLine, startTime)
        line.set_x2(lowLine, startTime)
 
    // Horizontal High
    highLine := line.new(
         x1=startTime, y1=h5,
         x2=endTime, y2=h5,
         xloc=xloc.bar_time,
         color=lineColor, width=lineWidth)
 
    // Horizontal Low
    lowLine := line.new(
         x1=startTime, y1=l5,
         x2=endTime, y2=l5,
         xloc=xloc.bar_time,
         color=lineColor, width=lineWidth)
 
    // Vertical line at start
    line.new(
         x1=startTime, y1=h5,
         x2=startTime, y2=l5,
         xloc=xloc.bar_time,
         color=lineColor, width=lineWidth)
 
    // Vertical line at end
    line.new(
         x1=endTime, y1=h5,
         x2=endTime, y2=l5,
         xloc=xloc.bar_time,
         color=lineColor, width=lineWidth)

← 返回列表