I am looking for a way to draw a vertical line
at the beginning of each day when the new daily candle begins.
The line would need to be visible on the lower time frames
I think mt4 calls these period separators
and tradingview calls them session breaks
This will draw a vertical line each new day, but it’s not visible on lower TF’s (only PRT’s objects can):
IF (OpenTime = 000000) OR (OpenTime < OpenTime[1]) THEN
DRAWVLINE(BarIndex) coloured(0,0,255,255) //Blue
ENDIF
RETURN
Can this be modified to make it a weekly separator to use in 15m Timeframe?
Thanks
This can be used for all TFs lower then weekly:
IF OpenDayOfWeek < OpenDayOfWeek[1] THEN
DRAWVLINE(BarIndex) coloured(0,0,255,255) //Blue
ENDIF
RETURN
Can we make it Open at 9 am not 00000. Also is it possible to write the day of week like Monday at between these lines at bottom of screen?
There you go:
ONCE Offset = lowest[500](low)
IF OpenMonth <> OpenMonth[1] THEN
Offset = lowest[500](low)
ENDIF
IF (OpenTime = 090000) OR ((OpenTime > 090000) AND (OpenTime[1] < 090000)) THEN
DRAWVLINE(BarIndex) coloured("Blue",255)
IF OpenDayOfWeek = 0 THEN
DrawText("Sunday",BarIndex + 9,Offset,Dialog,Bold,10) coloured("Green",255)
ELSIF OpenDayOfWeek = 1 THEN
DrawText("Monday",BarIndex + 9,Offset,Dialog,Bold,10) coloured("Green",255)
ELSIF OpenDayOfWeek = 2 THEN
DrawText("Tuesday",BarIndex + 9,Offset,Dialog,Bold,10) coloured("Green",255)
ELSIF OpenDayOfWeek = 3 THEN
DrawText("Wednesday",BarIndex + 9,Offset,Dialog,Bold,10) coloured("Green",255)
ELSIF OpenDayOfWeek = 4 THEN
DrawText("Thursday",BarIndex + 9,Offset,Dialog,Bold,10) coloured("Green",255)
ELSIF OpenDayOfWeek = 5 THEN
DrawText("Friday",BarIndex + 9,Offset,Dialog,Bold,10) coloured("Green",255)
ELSIF OpenDayOfWeek = 6 THEN
DrawText("Saturday",BarIndex + 9,Offset,Dialog,Bold,10) coloured("Green",255)
ENDIF
ENDIF
RETURN