예스스탁
예스스탁 답변
2025-09-09 09:31:56
안녕하세요
예스스탁입니다.
input : Startlondonkz(033000);
input : Endlondonkz(054500);
input : Startnewyorkkz(083000);
input : Endnewyorkkz(104500);
input : boxheight(5.0);
var : ph(0),pl(0),dayrange(0),high2(0),low2(0);
var : d1(0),t1(0),tl1(0),tl2(0);
var : tf1(False),b1(0),sd1(0),st1(0),ed1(0),et1(0),box1(0);
var : tf2(False),b2(0),sd2(0),st2(0),ed2(0),et2(0),box2(0);
ph = DayHigh;
pl = DayLow;
dayrange = ph - pl;
high2 = ph + (dayrange * 0.01 * boxheight);
low2 = pl - (dayrange * 0.01 * boxheight);
if Bdate != Bdate[1] Then
{
d1 = sDate;
t1 = sTime;
tl1 = TL_New(d1,t1,ph,NextBarSdate,NextBarStime,ph);
tl2 = TL_New(d1,t1,pl,NextBarSdate,NextBarStime,pl);
TL_SetColor(tl1,Gray);
TL_SetColor(tl2,Gray);
}
TL_SetBegin(tl1,d1,t1,ph);
TL_SetBegin(tl2,d1,t1,pl);
TL_SetEnd(tl1,NextBarSdate,NextBarStime,ph);
TL_SetEnd(tl2,NextBarSdate,NextBarStime,pl);
if (sdate != sDate[1] and sTime >= Startlondonkz) or
(sdate == sDate[1] and sTime >= Startlondonkz and sTime[1] < Startlondonkz) Then
{
tf1 = true;
b1 = Bdate;
sd1 = sDate;
st1 = sTime;
box1 = Box_New(sd1,st1,high2,NextBarSdate,NextBarStime,low2);
Box_SetColor(box1,Yellow);
Box_SetFill(box1,true);
}
if (sdate != sDate[1] and sTime >= Endlondonkz) or
(sdate == sDate[1] and sTime >= Endlondonkz and sTime[1] < Endlondonkz) Then
{
tf1 = False;
}
if Bdate == b1 Then
{
if tf1 == true Then
{
ed1 = NextBarSdate;
et1 = NextBarStime;
}
Box_SetBegin(box1,sd1,st1,high2);
Box_SetEnd(box1,ed1,et1,low2);
}
if (sdate != sDate[1] and sTime >= Startnewyorkkz) or
(sdate == sDate[1] and sTime >= Startnewyorkkz and sTime[1] < Startnewyorkkz) Then
{
tf2 = true;
b2 = Bdate;
sd2 = sDate;
st2 = sTime;
box2 = Box_New(sd2,st2,high2,NextBarSdate,NextBarStime,low2);
Box_SetColor(box2,Green);
Box_SetFill(box2,true);
}
if (sdate != sDate[1] and sTime >= Endnewyorkkz) or
(sdate == sDate[1] and sTime >= Endnewyorkkz and sTime[1] < Endnewyorkkz) Then
{
tf2 = False;
}
if Bdate == b2 Then
{
if tf2 == true Then
{
ed2 = NextBarSdate;
et2 = NextBarStime;
}
Box_SetBegin(box2,sd2,st2,high2);
Box_SetEnd(box2,ed2,et2,low2);
}
즐거운 하루되세요
> 레전드 님이 쓴 글입니다.
> 제목 : 문의
> //@version=2
// Created By BryceWH
// Plots London Open Killzone and New York Open KZ as overlay boxes using current daily high / lows
// Fills can be turned on and off. Created this indicator because i didnt like highlighting the whole chart background as seen in other ICT KZ indicators on tradingview and wanted something cleaner.
// If you want additional killzones such as london/new york close add the indicator to the chart twice.
// Adapted from Chris Moody's original indicator HLOC
study(title="KZ Boxes", shorttitle="KZ Boxes", overlay=true)
st = true
shl = input(true, title="Show High / Low")
londonkz = input(title="KillZone London Open", type=session, defval="0330-0545")
newyorkkz = input(title="KillZone NY Open", type=session, defval="0830-1045")
colourcheck = 1.0
boxheight = input(title="Box Height", type=float, defval=5.0)
fillcheck = input(true, title="Fill Middle")
ph = security(tickerid, 'D', high)
pl = security(tickerid, 'D', low)
dayrange = ph - pl
high2 = ph + (dayrange * 0.01 * boxheight)
low2 = pl - (dayrange * 0.01 * boxheight)
BarInSession(sess) => time(period, sess) != 0
lineColour = colourcheck == 1 ? #E1BC29 : colourcheck == 2 ? #3BB273 : na // box colour
lineColour2 = colourcheck == 2 ? #E1BC29 : colourcheck == 1 ? #3BB273 : na // box colour
lineColour3 = colourcheck == 2 and fillcheck ? #E1BC29 : colourcheck == 1 and fillcheck ? #3BB273 : white // box colour
lineColour4 = colourcheck == 1 and fillcheck ? #E1BC29 : colourcheck == 2 and fillcheck ? #3BB273 : white // box colour
//DAILY
v5=plot(shl and ph ? ph : na, title="Daily High", style=circles, linewidth=2, color=gray) // daily high low plots
v6=plot(shl and pl ? pl : na, title="Daily Low", style=circles, linewidth=2, color=gray) // daily high low plots
//LONDON
varhigh2=plot(st and ph and BarInSession(londonkz) ? high2 : na, title="Box 1 High", style=linebr, linewidth=2, color=na) // change color=na to color to make these lines visible/editable
varhigh=plot(st and ph and BarInSession(londonkz) ? ph : na, title="Box 1 Low", style=linebr, linewidth=2, color=na) // change color=na to color to make these lines visible/editable
varlow=plot(st and pl and BarInSession(londonkz) ? pl : na, title="Box 2 High", style=linebr, linewidth=2, color=na) // change color=na to color to make these lines visible/editable
varlow2=plot(st and pl and BarInSession(londonkz) ? low2 : na, title="Box 2 Low", style=linebr, linewidth=2, color=na) // change color=na to color to make these lines visible/editable
fill(varhigh,varhigh2,color=lineColour, title="Fill Box 1", transp=25) // box 1 top fill
fill(varhigh,varlow,color=lineColour4, title="Fill Middle", transp=75) // fill between first killzone boxes
fill(varlow,varlow2,color=lineColour, title="Fill Box 2", transp=25) // box 2 top fill
//NEW YORK
v1=plot(st and ph and BarInSession(newyorkkz) ? high2 : na, title="Box 3 High", style=linebr, linewidth=2, color=na)
v2=plot(st and ph and BarInSession(newyorkkz) ? ph : na, title="Box 3 Low", style=linebr, linewidth=2, color=na)
v3=plot(st and pl and BarInSession(newyorkkz) ? pl : na, title="Box 4 High", style=linebr, linewidth=2, color=na)
v4=plot(st and pl and BarInSession(newyorkkz) ? low2 : na, title="Box 4 Low", style=linebr, linewidth=2, color=na)
fill(v1,v2,color=lineColour2, title="Fill Box 1", transp=25)
fill(v2,v3,color=lineColour3, title="Fill Middle", transp=85)
fill(v3,v4,color=lineColour2, title="Fill Box 2", transp=25)
예스로 부탁드립니다