Evolving Daily High, Low and Mid price

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #155991 quote
    Jdh320
    Participant
    New

    Hello has any one managed to code the daily (Session) high, low and mid ([(High – Low)/2]+Low )price? I can’t seem to find it in the indicators library?

    Many regards

     

    Joe

    #155996 quote
    robertogozzi
    Moderator
    Master

    There you go:

    IF IntraDayBarIndex = 0 THEN
       DailyHigh = high
       DailyLow  = low
    ENDIF
    DailyHigh  = max(DailyHigh,high)
    DailyLow   = min(DailyLow,low)
    DailyMid   = DailyLow + ((DailyHigh - DailyLow) / 2)
    RETURN DailyHigh AS "Dhigh",DailyLow AS "Dlow",DailyMid AS "Dmid"
    Jdh320 and PLermite thanked this post
    #155997 quote
    Vonasi
    Moderator
    Master

    ..or look here:

    Customized Trading session

    Jdh320 and PLermite thanked this post
    #156004 quote
    Jdh320
    Participant
    New

    Thanks for your help.

    regards

    joe

    #215516 quote
    mathiasKN
    Participant
    New

    Possible to add specific market hour into the script you posted <span class=”bbp-author-name”>robertogozzi</span>?

    BR
    Mathias

    #215522 quote
    robertogozzi
    Moderator
    Master

    Yes, you have to set both the StartTime and EndTime (not tested):

    ONCE StartTime = 090000
    ONCE EndTime   = 170000
    ONCE DailyHigh = 0
    ONCE DailyLow  = 0
    ONCE DailyMid  = 0
    IF EndTime >= StartTime THEN
       IF (OpenTime >= StartTime) AND (OpenTime <= StartTime) THEN
          IF (OpenTime = StartTime) OR ((OpenTime > StartTime) AND (OpenTime[1] < StartTime))
             DailyHigh = high
             DailyLow  = low
          ENDIF
          DailyHigh  = max(DailyHigh,high)
          DailyLow   = min(DailyLow,low)
          DailyMid   = DailyLow + ((DailyHigh - DailyLow) / 2)
       ENDIF
    ELSE
       IF (OpenTime >= StartTime) OR (OpenTime <= EndTime) THEN
          IF (OpenTime = StartTime) OR ((OpenTime > StartTime) AND (OpenTime[1] < StartTime)) OR ((OpenTime > 000000) AND (OpenTime[1] > OpenTime)) THEN
             DailyHigh = high
             DailyLow  = low
          ENDIF
          DailyHigh  = max(DailyHigh,high)
          DailyLow   = min(DailyLow,low)
          DailyMid   = DailyLow + ((DailyHigh - DailyLow) / 2)
       ENDIF
    ENDIF
    RETURN DailyHigh AS "Dhigh",DailyLow AS "Dlow",DailyMid AS "Dmid"
    #215524 quote
    robertogozzi
    Moderator
    Master

    @mathiasKN

    Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker.

    Double posting just creates confusion in the forums.

    Thank you 🙂

    #215591 quote
    mathiasKN
    Participant
    New

    Thanks Roberto, much obliged!

    Absolutely, wont happen again!

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

Evolving Daily High, Low and Mid price


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Jdh320 @jdh320 Participant
Summary

This topic contains 7 replies,
has 4 voices, and was last updated by mathiasKN
2 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/02/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...