Examples

Moving-average ribbon

Two exponential averages, the space between them filled with the trend's color, and markers on the crosses. A good first script: settings, plots, a fill and markers.

StrateScript
indicator "EMA ribbon" { overlay: true }

fastLen = input.int("Fast length", 9, min: 1, group: "Lengths")
slowLen = input.int("Slow length", 21, min: 2, group: "Lengths")
upCol = input.color("Up", #26a69a, group: "Colors", inline: "c")
dnCol = input.color("Down", #ef5350, group: "Colors", inline: "c")

fast = ema(close, fastLen)
slow = ema(close, slowLen)
up = fast > slow

pf = plot(fast, up ? upCol : dnCol, title: "Fast", width: 2)
ps = plot(slow, #888888, title: "Slow")
fill(pf, ps, up ? alpha(upCol, 20) : alpha(dnCol, 20))

// only on closed bars, so the marks do not flicker on the live bar
marker(crossover(fast, slow) and bar.confirmed, shape: "triangle_up", location: "below", color: upCol)
marker(crossunder(fast, slow) and bar.confirmed, shape: "triangle_down", location: "above", color: dnCol)

What to notice:

STRATE / PRODUCT SCREENSHOT

Actual platform screenshot.