Get current timeframe

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #247295 quote
    dbl007dbl007
    Participant
    Junior

    How do I get the timeframe of my chart? I want to use this info to creae higher timeframe objects?

    For exmple if current tieframe is 5 minute,  I will set the highr timeframe to 1 hour, if 1 hour, set it to 1 day, etc

    Is there a way to define an external variable for user to choose the timeframe?

    #247297 quote
    JSJS
    Participant
    Master

    The GetTimeFrame instruction returns the current timeframe in seconds…

    It is not possible to use variables or if-then statements in combination with TimeFrame…

    Iván González thanked this post
    #247332 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Here an example:

    if gettimeframe<3600 then
    if openhour<>openhour[1] then
    drawvline(barindex)
    endif
    else
    drawtext("your TF should be less than 1hr",0,-400)anchor(top,xshift,yshift)
    endif
    
    return
Viewing 3 posts - 1 through 3 (of 3 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 current timeframe


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
dbl007 @dbl007 Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Iván GonzálezIván González
1 year, 4 months ago.

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