fusiona este codigo:

//@version=4
study(title="Tradefi.bot | Reversal Zones", shorttitle="Tradefi.bot | Reversal Zones", overlay=true)

// Channel parameters
length = input(100, title="Length")

// Moving average or channel type selector
type = input(defval="SMA", title="Type", options=["SMA", "EMA", "HULL"])

// Adjust multipliers according to the timeframe
adjustmentFactor = timeframe.isdaily ? 2 : 0.8
multiplier1 = 4 * adjustmentFactor
multiplier2 = 2 * adjustmentFactor
multiplier3 = 0.8 * adjustmentFactor

// Base calculations
smaValue = sma(close, 100)
emaValue = ema(close, 100)
hullValue = wma(2 * wma(close, 100 / 2) - wma(close, 100), round(sqrt(100)))

// Select the corresponding moving average or channel
mv = type == "SMA" ? smaValue : type == "EMA" ? emaValue : hullValue

// Calculate ATR based on the 1D timeframe
dailyATR = security(syminfo.tickerid, 'D', atr(length))

upper1 = mv + (dailyATR * multiplier1)
upper2 = mv + (dailyATR * multiplier2)
upper3 = mv + (dailyATR * multiplier3)

lower1 = mv - (dailyATR * multiplier1)
lower2 = mv - (dailyATR * multiplier2)
lower3 = mv - (dailyATR * multiplier3)

// Draw the channel lines
p_upper1 = plot(upper1, color=#B164EC, title="Large Upper Channel")
p_upper2 = plot(upper2, color=#B164EC, title="Medium Upper Channel")
p_upper3 = plot(upper3, color=#B164EC, title="Small Upper Channel")

p_lower1 = plot(lower1, color=#F3DDA0, title="Large Lower Channel")
p_lower2 = plot(lower2, color=#F3DDA0, title="Medium Lower Channel")
p_lower3 = plot(lower3, color=#F3DDA0, title="Small Lower Channel")

// Draw the shaded areas using "fill"
fill(p_upper1, p_upper2, color=color.new(#B164EC, 80))
fill(p_upper2, p_upper3, color=color.new(#B164EC, 60))
fill(p_lower1, p_lower2, color=color.new(#F3DDA0, 80))
fill(p_lower2, p_lower3, color=color.new(#F3DDA0, 60))


con el siguiente codigo:
//@version=5
// © 2023 Smart Trading Indicators LLC. All rights reserved.
// This code has been edited, created, and adjusted by Smart Trading Indicators, utilizing both paid and free indicator libraries. 
// The strategy code was built from scratch, referencing other indicators and ideas. Comprehensive backtesting of these strategies 
// was conducted using Machine Learning (ML) and Artificial Intelligence (A.I). The strategies were conceived and developed by 
// Smart Trading Indicators and its team, which truly adds value to them.

//@version=5
strategy(title='Tradefi.bot BNB/USDT • 1H', overlay=true, initial_capital=100000, process_orders_on_close=true)

// Checkbox para backtesting, configuraciones recomendadas, trailing stop
enableChartBacktesting = input.bool(false, "Enable strategy backtesting on chart (use Recommended Strategy and please Activate Trailing Stop Control if not an expert⬇)")
activateTrailingStop = input.bool(true, "Activate Trailing Stop Control (On-chart Risk Management) __________ and please select an option from 'Indicator parameters to use'")

// Inputs condicionales
dataRangeSettingsGroup = 'Date range'
startdate = enableChartBacktesting ? input.time(defval=timestamp('1 Jan 2023 00:00 +0300'), title='Start Date', group = dataRangeSettingsGroup) : timestamp('2099-01-01 00:00 +0300')
enddate = enableChartBacktesting ? input.time(defval=timestamp('1 Dec 2025 00:00 +0300'), title='End Date', group = dataRangeSettingsGroup) : timestamp('2100-01-01 00:00 +0300')

customParams = 'Custom parameters (only for experts)'
BNBUSDT1H = 'BNBUSDT 1H'


parametersOptionSelected = 'BNBUSDT1H'

trailingSettingGroup = 'Trailing Settings (only for experts)'

// Define valores específicos para BNBUSDT1H
trailLevel = 0.2/100
trailPoints = 0.6/100
src = close
per = 180
mult = 1
stopLossPercent = 0.9
    

inDateRange = time >= startdate and time <= enddate

smoothrng(x, t, m) =>
    wper = t * 2 - 1
    avrng = ta.ema(math.abs(x - x[1]), t)
    smoothrng = ta.ema(avrng, wper) * m
    smoothrng
smrng = smoothrng(src, per, mult)

rngfilt(x, r) =>
    rngfilt = x
    rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r : x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r
    rngfilt
filt = rngfilt(src, smrng)

upward = 0.0
upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
downward = 0.0
downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])

hband = filt + smrng
lband = filt - smrng

filtcolor = upward > 0 ? #F3DDA0 : downward > 0 ? #B164EC : #B164EC
barcolor = src > filt and src > src[1] and upward > 0 ? #F3DDA0 : src > filt and src < src[1] and upward > 0 ? #F3DDA0 : src < filt and src < src[1] and downward > 0 ? #B164EC : src < filt and src > src[1] and downward > 0 ? #B164EC : #B164EC

filtplot = plot(filt, color=filtcolor, linewidth=3, title='Range Filter')
hbandplot = plot(hband, color=#F3DDA02a, title='High Target')
lbandplot = plot(lband, color=#B164EC2a, title='Low Target')

fill(hbandplot, filtplot, color=#F3DDA02a, title='High Target Range')
fill(lbandplot, filtplot, color=#b164ec2a, title='Low Target Range')

barcolor(barcolor)

longCond = bool(na)
shortCond = bool(na)
longCond := src > filt and src > src[1] and upward > 0 or src > filt and src < src[1] and upward > 0
shortCond := src < filt and src < src[1] and downward > 0 or src < filt and src > src[1] and downward > 0

CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1

plotshape(longCondition, title='Buy Signal', text='Open Long | Buy Signal', textcolor=#141721, style=shape.labelup, size=size.normal, location=location.belowbar, color=#F3DDA0)
plotshape(shortCondition, title='Sell Signal', text='Open Short | Sell Signal', textcolor=color.new(color.white, 0), style=shape.labeldown, size=size.normal, location=location.abovebar, color=color.new(#B164EC, 0))


// Logica de la estrategia
if longCondition and inDateRange
    qty = strategy.equity/close
    strategy.entry('long', strategy.long, qty=qty)
    if activateTrailingStop
        trailp = close * (1 + trailLevel)
        trailOffset = trailPoints * close
        stop_loss_price_long = (1 - stopLossPercent / 100.) * close
        strategy.exit("Trail Exit long", from_entry="long", stop= stop_loss_price_long, trail_price= trailp, trail_offset= trailOffset)

if shortCondition and inDateRange
    qty = strategy.equity/close
    strategy.entry('short', strategy.short, qty=qty)
    if activateTrailingStop
        trailps = close * (1 - trailLevel)
        trailOffset = trailPoints * close
        stop_loss_price_short = (1 + stopLossPercent / 100.) * close
        strategy.exit("Trail Exit short", from_entry="short", stop= stop_loss_price_short, trail_price= trailps, trail_offset= trailOffset)

// Mostrar valores en la esquina superior derecha si están activados
if activateTrailingStop
    var label lblTrailPrice = label.new(x = bar_index, y = na, style = label.style_label_left, color = #B164EC, textcolor=color.white, size = size.small, text = "Trail price in %: " + str.tostring(trailLevel*100))
    var label lblTrail = label.new(x = bar_index, y = na, style = label.style_label_left, color = #B164EC, textcolor=color.white, size = size.small, text = "Trail: " + str.tostring(trailPoints*100))
    var label lblSamplingPeriod = label.new(x = bar_index, y = na, style = label.style_label_left, color = #B164EC, textcolor=color.white, size = size.small, text = "Sampling Period: " + str.tostring(per))
    var label lblRangeMultiplier = label.new(x = bar_index, y = na, style = label.style_label_left, color = #B164EC, textcolor=color.white, size = size.small, text = "Range Multiplier: " + str.tostring(mult))
    
    // Posicionando las etiquetas en la esquina superior derecha
    label.set_xy(lblTrailPrice, x = bar_index, y = high + 5*(ta.atr(14)))
    label.set_xy(lblTrail, x = bar_index, y = high + 4*(ta.atr(14)))
    label.set_xy(lblSamplingPeriod, x = bar_index, y = high + 3*(ta.atr(14)))
    label.set_xy(lblRangeMultiplier, x = bar_index, y = high + 2*(ta.atr(14)))
    
    
/////////////////////////////////////////////////////////
//Filter function 
f_filt9x(_a, _s, _i) =>
    int _m2 = 0
    int _m3 = 0
    int _m4 = 0
    int _m5 = 0
    int _m6 = 0
    int _m7 = 0
    int _m8 = 0
    int _m9 = 0
    float _f = .0
    _x = 1 - _a
    // Weights. 
    // Initial weight _m1 is a pole number and equal to _i
    _m2 := _i == 9 ? 36 : _i == 8 ? 28 : _i == 7 ? 21 : _i == 6 ? 15 : _i == 5 ? 10 : _i == 4 ? 6 : _i == 3 ? 3 : _i == 2 ? 1 : 0
    _m3 := _i == 9 ? 84 : _i == 8 ? 56 : _i == 7 ? 35 : _i == 6 ? 20 : _i == 5 ? 10 : _i == 4 ? 4 : _i == 3 ? 1 : 0
    _m4 := _i == 9 ? 126 : _i == 8 ? 70 : _i == 7 ? 35 : _i == 6 ? 15 : _i == 5 ? 5 : _i == 4 ? 1 : 0
    _m5 := _i == 9 ? 126 : _i == 8 ? 56 : _i == 7 ? 21 : _i == 6 ? 6 : _i == 5 ? 1 : 0
    _m6 := _i == 9 ? 84 : _i == 8 ? 28 : _i == 7 ? 7 : _i == 6 ? 1 : 0
    _m7 := _i == 9 ? 36 : _i == 8 ? 8 : _i == 7 ? 1 : 0
    _m8 := _i == 9 ? 9 : _i == 8 ? 1 : 0
    _m9 := _i == 9 ? 1 : 0
    // filter
    _f := math.pow(_a, _i) * nz(_s) + _i * _x * nz(_f[1]) - (_i >= 2 ? _m2 * math.pow(_x, 2) * nz(_f[2]) : 0) + (_i >= 3 ? _m3 * math.pow(_x, 3) * nz(_f[3]) : 0) - (_i >= 4 ? _m4 * math.pow(_x, 4) * nz(_f[4]) : 0) + (_i >= 5 ? _m5 * math.pow(_x, 5) * nz(_f[5]) : 0) - (_i >= 6 ? _m6 * math.pow(_x, 6) * nz(_f[6]) : 0) + (_i >= 7 ? _m7 * math.pow(_x, 7) * nz(_f[7]) : 0) - (_i >= 8 ? _m8 * math.pow(_x, 8) * nz(_f[8]) : 0) + (_i == 9 ? _m9 * math.pow(_x, 9) * nz(_f[9]) : 0)
    _f

//9 var declaration fun
f_pole(_a, _s, _i) =>
    _f1 = f_filt9x(_a, _s, 1)
    _f2 = _i >= 2 ? f_filt9x(_a, _s, 2) : 0
    _f3 = _i >= 3 ? f_filt9x(_a, _s, 3) : 0
    _f4 = _i >= 4 ? f_filt9x(_a, _s, 4) : 0
    _f5 = _i >= 5 ? f_filt9x(_a, _s, 5) : 0
    _f6 = _i >= 6 ? f_filt9x(_a, _s, 6) : 0
    _f7 = _i >= 2 ? f_filt9x(_a, _s, 7) : 0
    _f8 = _i >= 8 ? f_filt9x(_a, _s, 8) : 0
    _f9 = _i == 9 ? f_filt9x(_a, _s, 9) : 0
    _fn = _i == 1 ? _f1 : _i == 2 ? _f2 : _i == 3 ? _f3 : _i == 4 ? _f4 : _i == 5 ? _f5 : _i == 6 ? _f6 : _i == 7 ? _f7 : _i == 8 ? _f8 : _i == 9 ? _f9 : na
    [_fn, _f1]
//Inputs


src_glory = hlc3
N_glory = 2
per_glory = 50
mult_glory = 1.414
modeLag_glory = false
modeFast_glory = false

beta_glory = (1 - math.cos(4 * math.asin(1) / 50)) / (math.pow(1.414, 2 / 2) - 1)
alpha_glory = -beta_glory + math.sqrt(math.pow(beta_glory, 2) + 2 * beta_glory)
lag_glory = 12.25
src_glorydata = modeLag_glory ? src_glory + src_glory - src_glory[lag_glory] : src_glory
trdata_glory = modeLag_glory ? ta.tr(true) + ta.tr(true) - ta.tr(true)[lag_glory] : ta.tr(true)
[filtn_glory, filt1_glory] = f_pole(alpha_glory, src_glorydata, N_glory)
[filtntr_glory, filt1tr_glory] = f_pole(alpha_glory, trdata_glory, N_glory)
filt_glory = modeFast_glory ? (filtn_glory + filt1_glory) / 2 : filtn_glory
filttr_glory = modeFast_glory ? (filtntr_glory + filt1tr_glory) / 2 : filtntr_glory
hband_glory = filt_glory + filttr_glory * mult_glory
lband_glory = filt_glory - filttr_glory * mult_glory

//Colors
color1_glory = #F3DDA0
color2_glory = #F3DDA0
color3_glory = #B164EC
color4_glory = #B164EC
fcolor_glory = filt_glory > filt_glory[1] ? #F3DDA0 : filt_glory < filt_glory[1] ? #B164EC : #cccccc
barcolor_glory = src_glory > src_glory[1] and src_glory > filt_glory and src_glory < hband_glory ? #F3DDA0 : src_glory > src_glory[1] and src_glory >= hband_glory ? #F3DDA0 : src_glory <= src_glory[1] and src_glory > filt_glory ? #F3DDA0 : src_glory < src_glory[1] and src_glory < filt_glory and src_glory > lband_glory ? #B164EC : src_glory < src_glory[1] and src_glory <= lband_glory ? #B164EC : src_glory >= src_glory[1] and src_glory < filt_glory ? #B164EC : #cccccc

//Plots
filtplot_glory = plot(filt_glory, title='Filter', color=fcolor_glory, linewidth=3)
hbandplot_glory = plot(hband_glory, title='Filtered True Range High Band', color=fcolor_glory)
lbandplot_glory = plot(lband_glory, title='Filtered True Range Low Band', color=fcolor_glory)
                                             
// Define un color con transparencia
transparent_color = color.new(filt > filt[1] ? #F3DDA0 : filt < filt[1] ? #B164EC : #cccccc, 80)
// Relleno del canal con color transparente
fill(hbandplot, lbandplot, title='Channel Fill', color=transparent_color)                                             
//fill(hbandplot_glory, lbandplot_glory, title='Channel Fill', color=fcolor_glory, transp=80)
barcolor(barcolor_glory)