Language guide, engine API, 601 builtins and the preset library · v3.0.0-phase1
Chart styles
Areas & Cloud Ribbons
analysis · presets/charts/areas_and_clouds.qs
Volatility channel drawn as splines with a cloud-textured band between them.
QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
areas_and_clouds.qs
analysis "Areas & Cloud Ribbons" {
overlay = true
}
// Volatility channel drawn as splines with a cloud-textured band between them.
len = param.int(20, title = "Channel period", min = 2, max = 500)
mult = param.float(2.0, title = "Band multiplier", min = 0.1, max = 10, step = 0.1)
mid = ta.sma(close, len)
dev = stat.stdev(close, len) * mult
upper = mid + dev
lower = mid - dev
p_up = render.spline(upper, "Upper band", color = color.cyan.500, width = 1.5)
p_mid = render.line(mid, "Basis", color = color.orange.500, width = 1)
p_low = render.spline(lower, "Lower band", color = color.cyan.500, width = 1.5)
render.band(p_up, p_low, color = color.cyan.500, opacity = 0.15, texture = "cloud", title = "Volatility cloud")
render.area(mid, "Basis area", color = color.translucent(color.orange.500, 85), base = na)
render.mark(ta.cross_up(close, lower), shape = shape.triangle_up, at = anchor.below_bar, color = color.emerald.500, text = "Bounce")
render.mark(ta.cross_down(close, upper), shape = shape.triangle_down, at = anchor.above_bar, color = color.rose.500, text = "Reject")
Price drawn by the engine as candles, EMA trend overlay and a MACD histogram in a lower pane.
QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
candlesticks_and_bars.qs
analysis "Candlesticks & Bars" {
overlay = true
}
// Price drawn by the engine as candles, EMA trend overlay and a MACD histogram in a lower pane.
render.price.candles(up_color = color.teal.500, down_color = color.rose.500, title = "Candles")
fast = ta.ema(close, 20)
slow = ta.ema(close, 50)
render.spline(fast, "EMA 20", color = color.cyan.400, width = 2)
render.line(slow, "EMA 50", color = color.amber.500, width = 2)
render.mark(ta.cross_up(fast, slow), shape = shape.arrow_up, at = anchor.below_bar, color = color.emerald.500, text = "Buy")
render.mark(ta.cross_down(fast, slow), shape = shape.arrow_down, at = anchor.above_bar, color = color.rose.500, text = "Sell")
(macd, signal, hist) = ta.macd(close, 12, 26, 9)
render.histogram(hist, "MACD histogram", color = hist >= 0 ? color.emerald.500 : color.rose.500, pane = 1)
render.line(macd, "MACD", color = color.blue.500, pane = 1)
render.line(signal, "Signal", color = color.orange.600, pane = 1)
render.level(0, "Zero", color = color.slate.500, stroke = style.dotted, pane = 1)
Lines & Splines
analysis · presets/charts/lines_and_splines.qs
Spline, line and step plots on price, and a two-colored momentum baseline in a lower pane.
QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
lines_and_splines.qs
analysis "Lines & Splines" {
overlay = true
}
// Spline, line and step plots on price, and a two-colored momentum baseline in a lower pane.
fast_len = param.int(14, title = "Fast period", min = 1, max = 200)
slow_len = param.int(30, title = "Slow period", min = 1, max = 500)
fast = ta.ema(close, fast_len)
slow = ta.sma(close, slow_len)
render.spline(fast, "Fast spline", color = color.green.500, width = 2)
render.line(slow, "Slow line", color = color.blue.600, width = 2)
render.step(slow - ta.atr(14), "Trailing step", color = color.orange.500, width = 1.5)
render.mark(ta.cross_up(fast, slow), shape = shape.triangle_up, at = anchor.below_bar, color = color.emerald.500, text = "Bull")
render.mark(ta.cross_down(fast, slow), shape = shape.triangle_down, at = anchor.above_bar, color = color.rose.500, text = "Bear")
mom = close - close[10]
render.baseline(mom, "Momentum", base = 0, up_color = color.emerald.500, down_color = color.rose.500, pane = 1)
render.level(0, "Zero", color = color.slate.500, stroke = style.dotted, pane = 1)
Levels & Targets
analysis · presets/charts/reference_levels.qs
Parameterised horizontal levels with a shaded risk / reward zone and reversal marks.
QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
reference_levels.qs
analysis "Levels & Targets" {
overlay = true
}
// Parameterised horizontal levels with a shaded risk / reward zone and reversal marks.
resistance = param.float(120, title = "Resistance")
support = param.float(80, title = "Support")
target = param.float(140, title = "Take profit")
stop = param.float(70, title = "Stop")
render.spline(close, "Price", color = color.blue.600, width = 2)
r = render.level(resistance, "Resistance", color = color.red.400, stroke = style.dashed)
s = render.level(support, "Support", color = color.teal.500, stroke = style.dashed)
t = render.level(target, "Target", color = color.green.400, width = 2, stroke = style.solid)
x = render.level(stop, "Stop", color = color.red.600, width = 2, stroke = style.solid)
render.band(r, s, color = color.slate.400, opacity = 0.06, title = "Range")
render.mark(ta.cross_down(close, resistance), shape = shape.diamond, at = anchor.above_bar, color = color.rose.500, text = "Reject")
render.mark(ta.cross_up(close, support), shape = shape.diamond, at = anchor.below_bar, color = color.emerald.500, text = "Bounce")
Volume & Order Flow
analysis · presets/charts/volume_and_orderflow.qs
Direction-colored volume columns, a volume average and climax marks.
QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
volume_and_orderflow.qs
analysis "Volume & Order Flow" {
overlay = false
}
// Direction-colored volume columns, a volume average and climax marks.
len = param.int(20, title = "Average length", min = 1, max = 500)
spike = param.float(2.0, title = "Climax multiple", min = 1, max = 10, step = 0.1)
avg = ta.sma(volume, len)
render.histogram(volume, "Volume", color = close >= open ? color.teal.500 : color.rose.500)
render.spline(avg, "Volume average", color = color.orange.500, width = 1.5)
render.line(avg * spike, "Climax threshold", color = color.pink.500, stroke = style.dashed, width = 1)
render.mark(volume > avg * spike, shape = shape.star, at = anchor.above_bar, color = color.yellow.400, text = "Climax")
GPU Volume Profile
analysis · presets/charts/webgl_volume_profile.qs
Visible-range volume profile computed by the engine (POC, value area) and drawn on the GPU.
QuaScriptengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)
webgl_volume_profile.qs
analysis "GPU Volume Profile" {
overlay = true
render = webgl
}
// Visible-range volume profile computed by the engine (POC, value area) and drawn on the GPU.
rows = param.int(70, title = "Price rows", min = 8, max = 400)
area = param.float(0.70, title = "Value area", min = 0.5, max = 0.95, step = 0.05)
width = param.float(160, title = "Width (px)", min = 40, max = 400)
render.profile.volume(rows = rows, value_area = area, width = width, up_color = color.teal.500, down_color = color.rose.500, poc_color = color.amber.400, title = "Volume profile")