Get first bar of the day low/high

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #170816 quote
    dubcanada
    Participant
    New

    Hello,

    I am trying to get the first bar of the day high and low, and I want it excluding premarket, so the bar from 930.

    I want to have 5 minute and 15 minute charts.

    I tried using the DateToBarIndex but I cannot use string concatenation to turn the current date + 930.

    I tried using IntradayBarIndex which may work but I cannot find a way to determine how many to go back reliably.

    I could do a for loop and go back in time until I find a bar at 930 but I feel there must be an easier way.

    Anyone have any ideas?

    Thanks!

    #170817 quote
    robertogozzi
    Moderator
    Master

    There you go:

    If time = 093000 then
       MyHI = high
       MyLO = low
    Endif
    Return MyHI as “high”,MyLO as “low”

    you may replace Time with OpenTime, if needed.

    You can use in on both the 5-minute and 15-minute TF’s.

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

Get first bar of the day low/high


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
dubcanada @dubcanada Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/30/2021
Status: Active
Attachments: No files
Logo Logo
Loading...