High/Low/Close previous day with time

Viewing 15 posts - 1 through 15 (of 34 total)
  • Author
    Posts
  • #144487 quote
    Friend
    Participant
    Average

    Hi guys,

     

    Will you be so kind to make an indicator that shows:

     

    high (blue) / low (blue) / close (yellow) of the previous day 

    with Monday showing the previous Friday

    with time setting (for example from 09.00 – 17.35 hours)

    for use in intraday charts

     

    Thank you in advance!

    #144497 quote
    Vonasi
    Moderator
    Master
    #144518 quote
    Friend
    Participant
    Average

    I had already noticed this one, an impressive indicator.

    The only thing missing are the time settings.

    I use 24-hour charts, but I would like to see the high / low / close of the opening hours, the cashtrade business.

     

    Can this be added?

    #144530 quote
    Zigo
    Participant
    Master
    // For Friend (Zigo)
    defparam drawonlastbaronly = true
    
    if intradaybarindex >1 then
    DRAWHLINE(Dhigh(1))coloured(0,125,255,255)
    DRAWHLINE(Dlow(1))coloured(0,125,255,255)
    DRAWHLINE(Dclose(1))coloured(255,255,0,255)
    endif
    return
    #144534 quote
    Friend
    Participant
    Average

    Thank you Zigo,

     

    But this doesn’t solve what I asked above, the time settings

    #144540 quote
    Nicolas
    Keymaster
    Master
    #144684 quote
    Friend
    Participant
    Average

    I’m sorry, this is not what I’m looking for

    #144698 quote
    robertogozzi
    Moderator
    Master

    Try this one:

    ONCE FromD = 090000
    ONCE ToD   = 160000
    ONCE CurC  = close
    ONCE PrevC = close
    ONCE CurH  = high
    ONCE PrevH = high
    ONCE CurL  = low
    ONCE PrevL = low
    dCond      = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
    tCond      = OpenTime >= FromD AND OpenTime <= ToD
    IF OpenDay <> OpenDay[1] THEN
       IF dCond THEN
          PrevC = CurC
          PrevH = CurH
          PrevL = CurL
          CurH  = high
          CurL  = low
          CurC  = close
       ENDIF
    ENDIF
    IF dCond AND tCond THEN
       CurC = close
       CurL = min(CurL,low)
       CurH = max(CurH,high)
    ENDIF
    RETURN PrevC coloured(238,238,0,255) AS "close",PrevH coloured(0,0,255,255) AS "high",PrevL coloured(0,0,255,255) AS "low
    #144748 quote
    Friend
    Participant
    Average

    Mille grazie, Roberto!

    This is exactly what I meant

    robertogozzi thanked this post
    #144763 quote
    robertogozzi
    Moderator
    Master

    After reading again my indicator, I spotted a logical error that makes it not as accurate due to incorrect time detection, this is correct:

    ONCE FromD = 090000
    ONCE ToD   = 160000
    ONCE CurC  = close
    ONCE PrevC = close
    ONCE CurH  = high
    ONCE PrevH = high
    ONCE CurL  = low
    ONCE PrevL = low
    dCond      = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
    tCond      = OpenTime >= FromD AND OpenTime <= ToD
    IF OpenDay <> OpenDay[1] THEN
       PrevC = CurC
       PrevH = CurH
       PrevL = CurL
       CurH  = 0
       CurL  = 999999
       CurC  = 0
    ENDIF
    IF dCond AND tCond THEN
       CurC = close
       CurL = min(CurL,low)
       CurH = max(CurH,high)
    ENDIF
    RETURN PrevC coloured(238,238,0,255) AS "close",PrevH coloured(0,0,255,255) AS "high",PrevL coloured(0,0,255,255) AS "low
    Nobody and Bel thanked this post
    #144778 quote
    Friend
    Participant
    Average

    Thanks again, Roberto

    #178822 quote
    JMat45
    Participant
    Senior

    Hi, coming in late to this thread. Thank you so much for this. Just one question – how would you modify the code to add in the previous day’s Open (@ 8.00am UK time)? Thanks.

    #178826 quote
    robertogozzi
    Moderator
    Master

    There you go:

    ONCE FromD = 090000
    ONCE ToD   = 160000
    ONCE CurC  = close
    ONCE PrevC = close
    ONCE CurH  = high
    ONCE PrevH = high
    ONCE CurL  = low
    ONCE PrevL = low
    ONCE CurO  = open
    ONCE PrevO = open
    dCond      = (OpenDayOfWeek >= 1 AND OpenDayOfWeek <= 5)
    tCond      = OpenTime >= FromD AND OpenTime <= ToD
    IF OpenDay <> OpenDay[1] THEN
       PrevC = CurC
       PrevH = CurH
       PrevL = CurL
       PrevO = CurO
       CurH  = open
       CurL  = open
       CurO  = open
       //CurC  = close
    ENDIF
    IF dCond AND tCond THEN
       IF CurL = CurO THEN
          CurL = low
          CurH = high
       ENDIF
       CurC = close
       CurL = min(CurL,low)
       CurH = max(CurH,high)
    ENDIF
    RETURN PrevC coloured(238,238,0,255) AS "close",PrevH coloured(0,0,255,255) AS "high",PrevL coloured(0,0,255,255) AS "low",PrevO coloured(0,255,255,255) AS "open"
    JMat45 and Tom.J thanked this post
    #179411 quote
    JMat45
    Participant
    Senior

    am getting some funny results with the above. Shouldn’t it be

    CurH  = high
    CurL  = low
    CurO  = close

    in lines 18-20? Thanks

    #179423 quote
    robertogozzi
    Moderator
    Master

    You need that at line 24 to detect when it all needs to start.
    It just ignores any value prior to the starting time.

Viewing 15 posts - 1 through 15 (of 34 total)
  • You must be logged in to reply to this topic.

High/Low/Close previous day with time


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Friend @friend Participant
Summary

This topic contains 33 replies,
has 8 voices, and was last updated by Tom.J
3 years, 2 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/17/2020
Status: Active
Attachments: 6 files
Logo Logo
Loading...