//@version=6 indicator("ATR Rope + RSI 50 Cross", shorttitle = "AR+RSI", overlay = true) // ==================== ATR ROPE ====================== var string rp_group = "ATR Rope" src = input.source(close, "Source", group = rp_group) len = input.int(14, "ATR Len", group = rp_group) multi = input.float(1.5, "Multi", step = 0.25, minval = 0, group = rp_group) up_col = input.color(#3daa45, "Up Color", group = rp_group) down_col = input.color(#ff033e, "Down Color", group = rp_group) flat_col = input.color(#004d92, "Flat Color", group = rp_group) rope_smoother(float _src, float _threshold) => var float _rope = _src _move = _src - _rope _rope += math.max(math.abs(_move) - nz(_threshold), 0) * math.sign(_move) _rope f_rope(_src, _len, _multi) => _atr = ta.atr(_len) * _multi _rope = rope_smoother(_src, _atr) var _dir = 0 _dir := _rope > _rope[1] ? 1 : _rope < _rope[1] ? -1 : _dir if ta.cross(_src, _rope) _dir := 0 [_rope, _dir] // Rope [rope, dir] = f_rope(src, len, multi) col = dir > 0 ? up_col : dir < 0 ? down_col : flat_col plot(rope, linewidth = 3, color = col, title = "ATR Rope", force_overlay = true) // ==================== RSI 50 CROSS ================================ r = ta.rsi(close, 14) buy50 = ta.crossover(r, 50) and close > rope sell50 = ta.crossunder(r, 50) and close < rope plotshape(buy50, style=shape.arrowup, location=location.belowbar, color=color.green, size=size.small) plotshape(sell50, style=shape.arrowdown, location=location.abovebar, color=color.red, size=size.small)