Daily Period Separator/Session Break

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #125746 quote
    John Henry
    Participant
    New

    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

    #145269 quote
    robertogozzi
    Moderator
    Master

    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
    #199906 quote
    s00071609
    Participant
    Senior

    Can this be modified to make it a weekly separator to use in 15m Timeframe?

     

    Thanks

    #199909 quote
    robertogozzi
    Moderator
    Master

    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
    #217101 quote
    s00071609
    Participant
    Senior

    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?

    #217133 quote
    robertogozzi
    Moderator
    Master

    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
    PLermite thanked this post
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Daily Period Separator/Session Break


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
John Henry @john-henry Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by robertogozzi
2 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/12/2020
Status: Active
Attachments: No files
Logo Logo
Loading...