I created an indicator that identifies candle patterns on the 15 minute chart. However, for a setup to be valid it must touch the bollinger band on the 30 and 60 minute charts also. Using the training video for higher time frame EMA setup as a template, I tried to generate bollinger bands but am having no luck getting them to match the actual BB values on a 60 minute chart. I think it has to do with my source. Below is the current script. I tried two methods, one is // out, but it should be clear what I was trying to do.
//user input
res60 = input.timeframe(title="SMA Timeframe", defval="60")
res30 = input.timeframe(title="SMA Timeframe", defval="30")
len = input.int(title="SMA length", defval=20)
//calculate SMA
sma = ta.sma(close, 20)
sma60 = request.security(syminfo.tickerid, res60, sma)
//value60 = request.security(syminfo.tickerid, res60, close)
sma30 = request.security(syminfo.tickerid, res30, sma)
stdev60 = ta.stdev(sma60, 20)
bbup60 = sma60 + (stdev60 * 2)
bbdown60 = sma60 - (stdev60 * 2)
//bb60 = ta.bb(value60, 30, 2)
plot(sma60, title="sma60")
//plot(sma30)
//plot(bb60, color=color.green)
plot(bbup60, title="bbup60", color=color.green)
plot(bbdown60, title="bbdown60", color=color.green)