Add timeframe in a part of the code : not all the code

Viewed 25

I know how to add the timeframe in a code when i want all the code in one timeframe but here it's a little different.

Here a part of the code because it's long.

show_Baseline_2 = input(title='Show Baseline 2', defval=true)

////BASELINE / SSL1 / SSL2 / EXIT MOVING AVERAGE VALUES
maType_2 = input.string(title='SSL1 2 / Baseline Type 2', defval='HMA', options=['HMA'])
len_2 = input(title='SSL1 2 / Baseline Length 2', defval=9)
src_2 = input(title='Source 2', defval=close)

...

///Keltner Baseline Channel
BBMC_2 = ma_2(maType_2, close, len_2)

...

//PLOTS
p1_2 = plot(show_Baseline_2 ? BBMC_2 : na, color=color_bar_2, linewidth=4, title='MA Baseline 2')

I have add this

//TF
res = input(title="Resolution", type=resolution, defval="240")
OUT = request.security(tickerid, res, BBMC)

And chose the plot with OUT

But don't work. Error.

Can you help me please.

Thanks

0 Answers
Related