Latest Metrics
Returns the most recent computed metrics snapshot for a symbol. Useful for displaying current-values panels — ByteTrend scores, trend analysis, risk metrics, and performance data.
When the symbol matches an FX pair (e.g. EURUSD) and no PriceData-derived metrics exist, the endpoint falls back to FX rate data so polymorphic consumers can resolve any tracked symbol through a single path. For FX-only views, /api/fx/:symbol is the canonical zero-ambiguity surface; for a single-shot dashboard read across all symbols, /api/metrics/latest returns a symbol-keyed map.
Request
curl https://api.bytetree.io/api/metrics/AAPL/latest
# Crypto
curl https://api.bytetree.io/api/metrics/BTCUSD/latest
Path Parameters
| Name | Type | Required | Description |
|---|
symbol | string | Yes | Ticker symbol (e.g. AAPL, BTCUSD). Case-insensitive. |
Response
| Field | Type | Description |
|---|
symbol | string | The normalised (uppercase) symbol |
data | object | null | Latest metrics record, or null if no computed data exists |
The data object contains date, close, and all computed metric fields at the top level (see below).
All numeric fields default to split-adjusted close. Every time-series metric (MAs, slopes, rolling highs/lows, ByteTrend scores, deviations, drawdowns, returns, risk) and the quoted-state fields under Valuation (closeUsd, capr, marketCapUsd) are all computed on split-adjusted close. Three explicit raw counterparts (closeRawUsd, caprRaw, marketCapRawUsd) are available for forensic / market-printed-price views. See the Data Model page for the rationale and the Changelog for cutover history.
ByteTrend Scores (0–5)
Four collision-free scores covering two dimensions:
- Local vs CAPR — local close vs CAPR (close ÷ MSCI World close)
- Weekly (
200w) vs Daily (30d) — long-horizon weekly windows vs short-horizon daily windows
| Field | UI Label | Windows | Description |
|---|
byteTrendLocal200w | Local (Weekly) | 200w / 30w / 30w on close | Weekly ByteTrend on local price |
byteTrendLocal30d | Local (Daily) | 200d / 30d / 20d on close | Daily ByteTrend on local price |
byteTrendCapr200w | CAPR (Weekly) | 200w / 30w / 30w on CAPR | Weekly ByteTrend on CAPR |
byteTrendCapr30d | CAPR (Daily) | 200d / 30d / 20d on CAPR | Daily ByteTrend on CAPR |
Each score has companion fields that share the same suffix:
*Rules — the five binary rules that compose the score (booleans: aboveMaLong, aboveMaShort, maLongRising, maShortRising, lastTouchMax)
change* — day-over-day change (range −5 to +5)
trendRegime* — trend regime classification (see Trend Regime)
consec*5 / consec*0 — consecutive days at score 5 or 0
Full set per score, e.g. for Local (Weekly): byteTrendLocal200w, byteTrendLocal200wRules, changeLocal200w, trendRegimeLocal200w, consecLocal200w5, consecLocal200w0. Three equivalent sets exist for Local30d, Capr200w, Capr30d.
Moving Averages
Long/short SMAs for each dimension and window. Every suffix denotes the actual window of that field. Slopes measure day-over-day MA change (trend acceleration).
| Field | Description |
|---|
localMaLong200w / localMaShort30w | 200-week / 30-week SMA of local close |
localMaLong200d / localMaShort30d | 200-day / 30-day SMA of local close |
caprMaLong200w / caprMaShort30w | 200-week / 30-week SMA of CAPR |
caprMaLong200d / caprMaShort30d | 200-day / 30-day SMA of CAPR |
localMaLong200wSlope / localMaShort30wSlope | Day-over-day slope of Weekly Local MAs |
caprMaLong200wSlope / caprMaShort30wSlope | Day-over-day slope of Weekly CAPR MAs |
localMaLong200dSlope / localMaShort30dSlope | Day-over-day slope of Daily Local MAs |
caprMaLong200dSlope / caprMaShort30dSlope | Day-over-day slope of Daily CAPR MAs |
Rolling Highs & Lows
Two daily windows (used by Daily score regime classification and lastTouchMax rule respectively) and two weekly windows (the 20-week rolling high/low and 200-week trend context).
| Field | Description |
|---|
localMax20d / localMin20d | 20-day rolling high/low on local close (used by Daily score’s lastTouchMax rule) |
caprMax20d / caprMin20d | 20-day rolling high/low on CAPR |
localMax30d / localMin30d | 30-day rolling high/low on local close (used by Daily score regime classification) |
caprMax30d / caprMin30d | 30-day rolling high/low on CAPR |
localMax20w / localMin20w | 20-week rolling high/low on local close |
caprMax20w / caprMin20w | 20-week rolling high/low on CAPR |
localMax200w | 200-week rolling high on local close |
caprMax200w | 200-week rolling high on CAPR |
Deviations
| Field | Description |
|---|
devFromLocalMaLong200w | % deviation from 200-week local MA |
devFromCaprMaLong200w | % deviation from 200-week CAPR MA |
devFromLocalHigh30d / devFromLocalLow30d | % below 30-day high / above 30-day low (local) |
devFromCaprHigh30d / devFromCaprLow30d | 30-day CAPR equivalents |
devFromLocalHigh30w / devFromLocalHigh200w | % below 30-week / 200-week high (local) |
devFromLocalLow30w | % above 30-week low (local) |
devFromCaprHigh30w / devFromCaprHigh200w / devFromCaprLow30w | CAPR equivalents |
Trend Regime
Trend regimes classify assets based on their ByteTrend score combined with whether the score is at its 30-week high or low. This is more informative than the raw score alone — it captures whether a trend is strengthening (new highs) or deteriorating (at lows).
| Field | Type | Description |
|---|
trendRegimeLocal200w / trendRegimeLocal30d | string | Trend regime for Weekly / Daily Local score |
trendRegimeCapr200w / trendRegimeCapr30d | string | Trend regime for Weekly / Daily CAPR score |
confirmedRegimeCapr200w | string | Weekly CAPR regime (trendRegimeCapr200w) that has persisted for ≥ 5 consecutive days (absorbs short flip-flops) |
pendingRegimeCapr200w | string | null | Candidate Weekly CAPR regime waiting on the 5-day confirmation threshold; null once it promotes to confirmedRegimeCapr200w |
pendingRegimeCount200w | number | Days the current pendingRegimeCapr200w has been pending |
trendAge200w | number | Days since confirmedRegimeCapr200w last changed |
consecLocal200w5 / consecLocal200w0 | number | Consecutive days at Weekly Local score 5 or 0 |
consecLocal30d5 / consecLocal30d0 | number | Consecutive days at Daily Local score 5 or 0 |
consecCapr200w5 / consecCapr200w0 | number | Consecutive days at Weekly CAPR score 5 or 0 |
consecCapr30d5 / consecCapr30d0 | number | Consecutive days at Daily CAPR score 5 or 0 |
Possible trend regime values (same for all four scores):
| Regime | Condition |
|---|
| Leading Trend | Score = 5 AND at 30-week high |
| Emerging Trend | Score > 0 AND at 30-week high (but not 5) |
| Weakening Trend | Score > 0 AND at 30-week low |
| Bear Trend | Score = 0 AND at 30-week low |
| Neutral | All other states |
Trend Quality & Conviction
| Field | Type | Description |
|---|
divergenceLocal | number | Daily Local − Weekly Local divergence (positive = Daily stronger) |
divergenceCapr | number | Daily CAPR − Weekly CAPR divergence |
scoreVelocity5d200w | number | 5-day average change in byteTrendLocal200w |
volumeConfirmation30d | number | Current volume / 30-day average volume (null for indices) |
cumulHighs12w | number | Count of new highs within trailing 12-week window |
Historical divergence values — before the 2026-04-22 cutover divergenceLocal / divergenceCapr compared the Daily score against a VWAP-weighted weekly score. They now compare Daily against the true 200w-window weekly score. Keys and units are unchanged, but values pre- and post-cutover are not directly comparable in historical series.
Risk Metrics
| Field | Type | Description |
|---|
volatility30w | number | Annualised 30-week volatility (√252 stocks, √365 crypto) |
sharpe52w | number | Rolling 52-week Sharpe ratio (configurable risk-free rate, default 3.5%) |
beta52w | number | Rolling 52-week beta vs MSCI World benchmark |
returnVolRatio | number | 12-month return / 30-week volatility (risk-adjusted momentum) |
Drawdown
| Field | Type | Description |
|---|
drawdown52w | number | Current % below 52-week high (always ≤ 0) |
drawdownATH | number | Current % below adjusted-close all-time high (always ≤ 0) |
allTimeHighAdjUsd | number | Running all-time high in USD on adjusted close (post split/dividend adjustments) |
maxDrawdown30w | number | Worst peak-to-trough in trailing 30 weeks |
maxDrawdown52w | number | Worst peak-to-trough in trailing 52 weeks |
| Field | Description |
|---|
returnUsd1W / returnUsd1M / returnUsd3M / returnUsd6M / returnUsd12M | Backward-looking returns as decimals (0.05 = 5%) |
returnFwdUsd1D | Forward 1-day return (filled retroactively for backtesting) |
returnFwdUsd3D | Forward 3-day return |
returnFwdUsd1W | Forward 1-week return |
returnFwdUsd1M | Forward 1-month return |
returnFwdUsd3M | Forward 3-month return |
returnFwdUsd6M | Forward 6-month return |
returnFwdUsd12M | Forward 12-month return |
Relative Strength (vs MSCI World)
| Field | Description |
|---|
relStrengthRaw1M / relStrengthRaw3M / relStrengthRaw12M | Asset return / benchmark return (unbounded) |
relStrengthCapped1M / relStrengthCapped3M / relStrengthCapped12M | Log-scaled version for display |
Valuation
The default trio represents the latest quoted state on split-adjusted close — matching the basis used by every time-series metric on this page. The *Raw trio exposes the same values on raw close for forensic or audit consumers; see Data Model.
| Field | Type | Description |
|---|
closeUsd | number | Split-adjusted close price in USD |
capr | number | Capital Appreciation Return — split-adjusted close ÷ MSCI World adjusted close |
marketCapUsd | number | null | Market cap in USD on split-adjusted close |
closeRawUsd | number | Raw market-printed USD close (preserves split discontinuities) |
caprRaw | number | Raw close ÷ MSCI World raw close |
marketCapRawUsd | number | null | Market cap in USD on raw close |
Notes
- Returns the most recent record that has computed metrics; dates without a completed computation run are skipped
- ByteTrend scores range from 0 (fully bearish) to 5 (fully bullish), computed from 5 binary rules
- Sharpe ratio risk-free rate is configurable in engine config (default 3.5%)
- Returns
{ "symbol": "BTCUSD", "data": null } if no computed data exists for the symbol