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.

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 chart’s Sweeps layer 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.
  • 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 (available on 1m/5m/15m bars).

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).
  • 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".
  • count(condition, n): how many of the last n candles met a condition. Example: count(oiDelta > 0, 5) >= 5.
  • 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 — no install, no account.

Open VYX