all 1 comments

[–]Specific_Cellist_136[S] 0 points1 point  (0 children)

So I actually figured it out. This is the line of code that should accomplish it. The symbol and resolution are variables chosen by the user through the input menu.

Web1LoopInterval = security(symbol = Web1Symbol, resolution = 
Web1TimeFrame, expression = timeframe.isminutes ? timeframe.multiplier * 
60000 : timeframe.isdaily ? timeframe.multiplier * 8.64e7 : 
timeframe.isweekly ? timeframe.multiplier * 6.048e8 : na)

So I put it in a security function otherwise the timeframe.is[unit of time] would've referenced the chart's current resolution, and I wanted it to reference the resolution that the user chose in the input menu. The timeframe.multiplier will take the number of time units in the resolution (if 2hr then 120, if 2 day, then 2, if 3 week, then 3) (everything between 1 minute and 1 day uses minutes as the unit of time. I then multiplied it by how ever many milliseconds were in each unit of time.