Get current timeframe

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #247295 quote
    dbl007
    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
    JS
    Participant
    Senior

    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ález
    Moderator
    Master

    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.

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ález
8 months, 3 weeks ago.

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