The example combines two EMAs, crossover markers and an ATR offset. Despite its “Confirmed Signals” comment, buySignal/sellSignal and their shapes are not gated by barstate.isconfirmed, so they can appear and disappear on an open bar. Only the alert() calls use once-per-bar-close frequency. The variable named trailStop is recalculated from the current close; it has no persistent ratchet and is not a trailing stop order. Use positive EMA/ATR lengths and a positive multiplier; this example does not constrain those inputs. It is an indicator, not a backtested strategy.
Integrated All-in-One Indicator in Pine Script v6pinescript
//@version=6
indicator("All-in-One Trading Suite [Pineify]", overlay=true)
// --- Group 1: Trend Cloud ---
int fastEmaLen = input.int(20, "Fast Cloud EMA", group="Trend Cloud")
int slowEmaLen = input.int(50, "Slow Cloud EMA", group="Trend Cloud")
float fastEma = ta.ema(close, fastEmaLen)
float slowEma = ta.ema(close, slowEmaLen)
bool isBull = fastEma > slowEma
p1 = plot(fastEma, "Fast Cloud EMA", color=isBull ? color.green : color.red, linewidth=1)
p2 = plot(slowEma, "Slow Cloud EMA", color=color.gray, linewidth=1)
fill(p1, p2, color=isBull ? color.new(color.green, 70) : color.new(color.red, 70), title="Trend Cloud Fill")
// --- Group 2: ATR Dynamic Risk Band ---
int atrLen = input.int(14, "ATR Length", group="Risk Band")
float atrMult = input.float(2.0, "ATR Multiplier", group="Risk Band")
float atrVal = ta.atr(atrLen)
float trailStop = isBull ? close - (atrVal * atrMult) : close + (atrVal * atrMult)
plot(trailStop, "ATR Trailing Stop", color=isBull ? color.teal : color.maroon, style=plot.style_circles, linewidth=1)
// --- Group 3: Confirmed Signals ---
bool buySignal = ta.crossover(fastEma, slowEma) and close > slowEma
bool sellSignal = ta.crossunder(fastEma, slowEma) and close < slowEma
plotshape(buySignal, "Buy Alert", shape.triangleup, location.belowbar, color.green, size=size.small, text="BUY")
plotshape(sellSignal, "Sell Alert", shape.triangledown, location.abovebar, color.red, size=size.small, text="SELL")
// --- Group 4: Unified Alerts ---
if buySignal
alert("All-in-One BUY Signal confirmed at " + str.tostring(close) + " | Invalidation: " + str.tostring(trailStop), alert.freq_once_per_bar_close)
if sellSignal
alert("All-in-One SELL Signal confirmed at " + str.tostring(close) + " | Invalidation: " + str.tostring(trailStop), alert.freq_once_per_bar_close)