Lookback that calculates differently depending on chart time being viewed

20 Views Asked by At

I'm trying to calculate a value on the 1m timeframe when looking at multiple seconds timeframes(using[]), but can't figure out how to make it specific to that chart. Example: So if I was looking at " ", it would be;

`1s = x[60] - x[120]`
`5s = x[12] - x[24]`
`10s = x[6] - x[12]`

Etc...

Right now I can only figure out how to get it to show 1 set. So if I do the 1s, [60]-[120] it's going to calculate 10 minutes - 20 minutes back when I look at the 10s chart.

Is this even possible, or should I create functions that I can turn on/off manually in the settings based on the tf I'm looking at?

I've tried using timeframe.isseconds, timeframe multipliers, and setting specific variables. But I keep getting errors, no change, or the script calculating way different then intended.

0

There are 0 best solutions below