INVITE-ONLY SCRIPT
Daily SD (200 pips/level)

//version=6
indicator("Daily SD (200 pips/level)", overlay=true, max_lines_count=200, max_labels_count=200)
// Inputs
pipSize = input.float(0.1, "Pip Size", step=0.0001) // 1 pip = 0.1 (เช่น XAUUSD หลายโบรก)
pipsPerSD = input.int(200, "Pips per SD", minval=1) // 200 pips ต่อระดับ
sdCount = input.int(5, "Number of SD levels", minval=1, maxval=10)
showLbl = input.bool(true, "Show labels")
showMid = input.bool(true, "Show daily-open midline")
// Derived
step = pipsPerSD * pipSize
// Daily open (intraday-safe)
dayOpen = request.security(syminfo.tickerid, "D", open, lookahead=barmerge.lookahead_on)
// Detect new day safely (store change result in a variable and coerce to bool)
dayTime = time("D")
dayTimeDiff = ta.change(dayTime) // series int
isNewDay = dayTimeDiff != 0 // series bool
// Rebuild condition
rebuild = barstate.isfirst or isNewDay
// Storage
var line[] lines = array.new_line()
var label[] labels = array.new_label()
if rebuild
// Clear previous drawings
while array.size(lines) > 0
line.delete(array.pop(lines))
while array.size(labels) > 0
label.delete(array.pop(labels))
// Midline
if showMid
m = line.new(bar_index, dayOpen, bar_index + 1, dayOpen, xloc=xloc.bar_index, extend=extend.right, color=color.gray, width=2)
array.push(lines, m)
if showLbl
ml = label.new(bar_index, dayOpen, "Open", style=label.style_label_left, textcolor=color.white, color=color.gray)
array.push(labels, ml)
// ±SD levels
for i = 1 to sdCount
up = dayOpen + step * i
dn = dayOpen - step * i
lu = line.new(bar_index, up, bar_index + 1, up, xloc=xloc.bar_index, extend=extend.right, color=color.teal, style=line.style_dotted)
ld = line.new(bar_index, dn, bar_index + 1, dn, xloc=xloc.bar_index, extend=extend.right, color=color.orange, style=line.style_dotted)
array.push(lines, lu)
array.push(lines, ld)
if showLbl
lbu = label.new(bar_index, up, "+SD" + str.tostring(i), style=label.style_label_left, textcolor=color.white, color=color.teal)
lbd = label.new(bar_index, dn, "-SD" + str.tostring(i), style=label.style_label_left, textcolor=color.white, color=color.orange)
array.push(labels, lbu)
array.push(labels, lbd)
indicator("Daily SD (200 pips/level)", overlay=true, max_lines_count=200, max_labels_count=200)
// Inputs
pipSize = input.float(0.1, "Pip Size", step=0.0001) // 1 pip = 0.1 (เช่น XAUUSD หลายโบรก)
pipsPerSD = input.int(200, "Pips per SD", minval=1) // 200 pips ต่อระดับ
sdCount = input.int(5, "Number of SD levels", minval=1, maxval=10)
showLbl = input.bool(true, "Show labels")
showMid = input.bool(true, "Show daily-open midline")
// Derived
step = pipsPerSD * pipSize
// Daily open (intraday-safe)
dayOpen = request.security(syminfo.tickerid, "D", open, lookahead=barmerge.lookahead_on)
// Detect new day safely (store change result in a variable and coerce to bool)
dayTime = time("D")
dayTimeDiff = ta.change(dayTime) // series int
isNewDay = dayTimeDiff != 0 // series bool
// Rebuild condition
rebuild = barstate.isfirst or isNewDay
// Storage
var line[] lines = array.new_line()
var label[] labels = array.new_label()
if rebuild
// Clear previous drawings
while array.size(lines) > 0
line.delete(array.pop(lines))
while array.size(labels) > 0
label.delete(array.pop(labels))
// Midline
if showMid
m = line.new(bar_index, dayOpen, bar_index + 1, dayOpen, xloc=xloc.bar_index, extend=extend.right, color=color.gray, width=2)
array.push(lines, m)
if showLbl
ml = label.new(bar_index, dayOpen, "Open", style=label.style_label_left, textcolor=color.white, color=color.gray)
array.push(labels, ml)
// ±SD levels
for i = 1 to sdCount
up = dayOpen + step * i
dn = dayOpen - step * i
lu = line.new(bar_index, up, bar_index + 1, up, xloc=xloc.bar_index, extend=extend.right, color=color.teal, style=line.style_dotted)
ld = line.new(bar_index, dn, bar_index + 1, dn, xloc=xloc.bar_index, extend=extend.right, color=color.orange, style=line.style_dotted)
array.push(lines, lu)
array.push(lines, ld)
if showLbl
lbu = label.new(bar_index, up, "+SD" + str.tostring(i), style=label.style_label_left, textcolor=color.white, color=color.teal)
lbd = label.new(bar_index, dn, "-SD" + str.tostring(i), style=label.style_label_left, textcolor=color.white, color=color.orange)
array.push(labels, lbu)
array.push(labels, lbd)
초대 전용 스크립트
이 스크립트는 작성자가 승인한 사용자만 접근할 수 있습니다. 사용하려면 요청을 보내고 승인을 받아야 합니다. 일반적으로 결제 후에 승인이 이루어집니다. 자세한 내용은 아래 작성자의 지침을 따르거나 View_Yui에게 직접 문의하세요.
트레이딩뷰는 스크립트 작성자를 완전히 신뢰하고 스크립트 작동 방식을 이해하지 않는 한 스크립트 비용을 지불하거나 사용하지 않는 것을 권장하지 않습니다. 무료 오픈소스 대체 스크립트는 커뮤니티 스크립트에서 찾을 수 있습니다.
작성자 지시 사항
DDDDDDMAKDDDDDDD
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
초대 전용 스크립트
이 스크립트는 작성자가 승인한 사용자만 접근할 수 있습니다. 사용하려면 요청을 보내고 승인을 받아야 합니다. 일반적으로 결제 후에 승인이 이루어집니다. 자세한 내용은 아래 작성자의 지침을 따르거나 View_Yui에게 직접 문의하세요.
트레이딩뷰는 스크립트 작성자를 완전히 신뢰하고 스크립트 작동 방식을 이해하지 않는 한 스크립트 비용을 지불하거나 사용하지 않는 것을 권장하지 않습니다. 무료 오픈소스 대체 스크립트는 커뮤니티 스크립트에서 찾을 수 있습니다.
작성자 지시 사항
DDDDDDMAKDDDDDDD
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.