spb/hfmarketdata
Public
Open high-frequency market data platform — FirstRate full-history downloader, DuckDB/Parquet lake, open REST API and React docs platform (www.hfmarketdata.io)
JavaScript 53.7%
Python 38.3%
CSS 4.6%
TypeScript 3.1%
1# Fundamentals — ratio formulas23Generated from `hfmarketdata/api/fundamentals/ratios.py` (`render_docs()`); do not edit by hand.45Conventions: flows are trailing twelve months (sum of the last four discrete quarters — or the fiscal year with `period=annual`), balances are the latest balance sheet, `price` is the last close known at the valuation date. A ratio is `null` (with a reason in `meta.reasons`) whenever an input is missing or the denominator is not positive — nothing is ever invented.67## Valuation89### `market_cap`1011`market_cap = price × shares_outstanding`1213`shares_outstanding` is the cover-page share count (dei:EntityCommonStockSharesOutstanding, all14classes summed) of the latest filing known at the valuation date; falls back to weighted-average15diluted shares (flagged `shares_source=weighted_diluted`).1617Inputs: `price`, `shares_outstanding`1819### `enterprise_value`2021`enterprise_value = market_cap + total_debt − cash_and_equivalents − short_term_investments`2223Missing `short_term_investments` is treated as 0 (flagged); missing `total_debt` is treated as 0 only24when the balance sheet has no debt account at all (flagged `total_debt_assumed_zero`).2526Inputs: `market_cap`, `total_debt`, `cash_and_equivalents`, `short_term_investments`2728### `pe`2930`pe = price / eps_diluted (TTM)`3132Null when TTM diluted EPS ≤ 0 (a negative P/E is not meaningful).3334Inputs: `price`, `eps_diluted`3536### `forward_pe`3738`forward_pe = price / forward_eps`3940HF Market Data does not carry analyst consensus estimates, so `forward_eps` is never available41and `forward_pe` is **always null** with reason `no_estimates` — we do not extrapolate.4243Inputs: `forward_eps`4445### `pb`4647`pb = market_cap / total_equity`4849Null when book equity ≤ 0.5051Inputs: `market_cap`, `total_equity`5253### `ps`5455`ps = market_cap / revenue (TTM)`5657Inputs: `market_cap`, `revenue`5859### `ev_ebitda`6061`ev_ebitda = enterprise_value / ebitda (TTM)`6263Null when EBITDA ≤ 0.6465Inputs: `enterprise_value`, `ebitda`6667### `ev_sales`6869`ev_sales = enterprise_value / revenue (TTM)`7071Inputs: `enterprise_value`, `revenue`7273### `ev_fcf`7475`ev_fcf = enterprise_value / free_cash_flow (TTM)`7677Null when FCF ≤ 0.7879Inputs: `enterprise_value`, `free_cash_flow`8081### `earnings_yield`8283`earnings_yield = net_income (TTM) / market_cap`8485Inputs: `net_income`, `market_cap`8687### `fcf_yield`8889`fcf_yield = free_cash_flow (TTM) / market_cap`9091Inputs: `free_cash_flow`, `market_cap`9293### `dividend_yield`9495`dividend_yield = dividends paid (TTM, cash flow statement) / market_cap`9697Inputs: `dividends`, `market_cap`9899### `buyback_yield`100101`buyback_yield = buybacks (TTM, cash paid for repurchases) / market_cap`102103Inputs: `buybacks`, `market_cap`104105## Profitability106107### `gross_margin`108109`gross_margin = gross_profit / revenue (TTM)`110111Inputs: `gross_profit`, `revenue`112113### `operating_margin`114115`operating_margin = operating_income / revenue (TTM)`116117Inputs: `operating_income`, `revenue`118119### `net_margin`120121`net_margin = net_income / revenue (TTM)`122123Inputs: `net_income`, `revenue`124125### `ebitda_margin`126127`ebitda_margin = ebitda / revenue (TTM)`128129Inputs: `ebitda`, `revenue`130131### `fcf_margin`132133`fcf_margin = free_cash_flow / revenue (TTM)`134135Inputs: `free_cash_flow`, `revenue`136137### `roe`138139`roe = net_income (TTM) / total_equity (latest)`140141Uses the latest book equity, not the average — simpler and point-in-time consistent. Null when142equity ≤ 0.143144Inputs: `net_income`, `total_equity`145146### `roa`147148`roa = net_income (TTM) / total_assets (latest)`149150Inputs: `net_income`, `total_assets`151152### `roic`153154`roic = operating_income × (1 − tax_rate) / (total_debt + total_equity − cash_and_equivalents)`155156`tax_rate` = income_tax / pretax_income (TTM), only accepted in [0, 1]; when the effective rate is157not computable the ratio is null (`tax_rate_unavailable`) — no statutory rate is assumed. Null when158invested capital ≤ 0.159160Inputs: `operating_income`, `income_tax`, `pretax_income`, `total_debt`, `total_equity`, `cash_and_equivalents`161162## Liquidity163164### `current_ratio`165166`current_ratio = total_current_assets / total_current_liabilities`167168Inputs: `total_current_assets`, `total_current_liabilities`169170### `quick_ratio`171172`quick_ratio = (cash_and_equivalents + short_term_investments + receivables) / total_current_liabilities`173174Missing short_term_investments or receivables are treated as 0 (flagged).175176Inputs: `cash_and_equivalents`, `short_term_investments`, `receivables`, `total_current_liabilities`177178### `cash_ratio`179180`cash_ratio = (cash_and_equivalents + short_term_investments) / total_current_liabilities`181182Inputs: `cash_and_equivalents`, `short_term_investments`, `total_current_liabilities`183184## Solvency185186### `debt_to_equity`187188`debt_to_equity = total_debt / total_equity`189190Null when equity ≤ 0.191192Inputs: `total_debt`, `total_equity`193194### `debt_to_assets`195196`debt_to_assets = total_debt / total_assets`197198Inputs: `total_debt`, `total_assets`199200### `net_debt_to_ebitda`201202`net_debt_to_ebitda = net_debt / ebitda (TTM)`203204Null when EBITDA ≤ 0.205206Inputs: `net_debt`, `ebitda`207208### `interest_coverage`209210`interest_coverage = operating_income / interest_expense (TTM)`211212Null when interest expense is 0 or not reported.213214Inputs: `operating_income`, `interest_expense`215216## Efficiency217218### `asset_turnover`219220`asset_turnover = revenue (TTM) / total_assets (latest)`221222Inputs: `revenue`, `total_assets`223224### `inventory_turnover`225226`inventory_turnover = cost_of_revenue (TTM) / inventory (latest)`227228Inputs: `cost_of_revenue`, `inventory`229230### `receivables_turnover`231232`receivables_turnover = revenue (TTM) / receivables (latest)`233234Inputs: `revenue`, `receivables`235236### `days_sales_outstanding`237238`days_sales_outstanding = 365 × receivables / revenue (TTM)`239240Inputs: `receivables`, `revenue`241242### `cash_conversion_cycle`243244`cash_conversion_cycle = DSO + DIO − DPO`245246DSO = 365 × receivables / revenue · DIO = 365 × inventory / cost_of_revenue ·247DPO = 365 × accounts_payable / cost_of_revenue (all flows TTM, balances latest).248249Inputs: `receivables`, `revenue`, `inventory`, `accounts_payable`, `cost_of_revenue`250251## Growth252253### `revenue_growth_yoy`254255`revenue_growth_yoy = revenue (TTM) / revenue (TTM one year earlier) − 1`256257Inputs: `revenue`, `revenue_prev_year`258259### `revenue_growth_qoq`260261`revenue_growth_qoq = revenue (latest quarter) / revenue (previous quarter) − 1`262263Inputs: `revenue_q`, `revenue_prev_quarter`264265### `eps_growth_yoy`266267`eps_growth_yoy = eps_diluted (TTM) / eps_diluted (TTM one year earlier) − 1`268269Null when the base EPS ≤ 0.270271Inputs: `eps_diluted`, `eps_diluted_prev_year`272273### `fcf_growth_yoy`274275`fcf_growth_yoy = free_cash_flow (TTM) / free_cash_flow (TTM one year earlier) − 1`276277Inputs: `free_cash_flow`, `free_cash_flow_prev_year`278279### `revenue_cagr_3y`280281`revenue_cagr_3y = (revenue TTM / revenue TTM 3 years earlier)^(1/3) − 1`282283Inputs: `revenue`, `revenue_3y`284285### `revenue_cagr_5y`286287`revenue_cagr_5y = (revenue TTM / revenue TTM 5 years earlier)^(1/5) − 1`288289Inputs: `revenue`, `revenue_5y`290291### `revenue_cagr_10y`292293`revenue_cagr_10y = (revenue TTM / revenue TTM 10 years earlier)^(1/10) − 1`294295Inputs: `revenue`, `revenue_10y`296297### `eps_cagr_5y`298299`eps_cagr_5y = (eps_diluted TTM / eps_diluted TTM 5 years earlier)^(1/5) − 1`300301Inputs: `eps_diluted`, `eps_diluted_5y`302303## Per Share304305### `revenue_ps`306307`revenue_ps = revenue (TTM) / shares_diluted (weighted average, latest quarter)`308309Inputs: `revenue`, `shares_diluted`310311### `book_value_ps`312313`book_value_ps = total_equity / shares_outstanding`314315Inputs: `total_equity`, `shares_outstanding`316317### `fcf_ps`318319`fcf_ps = free_cash_flow (TTM) / shares_diluted`320321Inputs: `free_cash_flow`, `shares_diluted`322323### `cash_ps`324325`cash_ps = (cash_and_equivalents + short_term_investments) / shares_outstanding`326327Inputs: `cash_and_equivalents`, `short_term_investments`, `shares_outstanding`328