I would like to be able to change the time interval displayed on the chart based on the ticker symbol used. For example, for NVDA, I would like to see a 15 min chart while for TSLA an hour based chart, etc...
The reason for doing this is because after running multiple iterations of my strategy on multiple symbols and on multiple time frames, I have a list of time intervals and strategy inputs that I want to change through the Pine strategy script automatically instead of manually going to change my time interval on the chart each time depending on the symbol.
Looking at the Pine manual, I see that for v4, timeframe.period
returns the current time period and timeframe.interval
returns the current time interval but is there a variable/function that I can set to change the chart time interval from within the code?
I do know that we can get the OHLC values using the security()
function but that's not what I want. I want this to automatically change the multiple plot displays that I have on the chart to the correct time interval for the symbol.
Is this possible?