How to define a range (and add a pip) – Help Wanted!

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #103296 quote
    Kevin Newton
    Participant
    New

    Hi All,

    Apologies in advance for the noob question but I’ve tried to find the answer to this and can’t!

    Can anyone tell me how to define a range as the 12x 5m candles opening from 07:00 to 07:55.

    This needs to happen upon the close of the 07:55 candle (ie at 8am).

    Oh, I’d also like to add +1 pip to the high, and -1 pip from the low of the range, if this is possible?

     

    Thanks in advance,

    Kev

    #103300 quote
    robertogozzi
    Moderator
    Master

    Try this (not tested):

    IF OpenTime = 070000 THEN
       MaxRange = high
       MinRange = low
    ENDIF
    IF OpenTime >= 070000 AND OpenTime <= 075500 THEN
       MaxRange = max(MaxRange,high)
       MinRange = min(MinRange,low)
    ENDIF
    IF time = 080000 THEN
       MaxRange = MaxRange + 1 * pipsize
       MinRange = MinRange - 1 * pipsize
    ENDIF

    At 080000 MaxRange and MinRange will contain both extremes with +- 1 pip.

    #103301 quote
    Kevin Newton
    Participant
    New

    Thanks Roberto, I’ll give it a go..  Much appreciated.

    #103313 quote
    GraHal
    Participant
    Master

    Link to above code added to here

    Snippet Link Library

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

How to define a range (and add a pip) – Help Wanted!


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by GraHal
6 years, 6 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/23/2019
Status: Active
Attachments: No files
Logo Logo
Loading...