Current Week High and Low

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #128393 quote
    RiaanvN
    Participant
    Average

    Hi, I’m rubbish at coding. Please help with indicator?

    • Vertical line at Monday at 12am, signaling start of new week, accessible on all time frames.
    • Current week high and week low horizontal lines. Preferably accessible on all time frames, otherwise specific to 15 minutes and 1 hour.

    Thanks.

    #128394 quote
    Vonasi
    Moderator
    Master

    This indicator will do your second request.

    Yearly Quarterly Monthly Weekly Daily H4 H1 OHLC Lines – Last Bar Only Version

    EDIT: I just reread your question. This indicator actually does the last closed weeks levels are you wanting the current still forming weeks high and low?

    #128395 quote
    Vonasi
    Moderator
    Master

    This should do your first request:

    if opentime = 120000 and opendayofweek = 1 then 
    drawvline(barindex)
    endif
    #128397 quote
    robertogozzi
    Moderator
    Master

    Shouldn’t 12am be written as 000000?

    12pm is 120000.

    RiaanvN thanked this post
    #128398 quote
    Vonasi
    Moderator
    Master

    This should do what you want:

    if opentime = 000000 and opendayofweek = 1 then
    drawvline(barindex)
    endif
    
    if opendayofweek < opendayofweek[1] then
    hh=high
    ll=low
    endif
    
    hh = max(hh,high)
    ll = min(ll,low)
    
    return hh as "This weeks high", ll as "This weeks low"
    RiaanvN thanked this post
    #128399 quote
    Vonasi
    Moderator
    Master

    Shouldn’t 12am be written as 000000?

    12pm is 120000.

    Well spotted Roberto – I really shouldn’t scan read questions in a hurry to get to my cheese and tomato sandwich!

    RiaanvN thanked this post
    #128556 quote
    RiaanvN
    Participant
    Average

    Hi Guys, thanks for your assistance.

    Is it perhaps possible to draw segment of highs and lows for this week only, disregarding previous weeks?

    #128559 quote
    Vonasi
    Moderator
    Master

    That’s a bit tricky because we can’t delete drawn objects so the only way we can do that is to wait till the end of the week and then draw it which is not going to be any use during the week!

    It would be possible to just have it as two horizontal lines that move up and down though.

    In v11 it might be possible to create something using arrays that could do it but it would be quite a lot of work.

    #128622 quote
    RiaanvN
    Participant
    Average

    Ok. Thanks.

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

Current Week High and Low


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
RiaanvN @riaanvn Participant
Summary

This topic contains 8 replies,
has 3 voices, and was last updated by RiaanvN
5 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/27/2020
Status: Active
Attachments: No files
Logo Logo
Loading...