PROTECTED SOURCE SCRIPT

Compact Manual Execution Checklist + Session Boxes (Final)

32
//version=6
indicator("London & New York Market Open Lines", overlay=true)

// ==================================================
// MARKET OPEN TIME SETTINGS (CHART TIMEZONE)
// ==================================================
showLondonLine = input.bool(true, "Show London Open Line")
showNYLine = input.bool(true, "Show New York Open Line")

londonOpenTime = input.string("08:00", "London Open Time (HH:MM)")
nyOpenTime = input.string("13:00", "New York Open Time (HH:MM)")

// ==================================================
// LINE STYLE SETTINGS
// ==================================================
lineStyleInput = input.string(
"Dashed",
"Market Line Style",
options=["Solid", "Dashed", "Dotted"]
)

lineWidth = input.int(1, "Market Line Width", minval=1, maxval=4)

lineStyle =
lineStyleInput == "Dotted" ? line.style_dotted :
lineStyleInput == "Solid" ? line.style_solid :
line.style_dashed

// ==================================================
// TIME PARSING FUNCTION
// ==================================================
f_isMarketOpen(_timeStr) =>
hh = str.tonumber(str.substring(_timeStr, 0, 2))
mm = str.tonumber(str.substring(_timeStr, 3, 5))
hour == hh and minute == mm

// ==================================================
// LONDON MARKET OPEN LINE
// ==================================================
if showLondonLine and f_isMarketOpen(londonOpenTime)
line.new(
bar_index, low, bar_index, high,
extend=extend.both,
color=color.blue,
width=lineWidth,
style=lineStyle
)
label.new(
bar_index, high,
"LN OPEN",
style=label.style_label_down,
textcolor=color.white,
color=color.blue,
size=size.small
)

// ==================================================
// NEW YORK MARKET OPEN LINE
// ==================================================
if showNYLine and f_isMarketOpen(nyOpenTime)
line.new(
bar_index, low, bar_index, high,
extend=extend.both,
color=color.purple,
width=lineWidth,
style=lineStyle
)
label.new(
bar_index, high,
"NY OPEN",
style=label.style_label_down,
textcolor=color.white,
color=color.purple,
size=size.small
)

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.