MTF CCI Bar
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FX_masa

//@version=5
indicator(title="MTF CCI Bar", overlay=false)

mtf = input.timeframe(defval="", title="MTF")
src = input(hlc3, title="Source")

cciPeriod = input.int(defval=20, title='CCI Period')

cci = ta.cci(src, cciPeriod)

mtfCCI = request.security(syminfo.tickerid, mtf, cci)

p = plot(0, color=color.new(color.gray, 0), editable=false)
p1 = plot(1, color=color.new(color.gray, 0), editable=false)

fill(p, p1, color=0 <= mtfCCI ? color.new(color.green, 0) : color.new(color.red, 0), title='CCI color')