I used to spend hours debugging "Pine Script" errors just to get a simple strategy working. Not anymore.

I generated this complete Smart SuperTrend System in less than 30 seconds using an AI workflow. It uses the latest Pine Script V6 syntax and includes visuals that most standard indicators lack.
Why this version is better:
• No Repainting: Strict ATR logic.
• Visual Cloud: Green/Red background fill makes identifying trends instant.
• Clean Signals: Buy/Sell labels are auto-plotted on confirmed trend flips.
Instead of keeping this private, I'm sharing the full open-source code below.
COPY THE CODE:
//
=6
indicator("Codon Pro Smart SuperTrend [System]", shorttitle="Codon ST", overlay=true)
// --- Inputs ---
group_st = "SuperTrend Settings"
atrPeriod = http://input.int(10, "ATR Period", minval=1, group=group_st)
factor = input.float(3.0, "ATR Multiplier", minval=0.1, step=0.1, group=group_st)
group_vis = "Visuals"
showLabels = input.bool(true, "Show Buy/Sell Labels", group=group_vis)
fillBg = input.bool(true, "Fill Trend Background", group=group_vis)
transp = http://input.int(90, "Background Transparency", minval=0, maxval=100, group=group_vis)
// --- SuperTrend Calculation ---
[superTrendLine, direction] = ta.supertrend(factor, atrPeriod)
// Direction logic: -1 is Bullish (Up), 1 is Bearish (Down)
// CRITICAL: We explicitly define -1 as Uptrend based on V6 standards
isUptrend = direction < 0
isDowntrend = direction > 0
// --- Visuals ---
colorUp = http://color.new(#00e676, 0) // Bright Green
colorDn = http://color.new(#ff1744, 0) // Bright Red
colorUpFill = http://color.new(#00e676, transp)
colorDnFill = http://color.new(#ff1744, transp)
plot(superTrendLine, "Trend Line", color = isUptrend ? colorUp : colorDn, linewidth=2)
p1 = plot(superTrendLine, display=display.none)
p2 = plot(hl2, display=display.none)
fill(p1, p2, color = fillBg ? (isUptrend ? colorUpFill : colorDnFill) : na, title="Trend Background")
// --- Signals ---
trendUp = ta.change(direction) < 0
trendDn = ta.change(direction) > 0
plotshape(showLabels and trendUp, "Buy Signal", shape.labelup, location.belowbar, colorUp, 0, "BUY", color.white, size=size.small)
plotshape(showLabels and trendDn, "Sell Signal", shape.labeldown, location.abovebar, colorDn, 0, "SELL", color.white, size=size.small)
barcolor(isUptrend ? colorUp : colorDn, title="Bar Color")
How I built this: I didn't write a single line of this manually. I used http://Codon.pro to turn my logic into code instantly.
If you want to stop fighting with syntax and start building strategies, give it a try.
#Bitcoin #TradingView #PineScript #AlgoTrading #Coding #AI