Use previous day’s high/low

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #197894 quote
    RazzRazz
    Participant
    Master

    I often use boxing, but I don’t know how to reach how I can if the course eg. above the previous day’s low of the box can color the chart background. In advance thanks for your help

    //____________________________________
    
    Starttime1 = 090000
    if time = starttime1 then
    startbar1 = barindex
    endif
    
    //____________________________________
    
    // --- init
    alpha = max(alpha,0)
    alpha = min(alpha,255)
    // --- end
    
    starttime = 090500
    endtime = 093000
    
    if time = starttime then
    startbar = barindex
    endif
    If Time = 090500 then
    Ops=open
    endif
    if time = endtime then
    endbar = barindex
    endif
    
    if time >= starttime and time <= endtime then
    if high > hh then
    hh = high
    endif
    if low < ll or ll = 0 then
    ll = low
    endif
    endif
    
    if intradaybarindex = 0 then
    hh = 0
    ll = 0
    endif
    
    if date = today and time = endtime then 
    upper = highest[6](high) // Frame 12 = 5 min Chart
    lower = lowest[6](low)
    op = close
    dif = round(abs(upper-lower))
    OMitte    = upper-(dif/4)
    Mitte     = upper-(dif/2)
    UMitte    = lower+(dif/4)
    
    elsif info = 1 and Time > endtime then
    DrawText("#dif#Punkte",startbar+HL,upper+(delta+HLH+8),SansSerif,Standard,14) coloured(255,255,255)
    DrawText("#hh#",startbar+HL,upper+(delta+HLH),SansSerif,Standard,14) coloured(0,255,255)
    DrawText("#ll#",startbar+HL,lower-(delta+HLH),SansSerif,Standard,14) coloured(0,255,255)
    DrawRectangle(startbar,hh,endbar,ll) coloured(255,255,255,50)bordercolor(0,0,0,0)  
    endif
    
    
    return
    #197907 quote
    RazzRazz
    Participant
    Master

    Maybe I didn’t make myself clear, I want to use the low and high of the previous day’s box (upper/lower) is that possible?

    #197949 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    The previous day range can be defined this way:

    Timeframe(Daily,UpdateOnClose)
    HH = high
    LL = low

    or this way:

    HH = Dhigh(1)
    LL = Dlow(1)

    hen you can use HH as the upper limit and LL as the lower limit.

    #197952 quote
    RazzRazz
    Participant
    Master

    Hello Robertogozzi Unfortunately that is not the solution. I would like to see the high and low of the 09:00-10:00 candle from the previous day, for example. I can achieve this with upper[1] and lower[1] in the above code, but as soon as the box is drawn on today, the display snaps to today’s new value.

    Anzeige-Vortag.jpg Anzeige-Vortag.jpg
    #197961 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Then you have to use this code:

    IF Time = 090000 THEN
       PrevHH = HH
       PrevLL = LL
       HH     = high
       LL     = low
    ENDIF
    IF Time > 090000 AND Time <=100000 THEN
       HH = max(HH,high)
       LL = min(LL,low)
    ENDIF

    use PrevHH and PrevLL as the Upper and Lower values of the previous day.

    Razz thanked this post
    #197999 quote
    RazzRazz
    Participant
    Master

    Hello Robertogozzi You have been a great help once again Thank you! What would I do without you 😉

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

Use previous day’s high/low


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Razz @razz Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/25/2022
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...