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

NameTypeRequiredDescription
symbolstringYesTicker symbol (e.g. AAPL, BTCUSD). Case-insensitive.

Response

FieldTypeDescription
symbolstringThe normalised (uppercase) symbol
dataobject | nullLatest 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:

FieldUI LabelWindowsDescription
byteTrendLocal200wLocal (Weekly)200w / 30w / 30w on closeWeekly ByteTrend on local price
byteTrendLocal30dLocal (Daily)200d / 30d / 20d on closeDaily ByteTrend on local price
byteTrendCapr200wCAPR (Weekly)200w / 30w / 30w on CAPRWeekly ByteTrend on CAPR
byteTrendCapr30dCAPR (Daily)200d / 30d / 20d on CAPRDaily ByteTrend on CAPR

Each score has companion fields that share the same suffix:

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).

FieldDescription
localMaLong200w / localMaShort30w200-week / 30-week SMA of local close
localMaLong200d / localMaShort30d200-day / 30-day SMA of local close
caprMaLong200w / caprMaShort30w200-week / 30-week SMA of CAPR
caprMaLong200d / caprMaShort30d200-day / 30-day SMA of CAPR
localMaLong200wSlope / localMaShort30wSlopeDay-over-day slope of Weekly Local MAs
caprMaLong200wSlope / caprMaShort30wSlopeDay-over-day slope of Weekly CAPR MAs
localMaLong200dSlope / localMaShort30dSlopeDay-over-day slope of Daily Local MAs
caprMaLong200dSlope / caprMaShort30dSlopeDay-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).

FieldDescription
localMax20d / localMin20d20-day rolling high/low on local close (used by Daily score’s lastTouchMax rule)
caprMax20d / caprMin20d20-day rolling high/low on CAPR
localMax30d / localMin30d30-day rolling high/low on local close (used by Daily score regime classification)
caprMax30d / caprMin30d30-day rolling high/low on CAPR
localMax20w / localMin20w20-week rolling high/low on local close
caprMax20w / caprMin20w20-week rolling high/low on CAPR
localMax200w200-week rolling high on local close
caprMax200w200-week rolling high on CAPR

Deviations

FieldDescription
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 / devFromCaprLow30d30-day CAPR equivalents
devFromLocalHigh30w / devFromLocalHigh200w% below 30-week / 200-week high (local)
devFromLocalLow30w% above 30-week low (local)
devFromCaprHigh30w / devFromCaprHigh200w / devFromCaprLow30wCAPR 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).

FieldTypeDescription
trendRegimeLocal200w / trendRegimeLocal30dstringTrend regime for Weekly / Daily Local score
trendRegimeCapr200w / trendRegimeCapr30dstringTrend regime for Weekly / Daily CAPR score
confirmedRegimeCapr200wstringWeekly CAPR regime (trendRegimeCapr200w) that has persisted for ≥ 5 consecutive days (absorbs short flip-flops)
pendingRegimeCapr200wstring | nullCandidate Weekly CAPR regime waiting on the 5-day confirmation threshold; null once it promotes to confirmedRegimeCapr200w
pendingRegimeCount200wnumberDays the current pendingRegimeCapr200w has been pending
trendAge200wnumberDays since confirmedRegimeCapr200w last changed
consecLocal200w5 / consecLocal200w0numberConsecutive days at Weekly Local score 5 or 0
consecLocal30d5 / consecLocal30d0numberConsecutive days at Daily Local score 5 or 0
consecCapr200w5 / consecCapr200w0numberConsecutive days at Weekly CAPR score 5 or 0
consecCapr30d5 / consecCapr30d0numberConsecutive days at Daily CAPR score 5 or 0

Possible trend regime values (same for all four scores):

RegimeCondition
Leading TrendScore = 5 AND at 30-week high
Emerging TrendScore > 0 AND at 30-week high (but not 5)
Weakening TrendScore > 0 AND at 30-week low
Bear TrendScore = 0 AND at 30-week low
NeutralAll other states

Trend Quality & Conviction

FieldTypeDescription
divergenceLocalnumberDaily Local − Weekly Local divergence (positive = Daily stronger)
divergenceCaprnumberDaily CAPR − Weekly CAPR divergence
scoreVelocity5d200wnumber5-day average change in byteTrendLocal200w
volumeConfirmation30dnumberCurrent volume / 30-day average volume (null for indices)
cumulHighs12wnumberCount 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

FieldTypeDescription
volatility30wnumberAnnualised 30-week volatility (√252 stocks, √365 crypto)
sharpe52wnumberRolling 52-week Sharpe ratio (configurable risk-free rate, default 3.5%)
beta52wnumberRolling 52-week beta vs MSCI World benchmark
returnVolRationumber12-month return / 30-week volatility (risk-adjusted momentum)

Drawdown

FieldTypeDescription
drawdown52wnumberCurrent % below 52-week high (always ≤ 0)
drawdownATHnumberCurrent % below adjusted-close all-time high (always ≤ 0)
allTimeHighAdjUsdnumberRunning all-time high in USD on adjusted close (post split/dividend adjustments)
maxDrawdown30wnumberWorst peak-to-trough in trailing 30 weeks
maxDrawdown52wnumberWorst peak-to-trough in trailing 52 weeks

Performance Returns (USD)

FieldDescription
returnUsd1W / returnUsd1M / returnUsd3M / returnUsd6M / returnUsd12MBackward-looking returns as decimals (0.05 = 5%)
returnFwdUsd1DForward 1-day return (filled retroactively for backtesting)
returnFwdUsd3DForward 3-day return
returnFwdUsd1WForward 1-week return
returnFwdUsd1MForward 1-month return
returnFwdUsd3MForward 3-month return
returnFwdUsd6MForward 6-month return
returnFwdUsd12MForward 12-month return

Relative Strength (vs MSCI World)

FieldDescription
relStrengthRaw1M / relStrengthRaw3M / relStrengthRaw12MAsset return / benchmark return (unbounded)
relStrengthCapped1M / relStrengthCapped3M / relStrengthCapped12MLog-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.

FieldTypeDescription
closeUsdnumberSplit-adjusted close price in USD
caprnumberCapital Appreciation Return — split-adjusted close ÷ MSCI World adjusted close
marketCapUsdnumber | nullMarket cap in USD on split-adjusted close
closeRawUsdnumberRaw market-printed USD close (preserves split discontinuities)
caprRawnumberRaw close ÷ MSCI World raw close
marketCapRawUsdnumber | nullMarket cap in USD on raw close

Notes