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?
JSParticipant
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…
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