Hello, can you help me to drawsegment on the 1 hour time frame.
i need to drawsegment every hour, one for the high of each hour and one on the low of each hour. the lengh of the segment can be the barindex + 2 for example
So i need to declare the time frame to have the segment drawing on the lower time frame
timeframe(1 hour)
Example attached
Thank you
There you go:
ONCE Hbar = 0
ONCE TF = gettimeframe
ONCE Bars = 3600 / TF
ONCE HH = high
ONCE LL = LOW
ONCE HHp = high
ONCE LLp = low
IF TF <= 3600 THEN
IF OpenHour <> OpenHour[1] THEN
HBar = BarIndex
EndBar = HBar + Bars
HHp = HH
LLp = LL
HH = high
LL = low
ENDIF
HH = max(HH,high)
LL = min(LL,low)
DrawSegment(Hbar,HHp,EndBar,HHp) style(line,2) coloured("Blue",255)
DrawSegment(Hbar,LLp,EndBar,LLp) style(line,2) coloured("Red",255)
ENDIF
RETURN