Get first bar of the day low/high

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #170816 quote
    dubcanadadubcanada
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
5 years, 4 months ago.

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