Appearance

Personalize your experience

Mode
Accent Color
Direction
All Docs/QuaScript//
QuaScript logo

QuaScript Documentation

Language guide, engine API, 601 builtins and the preset library · v3.0.0-phase1

Getting started

QuaScript is a small language for chart analysis, strategies and trading bots. A script runs once per bar, from the oldest bar to the newest, on a compiled C++20 engine. The terminal draws what the script outputs: lines, bands, levels, marks, colored candles, drawings and profiles.

Your first analysis

QuaScriptengine result
Loading the engine result…
ema_cross.qs
analysis "EMA Cross" {
    overlay = true
}

fast = param.int(9, title = "Fast length", min = 1)
slow = param.int(21, title = "Slow length", min = 2)

f = ta.ema(close, fast)
s = ta.ema(close, slow)

render.line(f, "Fast", color = color.sky.400, width = 2)
render.line(s, "Slow", color = color.orange.400, width = 2)
render.mark(ta.cross_up(f, s), shape = shape.triangle_up, at = anchor.below_bar, color = color.emerald.500)
render.mark(ta.cross_down(f, s), shape = shape.triangle_down, at = anchor.above_bar, color = color.rose.500)
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)

Read it top to bottom:

  1. The header names the script and says what it is. analysis draws; strategy also trades on a simulated broker; bot sends its live orders as signals; library holds reusable code.
  2. Parameters (param.int) become settings in the terminal's settings dialog.
  3. Calculations (ta.ema) run on every bar. close is the close of the bar being processed.
  4. Outputs (render.line, render.mark) say what to draw.

Run it in the terminal

Open the code editor in the terminal, paste the script and press Run. The editor checks the script as you type and underlines problems with a fix when one exists.

Run it from the command line

The engine ships as the quas command line tool.

terminal.sh
cd packages/quascript
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
./build/quas check ema_cross.qs                 # compile and list the outputs
./build/quas run ema_cross.qs --synth 5000      # run on 5000 synthetic bars, JSON to stdout
./build/quas run ema_cross.qs data.csv --set fast=12 --out result.json

A CSV file has a header time,open,high,low,close,volume (time in epoch seconds). Extra columns such as bar.buy_volume, or orderbook.bid.0 / orderbook.bid_size.0 (the recorded order book of each bar, read by book.*), become host data (see Time, sessions and data).

Where to go next

You want toRead
understand values, series and historyLanguage basics
write functions and reuse codeFunctions, Libraries
draw more than linesRendering, Drawings
trade on the simulated brokerStrategies
build something large step by stepBuilding complex analyses
look up a functionthe Reference section, one page per domain

© 2026 Quatick Technologies. All rights reserved.