I try to make a simple indicator for each timframe and I did it only that in inputs something like this and I must reduce them with conditional if
I want the show last as the offset to change at different times 4h 2h 1h 30m 15m but the code is long because I have several this is a simple code it works normally if the conditional if but when I put the if so that the condition changes value no change
a = 0
b = 0
if timeframe.period =="240"
a:= 30
b:= 30
//
if timeframe.period =="120"
a:= 60
b:= 60
bgcolor( showSemanal2 and isTue2() ? semanalcolor : na, title="inicio semanal color", show_last = b, offset = a)
bgcolor( showSemanal2 and isTue2() ? semanalcolor : na, title="inicio semanal color" , show_last = b )
bgcolor( showSemanal and isTue2() ? semanalcolor : na)```
I expected it to change in each timeframe but it didn't work out I hope you can help me