Daily Period Separator/Session Break

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #125746 quote
    John HenryJohn 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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    s00071609s00071609
    Participant
    Senior

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

     

    Thanks

    #199909 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    s00071609s00071609
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 robertogozzirobertogozzi
3 years, 3 months ago.

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