Skip to content
ChartRiderDocs
Docs/WickScript/WickScript reference
WickScript WickScript

WickScript reference

Every built-in WickScript value, function and keyword with its parameters, units and a short description.

Updated ·Markdown

This page lists every built-in value, function and keyword of WickScript version 1, generated from the language itself, so it always matches what the checker accepts. Units are those described in the Language guide; many functions return the unit of their source, so the EMA of a price is a price and the EMA of a volume is a volume. Lengths are fixed whole numbers of at least 1 – a number, N bars or an input.

Candle and price

NameKindUnitDescription
openseriespriceOpen of the candle
highseriespriceHigh of the candle
lowseriespriceLow of the candle
closeseriespriceClose of the candle
hl2seriesprice(high + low) / 2
hlc3seriesprice(high + low + close) / 3
ohlc4seriesprice(open + high + low + close) / 4
volumeseriesamountVolume of the candle
truerangeseriespriceTrue range of the candle
vwapseriespriceVolume-weighted average price of the UTC day (from open, high, low, close)
obvseriesamountOn-balance volume
tickconstantpriceSmallest price step of the market

Time and sessions

NameKindUnitDescription
timeseriestimeOpen time of the candle
sessionseriestextTrading session of the candle: Asia, London or NewYork
AsiaconstanttextAsia session
LondonconstanttextLondon session
NewYorkconstanttextNew York session (or killzone)
LondonCloseconstanttextLondon close killzone
killzoneseriestextICT killzone of the candle (New York time): Asia 20–24, London 2–5, NewYork 7–10, LondonClose 10–12
hourseriesnumberHour of the candle's open time (UTC, 0 … 23)
minuteseriesnumberMinute of the candle's open time (0 … 59)
weekdayseriestextWeekday of the candle (UTC): Monday … Sunday
dateseriestextDate of the candle (UTC) as text, e.g. "2026-10-24"
MondayconstanttextMonday
TuesdayconstanttextTuesday
WednesdayconstanttextWednesday
ThursdayconstanttextThursday
FridayconstanttextFriday
SaturdayconstanttextSaturday
SundayconstanttextSunday

Orderflow (from ticks)

NameKindUnitDescription
buyVolumeseriesamountAggressive buy volume of the candle (from ticks; na without tick data)
sellVolumeseriesamountAggressive sell volume of the candle (from ticks; na without tick data)
deltaseriesamountBuy volume − sell volume of the candle (from ticks)
cvdseriesamountCumulative delta since the first candle with tick data
tradesseriesnumberNumber of trades (ticks) in the candle

Order book fields

The order book at the candle's close, where it was recorded (available(book) tells you).

FieldUnit
book.bidprice
book.askprice
book.spreadprice
book.midprice
book.availabletrue/false

Footprint fields

The footprint of each candle, built from its ticks.

FieldUnit
footprint.pocprice
footprint.vahprice
footprint.valprice
footprint.buyImbalancesnumber
footprint.sellImbalancesnumber
footprint.imbalancenumber

Trade fields (inside on tick … end)

One trade (tick) of the market.

FieldUnit
trade.priceprice
trade.sizeamount
trade.sidetext
trade.buytrue/false
trade.selltrue/false
trade.timetime

Position fields (strategies)

The open trade of a strategy script.

FieldUnit
position.opentrue/false
position.longtrue/false
position.shorttrue/false
position.entryprice
position.stopprice
position.targetprice
position.sizepercent
position.rR
position.barsbars

Functions

Lengths are constants – a number, an input or N bars – so scripts stay incremental and fast. “Unit of the input” means the result keeps the unit of the series you pass in (the EMA of a price is a price).

Moving averages and windows

FunctionReturnsDescription
sma(source: value, length: length)unit of the inputSimple moving average
ema(source: value, length: length)unit of the inputExponential moving average
rma(source: value, length: length)unit of the inputRunning moving average (Wilder)
wma(source: value, length: length)unit of the inputWeighted moving average
dema(source: value, length: length)unit of the inputDouble exponential moving average
stdev(source: value, length: length)unit of the inputStandard deviation
highest(source: value, length: length)unit of the inputHighest value of the last candles
lowest(source: value, length: length)unit of the inputLowest value of the last candles
sum(source: value, length: length)unit of the inputSum of the last candles
change(source: value, length?: length)unit of the inputChange against N candles ago (default 1)

Indicators

FunctionReturnsDescription
rsi(source: value, length: length)numberRelative strength index (0 … 100)
atr(length: length)priceAverage true range (Wilder)
mfi(length: length)numberMoney flow index (0 … 100)
chop(length: length)numberChoppiness index (0 … 100)
vwap(anchor?: text, amount?: length)priceVWAP that restarts every anchor: "minute", "hour", "day", "week", "month" (UTC, × amount) or "session" (Asia, London, New York)
macd(source: value, fast: length, slow: length, signal: length)record line, signal, histogram (unit of the input)MACD line, signal and histogram
stoch(length: length, smoothK: length, smoothD: length)record k (number), d (number)Stochastic %K and %D (0 … 100)

Conditions

FunctionReturnsDescription
crossover(a: value, b: value)true/falsea crosses above b (same as “a crosses above b”)
crossunder(a: value, b: value)true/falsea crosses below b
available(data: any)true/falseavailable(book): is there orderbook data at this candle?
isna(x: any)true/falseTrue where x has no value (na), e.g. while an indicator warms up

Order book

FunctionReturnsDescription
book.bidPrice(level: length)pricePrice of the n-th bid level (1 … 10) at the candle's close
book.askPrice(level: length)pricePrice of the n-th ask level (1 … 10) at the candle's close
book.bidSize(level: length)amountSize of the n-th bid level (1 … 10)
book.askSize(level: length)amountSize of the n-th ask level (1 … 10)
book.bidVolume(depth: length)amountSize of the best 5, 10, 25 or 50 bid levels
book.askVolume(depth: length)amountSize of the best 5, 10, 25 or 50 ask levels
book.imbalance(depth: length)number(bid − ask) / (bid + ask) over the best 5, 10, 25 or 50 levels (−1 … 1)

Math and units

FunctionReturnsDescription
abs(x: value)unit of the inputAbsolute value
min(a: value, b: value)unit of the inputSmaller of two values
max(a: value, b: value)unit of the inputLarger of two values
round(x: value)unit of the inputRound to a whole number
nz(x: value, replacement?: value)unit of the inputReplace na (default 0)
sqrt(x: number)numberSquare root
log(x: number)numberNatural logarithm
pow(x: number, y: number)numberx to the power of y
pct(now: price, before: price)percentChange from before to now in %
number(x: any)numberDrop the unit – calculate with plain numbers on purpose
price(x: number)priceA fixed price level, e.g. price(2000)
amount(x: number)amountA fixed amount (volume), e.g. trade.size >= amount(50)

Colors

white (#f0efec), black (#000000), gray (#9ca3af), red (#ef4444), green (#22c55e), blue (#3987e5), amber (#f59e0b), orange (#f97316), yellow (#facc15), lime (#84cc16), teal (#14b8a6), cyan (#22d3ee), purple (#a855f7), violet (#a78bfa), pink (#f472b6). Any #RRGGBB value works as well.

Reserved words

These words carry the sentence structure and can't be used as names: alert, and, as, becomes, crosses, define, else, end, falling, false, if, indicator, input, is, keep, library, mark, mod, na, not, of, on, or, repeat, return, rising, show, strategy, then, true, use, when, wickscript.

Generated from the ChartRider source code on every release – settings, outputs and the WickScript reference always match the app.

Imprint·Privacy·Contact·Changelog·llms-full.txt

Paper trading uses play money only. Nothing in these docs is investment advice.