Hey!
As the title goes, i want to retrieve the timeframe i am currently viewing to impact the calculation of an indicator, so its input values changes depending on wether im looking at a weekly,daily,1h or other timeframe chart. TradingView has this feature whereas you enter for example “timeframe.isdaily” and then IF the current chart is on a daily timeframe, the values followed are returned true.
I have been looking at PRTs “TIMEFRAME” but that seems to be the other way around.
I want to complete the following more or less:
X=value i want changed depending on currently VIEWED timeframe in PRT.
If dailytimeframe then X=20
if weeklytimeframe then X=52
if H1 timeframe then x=120
else
x=240
…for starters.
anyone has a smart code/idea that isnt to cpu-consuming that retrieves the currently viewed timeframe?
Thanks!
Viktor