Show Horizontal Line for last high and low

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #177330 quote
    eckertheckerth
    Participant
    New

    Hi

    would like to add horizontal lines for

    • last day High (yhigh)
    • last day low (ylow)
    • day before last high (yy high)
    • day before last low (yy low)

    anyone programmed this already ?

    any clues how to solve this ?

     

    thx

    t

    #177331 quote
    eckertheckerth
    Participant
    New

    Hi

    here my first attempt, but I can’t see any line…

     

    // shows line for last 2 days high and low
    DEFPARAM DRAWONLASTBARONLY = true

    R = 0
    V = 255
    B = 255
    a = 0

    DRAWHLINE(DHigh(1))//Coloured(R,V,B,a)
    DRAWHLINE(DLow(1))//Coloured(R,V,B,a)
    DRAWHLINE(DHigh(2))//Coloured(R,V,B,a)
    DRAWHLINE(DLow(2))//Coloured(R,V,B,a)

    Return

    #177333 quote
    phoentzsphoentzs
    Participant
    Master

    Several of my strategies are based on this logic and work quite well. In many different markets.

    eckerth thanked this post
    #177334 quote
    eckertheckerth
    Participant
    New

    HI @phoentzs

    but how did you program this into the chart ?

    thx

    t

    #177335 quote
    phoentzsphoentzs
    Participant
    Master

    Draw in yourself if you want to see it or … there is an indicator somewhere in the library that does that. I don’t know exactly which one, I’m on the phone. Just look for Dhigh.

    #177336 quote
    eckertheckerth
    Participant
    New

    HI

    think I got it

    // shows line for last 2 days high and low
    DEFPARAM DRAWONLASTBARONLY = true
    
    R = 0
    V = 255
    B = 204
    a = 255
    LStyle = 1
    LThickness = 3
    
    // Day of week 1 is monday, 2 Tuesday
    // DHigh does not work on weekends (it seems)
    If DayOfWeek = 1 then
    LookBack = 3
    Elsif dayofweek = 6 then
    lookback = 1
    elsif dayofweek = 7 then
    lookback = 2
    Else
    LookBack = 1
    Endif
    
    DRAWHLINE(DHigh(lookback)) Coloured(R,V,B,a)
    DRAWHLINE(DLow(lookback)) Coloured(R,V,B,a)
    DRAWHLINE(DHigh(lookback+1)) Coloured(R,V,B,a)
    DRAWHLINE(DLow(lookback+1)) Coloured(R,V,B,a)
    
    Return
    Nicolas 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

Show Horizontal Line for last high and low


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
eckerth @eckerth Participant
Summary

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

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