Draw segment on Low and High

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #214094 quote
    Kole96Kole96
    Participant
    New

    Hello, can you help me to drawsegment on the 1 hour time frame.

    i need to drawsegment every hour, one for the high of each hour and one on the low of each hour.  the lengh of the segment can be the barindex + 2 for example

    So i need to declare the time frame to have the segment drawing on the lower time frame

    timeframe(1 hour)

    Example attached

    Thank you

    1H-segment.png 1H-segment.png
    #214102 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    ONCE Hbar = 0
    ONCE TF   = gettimeframe
    ONCE Bars = 3600 / TF
    ONCE HH   = high
    ONCE LL   = LOW
    ONCE HHp  = high
    ONCE LLp  = low
    IF TF <= 3600 THEN
       IF OpenHour <> OpenHour[1] THEN
          HBar   = BarIndex
          EndBar = HBar + Bars
          HHp    = HH
          LLp    = LL
          HH     = high
          LL     = low
       ENDIF
       HH = max(HH,high)
       LL = min(LL,low)
       DrawSegment(Hbar,HHp,EndBar,HHp) style(line,2) coloured("Blue",255)
       DrawSegment(Hbar,LLp,EndBar,LLp) style(line,2) coloured("Red",255)
    ENDIF
    RETURN
    #214119 quote
    Kole96Kole96
    Participant
    New

    Thank you

Viewing 3 posts - 1 through 3 (of 3 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

Draw segment on Low and High


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Kole96 @kole96 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/03/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...