Drawsegment to Highest/Lowest point

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #53387 quote
    margincallcatmargincallcat
    Participant
    Average

    Hi!

    I would like to draw segments to the specific tops and bottoms of the Highest[x](high) and lowest[x](low) points.

     

    As for now i have written this:

    toplookback=10
    hh=highest[toplookback](high)
    ll=lowest[toplookback](low)
    
    if high[1]=hh[1] then
    highy=hh[1]
    highx=barindex[1]
    endif
    if low[1]=ll[1] then
    lowy=ll[1]
    lowx=barindex[1]
    endif
    
    
    drawsegment(highx,highy,barindex,highy)
    drawsegment(lowx,lowy,barindex,lowy)

    but this only draws WHEN a specific high or low actually was the highest/lowest point so far.

     

    I cant get around how i would write if i want the segments to be drawn to the actual CURRENT highest/lowest points.

     

    So the issue is finding the x (or) barindex-values that tells probuilder where to draw the segments.

    #53682 quote
    NicolasNicolas
    Keymaster
    Legend

    If you want to draw only the last highest high and lowest low segments, just add this line at the top of your code:

    defparam drawonlastbaronly=true

     

    drawsegment-on-last-bar-only.png drawsegment-on-last-bar-only.png
Viewing 2 posts - 1 through 2 (of 2 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

Drawsegment to Highest/Lowest point


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
8 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/21/2017
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...