defparam drawonlastbaronly=true
once N=1 // number of digits displayed after coma
if opendayofweek[1]>opendayofweek then
barstart=barindex
WprevH=hh
WprevL=ll
Wrange=WprevH-WprevL
ll=low
hh=high
endif
ll=min(ll,low)
hh=max(hh,high)
DRAWSEGMENT(barstart, WprevH, barindex, WprevH) coloured(255,0,0)
DRAWSEGMENT(barstart, WprevL, barindex, WprevL) coloured(255,0,0)
DRAWTEXT("W Low #WprevL#", barindex, WprevL)
DRAWTEXT("W High #WprevH#", barindex, WprevH)
F382=round(WprevL+0.382*Wrange,N)
F618=round(WprevL+0.618*Wrange,N)
F1382=round(WprevL+1.382*Wrange,N)
F1618=round(WprevL+1.618*Wrange,N)
M382=round(WprevL-0.382*Wrange,N)
M618=round(WprevL-0.618*Wrange,N)
DRAWSEGMENT(barstart, F382, barindex, F382) coloured(255,0,0) style(dottedline,1)
DRAWSEGMENT(barstart, F618, barindex, F618) coloured(255,0,0) style(dottedline,1)
DRAWSEGMENT(barstart, F1382, barindex, F1382) coloured(255,0,0) style(dottedline,1)
DRAWSEGMENT(barstart, F1618, barindex, F1618) coloured(255,0,0) style(dottedline,1)
DRAWSEGMENT(barstart, M382, barindex, M382) coloured(255,0,0) style(dottedline,1)
DRAWSEGMENT(barstart, M618, barindex, M618) coloured(255,0,0) style(dottedline,1)
DRAWTEXT("W 38.2% #F382#", barindex, F382)
DRAWTEXT("W 61.8% #F618#", barindex, F618)
DRAWTEXT("W 138.2% #F1382#", barindex, F1382)
DRAWTEXT("W 161.8% #F1618#", barindex, F1618)
DRAWTEXT("W 38.2% #M382#", barindex, M382)
DRAWTEXT("W 61.8% #M618#", barindex, M618)
return