Reference

Formula Reference

Variables and functions available in VYX custom signals and alerts.

Order-Book Variables

  • imb / absImb: selected-depth imbalance, signed and absolute.
  • deltaImb / absDelta / prevImb: candle-to-candle change and the previous value.
  • l1..l10 and c1..c10: per-level and cumulative imbalance from level 1 to 10.
  • bidNotional / askNotional / cumBookNotional: raw bucket and cumulative book notional.
  • sameSide: whether pressure stayed on the same side as the previous candle.

Spread & Price Variables

  • spreadAvg / spreadRange / spreadMin / spreadMax: spread aggregates in basis points.
  • mid / bestBid / bestAsk: top-of-book prices and midpoint.
  • open / high / low / close / quoteVolume / notionalM: kline fields and quote volume.
  • priceRangeBps / bodyBps / closeLocation: candle range, body, and where the close landed.
  • On a bar where nothing traded (common on thin markets off-hours), open/high/low/close carry the venue’s still-published quote (mark price, else the bid/ask mid) instead of reading zero — so moving averages and other lookbacks stay honest across quiet stretches.

Trade-Flow Variables

  • takerBuyRatio / takerSellRatio / avgTradeNotional: aggression and average trade size.
  • cvdHigh / cvdLow / cvdRange: intracandle cumulative volume delta.
  • buyRun / sellRun: largest same-side taker run (sweeps).
  • tradeMaxBuy / tradeMaxSell: largest single taker print (whale orders).
  • sweep: the bar’s dominant taker event in quote notional — the larger of the biggest single print and the longest same-side run, on whichever side is bigger. This is the exact quantity the built-in "Sweep (chart parity)" signal ranks.
  • sweepBuy / sweepSell: that same magnitude for each side on its own. sweepSide: +1 when the buy side dominated, -1 the sell side, 0 on a quiet bar.
  • cvdClose: session-anchored running CVD at bar close — compare with change(cvdClose, n), not as a raw level across long spans. A change that reaches across a data-feed restart reads n/a rather than a false burst of buying or selling, and a bar with no trades holds the level, so on a quiet market the next bar reads only its own trades.
  • tradeBuyCount / tradeSellCount: aggressor print counts per side — many small prints read differently than a few blocks.
  • cascadeScore: same-side burst intensity versus this market’s own norm — the forced-flow proxy on Hyperliquid. Scored on every timeframe; it needs ten prior traded bars of that timeframe, so a freshly listed market’s first bars carry none.

Derivatives & Microstructure Variables

  • funding / fundingBps: perp funding rate; positive means longs pay shorts.
  • basisBps / markPremiumBps: mark versus last trade and index.
  • oi / oiDelta / oiDeltaPct: open interest and its change.
  • liqBuy / liqSell / liqNotional / liqDelta: liquidation notional by side, total, and net — not populated on Hyperliquid (no public market-wide liquidation feed).
  • ofi, microprice / micropriceBps: order-flow imbalance and size-weighted fair value lean versus mid.
  • premiumBps: venue basis at bar close (mark vs oracle, bps) — positive means the perp is trading rich.
  • impactBidPx / impactAskPx / impactSpreadBps: the venue’s own impact prices and their spread versus mid — a ready-made slippage read.
  • oiHigh / oiLow: intracandle open-interest extremes — churn the close-to-close delta smooths away.
  • bidOrdersL1 / askOrdersL1: resting order counts at the touch — big size in one or two orders is the classic fake-depth tell.

Statistics & Universe

  • p / z: percentile and z-score of pressure versus recent history.
  • rank: trailing-volume rank across the Hyperliquid market universe.
  • age: seconds since the candle, for freshness filters.
  • btcRet / betaBtc / residBps: BTC’s bar return (bps), the market’s rolling 60-bar beta to BTC, and the residual — this bar’s return minus its beta-implied BTC component. residBps isolates a market moving on its own rather than with BTC.

Functions

  • Math: abs, max, min, avg, clamp, round, floor, ceil, sqrt, ln (natural log; non-positive inputs yield no value rather than firing), exp and tanh. barIndex() is the bar's position in the loaded history — only its differences mean anything, so it serves weighted sums and regressions, never dates.
  • Lookback (window 1-200 candles): prior(x, n), change(x, n), highest(x, n), lowest(x, n), sma(x, n), sum(x, n), stdev(x, n). Example: imb >= highest(imb, 50) — or a self-relative z-score of any expression: (imb - sma(imb, 50)) / stdev(imb, 50) >= 2.
  • median(x, n): the middle value over the last n candles. The robust baseline — a single outsized bar drags an average but not a median, so prefer it for notional metrics like sweeps and liquidations.
  • pctRank(x, n): where this candle’s x sits within its own last n candles, from 0 to 1 (1 = the highest of the window). This is how you say “big for THIS market” without picking a dollar threshold that fits BTC and misses everything else. Example: pctRank(sweep, 120) >= 0.94 fires on the top 6% of sweeps for whatever market it is scoring.
  • Indicators (period 2-200, on any series): rsi(x, n), ema(x, n), macd(x), atr(n). Example: rsi(imb, 14) <= 25 finds order-book "oversold".
  • Trailing stops: supertrend(n, factor) is the Supertrend stop price — an n-candle ATR × factor band that trails under price in an uptrend and over it in a downtrend — and sar(start, step, max) the Parabolic SAR, classically sar(0.02, 0.02, 0.2). Example: close > supertrend(10, 3) is "in a Supertrend uptrend"; crossUp(close, sar(0.02, 0.02, 0.2)) is "the SAR just flipped up".
  • Volume profile: poc(n), vaHigh(n) and vaLow(n) read the volume profile of the last n candles (2-200), with each candle's volume spread evenly over its high-low range. poc(n) is the point of control — the price that traded the most — and vaHigh(n) / vaLow(n) are the top and bottom of the value area, the band around it where 70% of the volume traded. Examples: close > vaHigh(24) is trading above value; (close - poc(24)) / poc(24) * 10000 is the distance from the POC in bps; poc(24) > prior(poc(24), 24) is value migrating up; close < prior(vaHigh(24), 24) && close > prior(vaLow(24), 24) is back inside the previous window's value area. For a 24-hour profile on any board, use tf(poc(24), 60). Built from candles rather than trades at each price, so read each level as a zone about a fiftieth of the window's range wide.
  • VWAP has no function of its own — write it from sums: sum((high + low + close) / 3 * baseVolume, n) / sum(baseVolume, n) is the volume-weighted average price of the last n candles, the same line the chart's VWAP study draws. Price against the 24-hour VWAP in bps on a 15-minute board is vw = sum((high + low + close) / 3 * baseVolume, 96) / sum(baseVolume, 96); (close - vw) / vw * 10000. Past 200 candles, read it from hourly candles: vw = tf(sum((high + low + close) / 3 * baseVolume, 24) / sum(baseVolume, 24), 60) is the last 24 closed hours on any board. The POC is the single most-traded price, not an average, so it is not a VWAP.
  • count(condition, n): how many of the last n candles met a condition. Example: count(oiDelta > 0, 5) >= 5.
  • Any expression can be the series a function reads: lowest(rsi(close, 14), 20), sma(close - open, 10), prior(rsi(close, 14), 5), count(rsi(close, 14) < 30, 5). Nested warm-ups add up, so lowest(rsi(close, 14), 20) needs 34 candles; keep a chain within 120 candles and alerts score it too.
  • Named parts: r = rsi(close, 14); r < 30 && r > prior(r, 1). Each name = …; part is substituted into what follows; the last part is the result. A name cannot be a variable or function the language already has (p, z, close, sma…) — the error names the word and offers a free one — and names live inside one formula: an indicator cannot read a part named in another, so each condition spells out what it needs.
  • Events: barsSince(condition) — candles since it last held. valueWhen(condition, x, k) — x at the k-th most recent candle where the condition held (0 = latest). pivotLow(x, left, right) / pivotHigh(x, left, right) — marks the candle that confirms a swing low / high; the swing itself is right candles back, read with prior(x, right). crossUp(a, b) / crossDown(a, b) — the candle a crosses b. onset(condition) — the first candle the condition holds (true now, not on the candle before): the transition edge as one word, so a handoff between two states fires once instead of staying lit for the whole state.
  • One thing after another is barsSince. "B, and A fired within the last N candles" is b && barsSince(a) <= N. "A still live — fired within N candles and B has not fired since" is barsSince(a) <= N && barsSince(b) > barsSince(a). Each stage is a condition; recency is the memory.
  • Read a saved screen by name: signal("Emerging") is 1 on the candles every condition of that screen holds (a signal combined All, or a single condition), so stages can be separate saved screens that read the one before them — developing && barsSince(signal("Emerging")) <= 20. It reads on the board's own timeframe (wrap it in tf() for another), its warm-up follows the chain, and editing the screen updates every formula reading it. A scored signal — consensus, linear or strict with several items — fires by vote, so it cannot be read this way: save its conditions as a screen. A screen cannot read itself, directly or through another, so a save that would close that loop is refused. When two signals share a name — a built-in beside a desk’s copy of it — they read as one if their conditions match; if they differ, the message names each one’s id to read instead, as signal("its-id").
  • tf(expression, minutes): the expression on another timeframe for the same market — minutes 1, 5, 15, 60, 240 or 1440. It reads the last of those candles that had closed by each candle on your board, so a value never changes after the fact. Example: tf(rsi(close, 14), 240) < 30 && crossUp(close, ema(close, 20)) — 4-hour RSI oversold while the 15-minute chart turns up. Every window inside tf() counts that timeframe's candles: tf(poc(24), 60) is the last day's point of control on any board, while tf(poc(24), 1440) would be the last 24 days'. Inside tf(), close is that timeframe's last closed candle, so to compare the price now keep close outside: close > tf(vaHigh(24), 60). Proof, the robustness sweep, your saved patterns and a signal read your AI files on the Workbench read it the same way, from closed candles only.
  • Looking ahead, for a Proof target only: fwd(x, n) is x n candles later — fwd(highest(high, 8), 8) / close - 1 > 0.05 is “5% higher within the next 8 candles”. It belongs in a target’s confirm, the check that an event really happened, when you grade a signal against your own event (see States, Transitions And Events). A signal, screen, regime, column or desk refuses it, because a live read can never see what comes next; past the last stored candle it reads n/a.
  • Putting it together — a bullish RSI divergence: pl = pivotLow(low, 3, 2); lo = prior(low, 2); r = prior(rsi(close, 14), 2); valueWhen(pl, lo, 0) < valueWhen(pl, lo, 1) && valueWhen(pl, r, 0) > valueWhen(pl, r, 1) && barsSince(pl) <= 5. Swap rsi(close, 14) for cvdClose to read a flow divergence instead.
  • Cross-sectional (this symbol vs the whole scanned universe, at the same bar): xsRank(x) percentile 0-100 vs the field, xsZ(x) z-score vs the field, xsMedian(x) the field’s median. Example: xsRank(ofi) >= 95 fires only when a market’s order-flow imbalance is in the top 5% of every market scanned right now.
  • deseason(x, n): hour-of-day deseasonalized z-score — how unusual x is right now versus its own history at the SAME time of day, over the last n candles. Stops a market that always moves at the US open from looking “unusual” just because it’s the open. Needs several days of same-hour history, so it’s most useful on 1h and higher intervals; on short intervals it abstains rather than guess. Example: deseason(imb, 200) >= 2.

Formula Habits

Write formulas that you can explain after a volatile candle. If a formula is impossible to reason about during live review, simplify it before trusting the output. The in-app reference (the docs button on the desk) lists every variable with its exact definition.

More docs

Try it on the live map

Open the desk and put this to work across 300+ Hyperliquid markets — free, no install, no password.

Open VYX