DefParam DrawOnLastBarOnly = true
debut, fin = CALL "Horaires Ouverture"[DAX,NASDAQ]
if DAX THEN
start = 173000
end = 090000
start2 = 085500
start3 = 090000
end2 = 173000
ENDIF
if NASDAQ THEN
start = 220000
end = 153000
start2 = 152500
start3 = 153000
end2 = 220000
ENDIF
tc = time>=start or time<end
if tc then
if not tc[1] then
i=i+1
$y1[i]=high
$z1[i]=low
hh = High
endif
if time = start THEN
$x1[i]=barindex
ENDIF
if time = end2 THEN
$x3[i]=barindex
ENDIF
hh = max(high,hh)
$y1[i]=max(high,$y1[i])
$z1[i]=min(low,$z1[i])
endif
tc2 = time>=start2 or time<end2
if tc2 and not tc2[1] then
i=i+1
$x1[i]=barindex
endif
if tc2 then
$x3[i]=barindex
endif
if islastbarupdate then
for y = 1 to i do
DRAWSEGMENT($x1[y],$y1[y],$x3[y],$y1[y]) STYLE(LINE ,2)coloured(200,100,100)
DRAWTEXT("Plus Haut (HM)",$x3[y],$y1[y]+1,SansSerif,Bold,11) coloured(200,100,100)
DRAWSEGMENT($x1[y],$z1[y],$x3[y],$z1[y]) STYLE(LINE ,2)coloured(200,100,100)
DRAWTEXT("Plus Bas (HM)",$x3[y],$z1[y]-1,SansSerif,Bold,11) coloured(200,100,100)
NEXT
ENDIF
return