Reputation: 2963
I am trying to assign the default ATR Resolution to be the same as the current Chart being used. So,
default input
ATR Resolution would
be 'W'default input
ATR Resolution would
be 'D'Pseudocode I am trying to write:
timeframe = '1'
current = timeframe.period
if current != timeframe
timeframe = current
i_atrRes = input(defval=timeframe, type=input.resolution, title='ATR Resolution', group="STOP LOSS - used only if 'ATR' selected")
I have been looking at information on this link: https://backtest-rookies.com/2019/03/15/tradingview-daily-atr-stop/
This is what I have encountered so far ...
timeframe = "'" + timeframe.period + "'" < --- does not work
timeframe = "'" + tostring(1) + "'" < --- does not work
timeframe = '1' < --- works
for the statement below:
i_atrRes = input(defval=timeframe, type=input.resolution, title='ATR Resolution', group="STOP LOSS - used only if 'ATR' selected")
How can I do this?
Upvotes: 0
Views: 732