gloomberb 0.20.12 → 0.20.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/account/billing.ts +3 -2
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -33
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/cli/commands/market.ts +51 -32
- package/src/cli/commands/overview.ts +3 -3
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +9 -0
- package/src/cli/listing-arg.ts +105 -18
- package/src/cli/pane-functions/catalog.ts +55 -7
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +8 -8
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +2 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +101 -15
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +20 -9
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +101 -32
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +1 -1
- package/src/i18n/es.ts +5 -2
- package/src/i18n/ja.ts +5 -2
- package/src/i18n/ko.ts +5 -2
- package/src/i18n/zh-cn.ts +5 -2
- package/src/i18n/zh-tw.ts +5 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +13 -13
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-model.ts +6 -6
- package/src/plugins/builtin/analytics/risk-pane.tsx +6 -5
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +7 -3
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +4 -3
- package/src/plugins/builtin/cpi/model.ts +8 -7
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/model.ts +4 -3
- package/src/plugins/builtin/crypto-board/pane.tsx +8 -8
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +7 -3
- package/src/plugins/builtin/dividend-yield/headless.ts +16 -11
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +19 -11
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +3 -3
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +14 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +2 -2
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +4 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +6 -5
- package/src/plugins/builtin/macro-day/model.ts +2 -1
- package/src/plugins/builtin/macro-day/pane.tsx +4 -4
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/headless.ts +2 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +4 -4
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +2 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -4
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +7 -5
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/overview/model.ts +24 -13
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +33 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/column-values.ts +47 -41
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +2 -0
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/tickers/company-name-listing.ts +2 -2
- package/src/tickers/company-name.ts +17 -1
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/index.ts +19 -0
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +15 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/financial-statements.ts +39 -15
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -9,7 +9,7 @@ import { barCloseSession } from "../../market-data/market/bar-period";
|
|
|
9
9
|
import type { EarningsEvent, MarketDataRequestContext, QuoteBatchResult, QuoteSubscriptionTarget, SecFilingItem } from "../../types/data-provider";
|
|
10
10
|
import { companyDataNotes, type CompanyFrom } from "../../types/company-from";
|
|
11
11
|
import type { NewsArticle, NewsFeed, NewsQuery } from "../../news/types";
|
|
12
|
-
import { newsSummaryLine } from "../../news/news-model";
|
|
12
|
+
import { listedRowHeadline, newsSummaryLine, routineNoticeFields } from "../../news/news-model";
|
|
13
13
|
import { shortStoryId } from "../../news/story-id";
|
|
14
14
|
import type {
|
|
15
15
|
AnalystResearchData,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
quoteSessionStateLabel,
|
|
34
34
|
type ExtendedSession,
|
|
35
35
|
} from "../../market-data/market/status";
|
|
36
|
-
import { formatCompact, formatCurrency, formatDistributionAmount, formatNumber, formatPercent } from "../../utils/format";
|
|
36
|
+
import { MISSING_VALUE, formatCompact, formatCurrency, formatDistributionAmount, formatNumber, formatPercent } from "../../utils/format";
|
|
37
37
|
import { withCliServices, withMarketData } from "../context";
|
|
38
38
|
import { isoDate, parsePositiveInt, requireOneArg, takeFlag, takeOption, typedCompanyName } from "./command-utils";
|
|
39
39
|
import type { BuiltinCliCommandDef } from "../command-options";
|
|
@@ -234,7 +234,7 @@ import { DAY_SO_FAR_TEXT, dailyOrLongerBarSize, withSessionBar } from "../../tim
|
|
|
234
234
|
import { requestedBarSize } from "../../time-series/bar-spacing";
|
|
235
235
|
import { isFiniteNumber } from "../../utils/guards";
|
|
236
236
|
import { exportedFundamentals } from "../../utils/price-earnings";
|
|
237
|
-
import {
|
|
237
|
+
import { withFinancialEnterpriseValue } from "../../utils/fundamentals";
|
|
238
238
|
import { fundamentalsFreshness, quotesFreshness, rowsFreshness, valuationFreshness } from "../freshness";
|
|
239
239
|
import { fxPairListing, fxQuoteRateMove, fxQuoteRateObservation, METAL_NAMES, readFxQuoteRate } from "../fx-quote-rate";
|
|
240
240
|
import { quoteBarNotes } from "../../market-data/quotes/intraday-bar";
|
|
@@ -265,6 +265,7 @@ import {
|
|
|
265
265
|
import {
|
|
266
266
|
calendarEventOf,
|
|
267
267
|
calendarStatus,
|
|
268
|
+
listingDay,
|
|
268
269
|
newYorkDay,
|
|
269
270
|
resolveListingEvents,
|
|
270
271
|
withResolvedEarnings,
|
|
@@ -308,7 +309,7 @@ import {
|
|
|
308
309
|
analyzeTaxEquivalent, distributionBasis, loadTreasuryTenors, noBondFigures, parseTaxRates, TAX_RATE_HELP_OPTIONS, taxEquivalentJson, type TaxRates,
|
|
309
310
|
} from "../../market-data/tax-equivalent";
|
|
310
311
|
import { CBOE_YIELD_INDEX_CLOSE } from "../../plugins/builtin/shared/treasury-cutoffs";
|
|
311
|
-
import { earningsCalendarFailure, earningsChoiceNote, earningsDateLabel,
|
|
312
|
+
import { earningsCalendarFailure, earningsChoiceNote, earningsDateLabel, undatedListingNote } from "../earnings-calendar";
|
|
312
313
|
import { formatBasisPoints, toBasisPoints } from "../../utils/basis-points";
|
|
313
314
|
import { isUnservedWithoutReason, notATickerSymbol, providerMissReason } from "../../sources/provider-errors";
|
|
314
315
|
import { isNetworkFailure } from "../../utils/network-failure";
|
|
@@ -1022,6 +1023,8 @@ function newsRows(articles: NewsArticle[]) {
|
|
|
1022
1023
|
url: article.url,
|
|
1023
1024
|
importance: article.importance,
|
|
1024
1025
|
breaking: article.isBreaking,
|
|
1026
|
+
// A row standing for a company's routine notices (a buy-back's daily ones): how many, since when.
|
|
1027
|
+
...routineNoticeFields(article),
|
|
1025
1028
|
}));
|
|
1026
1029
|
}
|
|
1027
1030
|
|
|
@@ -1059,16 +1062,16 @@ function analystSummary(data: AnalystResearchData, quote: Quote | null): string
|
|
|
1059
1062
|
const mix = formatRecommendationMix(data);
|
|
1060
1063
|
const entries: Array<[string, string]> = [
|
|
1061
1064
|
["Average Target", formatAnalystPrice(target?.average, currency)],
|
|
1062
|
-
["Upside", upside == null ?
|
|
1063
|
-
["Upside vs", upside == null ?
|
|
1065
|
+
["Upside", upside == null ? MISSING_VALUE : formatPercent(upside)],
|
|
1066
|
+
["Upside vs", upside == null ? MISSING_VALUE : formatAnalystReference(reference, currency)],
|
|
1064
1067
|
["Low / Median / High", target && [target.low, target.median, target.high].some((value) => value != null)
|
|
1065
1068
|
? [target.low, target.median, target.high].map((value) => formatAnalystPrice(value, currency)).join(" / ")
|
|
1066
|
-
:
|
|
1069
|
+
: MISSING_VALUE],
|
|
1067
1070
|
["Rating", formatRatingLabel(data.recommendationRating)],
|
|
1068
|
-
["Analysts", analysts == null ?
|
|
1071
|
+
["Analysts", analysts == null ? MISSING_VALUE : String(analysts)],
|
|
1069
1072
|
["Mix", mix],
|
|
1070
1073
|
];
|
|
1071
|
-
const populated = entries.filter(([, value]) => value !==
|
|
1074
|
+
const populated = entries.filter(([, value]) => value !== MISSING_VALUE);
|
|
1072
1075
|
return populated.length > 0 ? renderStats(populated) : "";
|
|
1073
1076
|
}
|
|
1074
1077
|
|
|
@@ -1103,7 +1106,7 @@ function corporateActionRows(data: CorporateActionsData) {
|
|
|
1103
1106
|
const earningsCurrency = reportedCurrencies.size === 1 ? [...reportedCurrencies][0] : undefined;
|
|
1104
1107
|
// To the cent, as ERN and EE show it; a consensus average carries more digits.
|
|
1105
1108
|
const eps = (value: number | undefined, unit: string | undefined) => (
|
|
1106
|
-
value == null || !Number.isFinite(value) ?
|
|
1109
|
+
value == null || !Number.isFinite(value) ? MISSING_VALUE
|
|
1107
1110
|
: !unit ? formatNumber(value, 2)
|
|
1108
1111
|
: /^[A-Z]{3}$/.test(unit) ? formatCurrency(value, unit, 2) : `${formatNumber(value, 2)} ${unit}`
|
|
1109
1112
|
);
|
|
@@ -1113,7 +1116,7 @@ function corporateActionRows(data: CorporateActionsData) {
|
|
|
1113
1116
|
const quarter = quarterLabel(event.fiscalPeriod);
|
|
1114
1117
|
const basis = earningsEpsBasis(event.epsBasis);
|
|
1115
1118
|
// History rows are keyed by fiscal quarter end, upcoming ones by announcement date.
|
|
1116
|
-
const note = [event.dateType === "fiscal-period-end" ? "period end" : null, quarter ===
|
|
1119
|
+
const note = [event.dateType === "fiscal-period-end" ? "period end" : null, quarter === MISSING_VALUE ? null : quarter].filter(Boolean).join(", ");
|
|
1117
1120
|
return {
|
|
1118
1121
|
type: "earnings",
|
|
1119
1122
|
date: event.date,
|
|
@@ -1313,7 +1316,9 @@ async function runQuote(rawArgs: string[], ctx: Parameters<CliCommandDef["execut
|
|
|
1313
1316
|
// quote can fail where its history still says when it stopped (FRC), and an unreachable service fails it at once.
|
|
1314
1317
|
// The service's "not a ticker" for a bare symbol says no listing anywhere carries it, so no bars or search row
|
|
1315
1318
|
// would say it stopped: a symbol it knows from before answers its last quote or no data, never that.
|
|
1316
|
-
|
|
1319
|
+
// A symbol several companies list asks which, whatever line of it once stopped (MBG: Mercedes-Benz on Xetra, MB Gold on ASX).
|
|
1320
|
+
const lastTraded = await Promise.all(answers.map(async ({ result, listing, failure }) => !result.quote && !failure?.choose
|
|
1321
|
+
&& answers.length <= MAX_CHOICE_LOOKUPS
|
|
1317
1322
|
&& (listing.exchange || !isNotATickerMessage(errorMessage(result.error)))
|
|
1318
1323
|
? await loadNoQuoteLastTraded(listing.request, market.dataProvider, now) ?? await searchedDelisting(listing, market)
|
|
1319
1324
|
: null));
|
|
@@ -2297,6 +2302,8 @@ const HISTORY_FLAG_TEXT_COLUMN: CliResultColumn = {
|
|
|
2297
2302
|
row.partial ? cliStyles.muted("partial") : "",
|
|
2298
2303
|
row.filled ? cliStyles.muted("filled") : "",
|
|
2299
2304
|
row.unsettled ? cliStyles.muted("unsettled") : "",
|
|
2305
|
+
row.sessionClose ? cliStyles.muted("close") : "",
|
|
2306
|
+
row.beforeClose ? cliStyles.muted("before close") : "",
|
|
2300
2307
|
row.roll && typeof row.contract === "string" ? cliStyles.muted(`roll to ${row.contract}`) : "",
|
|
2301
2308
|
row.thin ? cliStyles.muted("thin") : "",
|
|
2302
2309
|
row.settleOnly ? cliStyles.muted("settle only") : "",
|
|
@@ -2974,7 +2981,7 @@ async function runFinancials(rawArgs: string[], ctx: Parameters<CliCommandDef["e
|
|
|
2974
2981
|
} : {},
|
|
2975
2982
|
// A bank's EV and EV/revenue are null with why: n/m for banks.
|
|
2976
2983
|
fundamentals: priced.fundamentals && exportedDividendFundamentals(
|
|
2977
|
-
exportedFundamentals(
|
|
2984
|
+
exportedFundamentals(withFinancialEnterpriseValue(priced.fundamentals, priced.profile))!, report.distributions),
|
|
2978
2985
|
// A bond fund's sponsor figures; fundamentals.dividendYield is then its distribution yield, not its SEC yield.
|
|
2979
2986
|
...bond ? { bondFund: bond } : {},
|
|
2980
2987
|
...view === "fundamentals" ? { statementFilings, bank: bank.bank, ...bank.note ? { bankNote: bank.note } : {} } : {},
|
|
@@ -3044,13 +3051,21 @@ const NEWS_COLUMNS = [
|
|
|
3044
3051
|
format: (value: unknown) => typeof value === "string" ? formatUtcTime(value) : "",
|
|
3045
3052
|
},
|
|
3046
3053
|
{ key: "source", header: "Source" },
|
|
3047
|
-
|
|
3054
|
+
// "Transaction in own shares (8 notices since 30 Oct)" for a folded row; exports keep the title and the count apart.
|
|
3055
|
+
{ key: "title", header: "Title", format: listedRowHeadline },
|
|
3048
3056
|
{ key: "tickers", header: "Tickers" },
|
|
3049
3057
|
// The short id `fn news-story-pane` opens the story by; exports keep the whole id.
|
|
3050
3058
|
{ key: "id", header: "ID", format: (value: unknown) => typeof value === "string" ? shortStoryId(value) : "" },
|
|
3051
3059
|
{ key: "url", header: "URL", optional: true },
|
|
3052
3060
|
];
|
|
3053
3061
|
|
|
3062
|
+
/** CSV's columns: the text table's, and how many routine notices a folded row stands for and since when. */
|
|
3063
|
+
const NEWS_EXPORT_COLUMNS = [
|
|
3064
|
+
...NEWS_COLUMNS,
|
|
3065
|
+
{ key: "routineNotices", header: "Routine notices" },
|
|
3066
|
+
{ key: "routineSince", header: "Routine since" },
|
|
3067
|
+
];
|
|
3068
|
+
|
|
3054
3069
|
/**
|
|
3055
3070
|
* A story's summary under its row, on one line, cut to the width (`rowNote`): the figure a headline leaves out.
|
|
3056
3071
|
* None for a summary that only repeats the headline; exports keep the summary whole.
|
|
@@ -3096,7 +3111,8 @@ async function printNewsSearch(
|
|
|
3096
3111
|
}, {
|
|
3097
3112
|
heading: newsSearchHeading(text, [reason, closestReason].filter(Boolean).join(" · ") || undefined),
|
|
3098
3113
|
rows: newsRows,
|
|
3099
|
-
columns:
|
|
3114
|
+
columns: NEWS_EXPORT_COLUMNS,
|
|
3115
|
+
textColumns: NEWS_COLUMNS,
|
|
3100
3116
|
rowNote: newsRowNote,
|
|
3101
3117
|
empty: named ? noStoriesMessage(text, route) : empty ?? (searched ? noStoriesMessage(text, null) : "No stories to show."),
|
|
3102
3118
|
...(listing ? { footnote: listing.note } : {}),
|
|
@@ -3141,7 +3157,8 @@ async function printMetalNews(route: MetalNewsRoute, limit: number, ctx: Paramet
|
|
|
3141
3157
|
}, {
|
|
3142
3158
|
heading: metalNewsHeading(route),
|
|
3143
3159
|
rows: newsRows,
|
|
3144
|
-
columns:
|
|
3160
|
+
columns: NEWS_EXPORT_COLUMNS,
|
|
3161
|
+
textColumns: NEWS_COLUMNS,
|
|
3145
3162
|
rowNote: newsRowNote,
|
|
3146
3163
|
empty: failure === undefined ? noMetalStoriesMessage(route) : "No stories to show.",
|
|
3147
3164
|
...(ticker ? { footnote: `${word} ${cliArrow("→")} ${route.metal}'s market news. For ${ticker.name ?? ticker.symbol} (ticker ${ticker.symbol}), try: ${companyNews}` } : {}),
|
|
@@ -3289,7 +3306,8 @@ async function runNews(rawArgs: string[], ctx: Parameters<CliCommandDef["execute
|
|
|
3289
3306
|
}, {
|
|
3290
3307
|
...(identity ? { heading: listingHeading(identity) } : {}),
|
|
3291
3308
|
rows: newsRows,
|
|
3292
|
-
columns:
|
|
3309
|
+
columns: NEWS_EXPORT_COLUMNS,
|
|
3310
|
+
textColumns: NEWS_COLUMNS,
|
|
3293
3311
|
rowNote: newsRowNote,
|
|
3294
3312
|
...(empty ? { empty } : {}),
|
|
3295
3313
|
...(wordHint ? { footnote: wordHint } : {}),
|
|
@@ -4628,35 +4646,36 @@ async function runEarnings(rawArgs: string[], ctx: Parameters<CliCommandDef["exe
|
|
|
4628
4646
|
}
|
|
4629
4647
|
// Each date is resolved as events, EE, ERN and OSA resolve it: one that has come is read against the
|
|
4630
4648
|
// company's quarters on record, for its actual and the next report on record (shared/earnings-calendar).
|
|
4631
|
-
|
|
4649
|
+
// A date is read on its listing's own day: SIE:XETRA's 12 Nov report has passed on Berlin's Friday.
|
|
4650
|
+
const now = Date.now();
|
|
4651
|
+
const today = newYorkDay(now);
|
|
4652
|
+
const dayOf = (listing: CliListing) => listingDay(listing.request.exchange || listing.exchange, now);
|
|
4632
4653
|
const resolved = await resolveListingEvents(services.dataProvider, listings.map((listing) => ({
|
|
4633
|
-
key: listing.key, symbol: listing.request.symbol, exchange: listing.request.exchange,
|
|
4654
|
+
key: listing.key, symbol: listing.request.symbol, exchange: listing.request.exchange, today: dayOf(listing),
|
|
4634
4655
|
})), calendar, today);
|
|
4635
4656
|
const events: ResolvedEarningsEvent[] = calendar
|
|
4636
|
-
.map((event) =>
|
|
4657
|
+
.map((event) => {
|
|
4658
|
+
const listing = listings.find((entry) => entry.key.toUpperCase() === event.symbol.toUpperCase());
|
|
4659
|
+
return resolved.get(event.symbol.toUpperCase()) ?? { ...event, dateStatus: calendarStatus(event, listing ? dayOf(listing) : today) };
|
|
4660
|
+
})
|
|
4637
4661
|
.sort((left, right) => left.earningsDate.getTime() - right.earningsDate.getTime());
|
|
4638
4662
|
const eventOf = (listing: CliListing) => events.find((event) => event.symbol.toUpperCase() === listing.key.toUpperCase());
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4663
|
+
// A listing the calendar has no date for is named, with when it last reported and where its headlines are: a
|
|
4664
|
+
// list never drops a symbol unsaid. Each costs reads, so a long list names the rest without them.
|
|
4665
|
+
const undatedListings = listings.filter((listing) => !eventOf(listing));
|
|
4666
|
+
const [undatedNotes, choiceNotes] = await Promise.all([
|
|
4667
|
+
Promise.all(undatedListings.map((listing, index) => undatedListingNote(listing, services, { now, lookup: index < MAX_CHOICE_LOOKUPS }))),
|
|
4643
4668
|
Promise.all(listings.map(async (listing) => {
|
|
4644
4669
|
const listed = venues.get(listing);
|
|
4645
4670
|
return listed ? earningsChoiceNote(listing, eventOf(listing), await listed) : null;
|
|
4646
4671
|
})),
|
|
4647
4672
|
]);
|
|
4648
|
-
|
|
4649
|
-
// drops a symbol unsaid.
|
|
4650
|
-
const homeUndated = listings.filter((listing) => !isListingAbroad(listing) && !eventOf(listing));
|
|
4651
|
-
const lastReported = new Map(await Promise.all(homeUndated.slice(0, MAX_CHOICE_LOOKUPS)
|
|
4652
|
-
.map(async (listing) => [listing.key, await lastReportedDay(services.dataProvider, listing, today)] as const)));
|
|
4653
|
-
const undated = undatedListingsNote(homeUndated, lastReported);
|
|
4654
|
-
const noCalendar = [...abroadNotes, ...undated ? [undated] : []].join("\n");
|
|
4673
|
+
const noCalendar = undatedNotes.join("\n");
|
|
4655
4674
|
// Text prints the listings without a calendar under the table; other formats carry them as warnings.
|
|
4656
4675
|
const warnings = [
|
|
4657
4676
|
...listings.flatMap(listingReadNotes),
|
|
4658
4677
|
...choiceNotes.filter((note): note is string => !!note),
|
|
4659
|
-
...ctx.cliOptions.format === "text" ? [] :
|
|
4678
|
+
...ctx.cliOptions.format === "text" ? [] : undatedNotes,
|
|
4660
4679
|
];
|
|
4661
4680
|
ctx.printResult({
|
|
4662
4681
|
data: events,
|
|
@@ -5,7 +5,7 @@ import type { CliCommandDef } from "../../types/plugin";
|
|
|
5
5
|
import { withCliServices, withConfigData, withMarketData } from "../context";
|
|
6
6
|
import { CLI_ERROR_CODE, failWithFields } from "../errors";
|
|
7
7
|
import type { CliResultColumn } from "../result";
|
|
8
|
-
import { formatCompact } from "../../utils/format";
|
|
8
|
+
import { MISSING_VALUE, formatCompact } from "../../utils/format";
|
|
9
9
|
import { DATE_OPTION_EXAMPLES, DATE_OPTION_FORMATS, dateOptionError, readCalendarDate } from "../../utils/calendar-date";
|
|
10
10
|
import {
|
|
11
11
|
fetchPreferredMarketMovers,
|
|
@@ -997,12 +997,12 @@ async function runYieldCurve(rawArgs: string[], ctx: Parameters<CliCommandDef["e
|
|
|
997
997
|
...(closedDay ? { footnote: closedDay, exportNotes: [closedDay] } : {}),
|
|
998
998
|
textColumns: [
|
|
999
999
|
{ key: "tenor", header: "Tenor", value: (row) => YIELD_TENORS[String(row.seriesId)] ?? row.seriesId },
|
|
1000
|
-
{ key: "value", header: "Yield %", align: "right", format: (value) => typeof value === "number" ? value.toFixed(2) :
|
|
1000
|
+
{ key: "value", header: "Yield %", align: "right", format: (value) => typeof value === "number" ? value.toFixed(2) : MISSING_VALUE },
|
|
1001
1001
|
{
|
|
1002
1002
|
key: "changeBasisPoints",
|
|
1003
1003
|
header: "1D bp",
|
|
1004
1004
|
align: "right",
|
|
1005
|
-
format: (value) => typeof value === "number" ? formatBasisPoints(value / 100, 1) :
|
|
1005
|
+
format: (value) => typeof value === "number" ? formatBasisPoints(value / 100, 1) : MISSING_VALUE,
|
|
1006
1006
|
},
|
|
1007
1007
|
{ key: "date", header: "Date" },
|
|
1008
1008
|
{ key: "seriesId", header: "Series" },
|
|
@@ -36,7 +36,8 @@ import { isTitleCaseWord, readBrokerIndexCode } from "../listing-arg";
|
|
|
36
36
|
import { knownGapMessage, commandPointer } from "../known-gaps";
|
|
37
37
|
import { instrumentTypeLabel } from "../../tickers/instrument-kind";
|
|
38
38
|
import { canonicalExchange, isKnownExchangeCode, isUsListingExchange } from "../../utils/exchanges";
|
|
39
|
-
import { addedCompanyWords, companyLines, companyNameExtraWords, groupByCompany, namedByService, sameCompany } from "../../tickers/company-name";
|
|
39
|
+
import { addedCompanyWords, companyLines, companyNameExtraWords, groupByCompany, namedByService, sameCompany, sameCompanyName } from "../../tickers/company-name";
|
|
40
|
+
import { isDebtLine } from "../../tickers/company-name-listing";
|
|
40
41
|
import { isLowQualityTickerName } from "../../tickers/search/result";
|
|
41
42
|
import { findCatalogSeries, renderSeriesMatches, type SeriesMatch } from "../series-search";
|
|
42
43
|
import { centralBankAskedAbout, centralBankCiting, type CentralBank } from "../../utils/central-banks";
|
|
@@ -139,7 +140,7 @@ export async function searchCandidatesForCli({
|
|
|
139
140
|
// A word written as a name (`Aeon`) whose company search leads with keeps it first, as `quote Aeon` reads it.
|
|
140
141
|
const named = leadsWithNamedCompany(trimmedQuery, candidates, quote);
|
|
141
142
|
const ordered = withQuotedNames(symbol, withUsLineOfPrimary(withHomeListingPrimary(trimmedQuery, withPrimaryListingFirst(symbol, candidates, named ? null : quote))), quote);
|
|
142
|
-
return withOtherCompaniesApart(ordered, named ? trimmedQuery : null)
|
|
143
|
+
return cutKeepingCompanies(withOtherCompaniesApart(ordered, named ? trimmedQuery : null), totalLimit, symbol);
|
|
143
144
|
} catch (error) {
|
|
144
145
|
// Not "No matches found": a script or a reader would take that for a name nothing lists.
|
|
145
146
|
if (isProviderBusy(error)) failRetryable(SEARCH_BUSY_MESSAGE, SEARCH_BUSY_CODE);
|
|
@@ -272,6 +273,43 @@ function formerIssuerNotes(candidates: readonly TickerSearchCandidate[], fate: S
|
|
|
272
273
|
/** A query that is a bare symbol (CAR, BRK.B), not a name or a phrase. */
|
|
273
274
|
const BARE_SYMBOL = /^[A-Z0-9][A-Z0-9.\-]{0,11}$/;
|
|
274
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Whether two lines are one company's: by the data service's company ids when
|
|
278
|
+
* both carry one (DHL Group AG on Xetra and Deutsche Post AG in Vienna), else
|
|
279
|
+
* by their names, or by a name one's company is known by besides its own.
|
|
280
|
+
*/
|
|
281
|
+
function sameSearchCompany(left: TickerSearchCandidate, right: TickerSearchCandidate): boolean {
|
|
282
|
+
const ids = [left.result?.companyId, right.result?.companyId];
|
|
283
|
+
if (ids[0] && ids[1]) return ids[0] === ids[1];
|
|
284
|
+
if (sameCompany(resolveSearchName(left), resolveSearchName(right))) return true;
|
|
285
|
+
// A line with no id named as the other's company is known besides (a former name the service sends on its rows).
|
|
286
|
+
const knownAs = (known: TickerSearchCandidate, line: TickerSearchCandidate) => !!known.result?.companyId
|
|
287
|
+
&& [...known.nameAliases ?? [], known.result.formerName].some((name) => sameCompanyName(name, resolveSearchName(line)));
|
|
288
|
+
return knownAs(left, right) || knownAs(right, left);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* The companies whose lines `candidates` are, each in search order: lines
|
|
293
|
+
* with one company id together, then each line without one with the company
|
|
294
|
+
* of a line it is named like (Deutsche Post AG in Hanover with DHL Group's
|
|
295
|
+
* Vienna line of that name), else a company of its own. A line named nothing
|
|
296
|
+
* is no company's.
|
|
297
|
+
*/
|
|
298
|
+
function searchCompanies(candidates: readonly TickerSearchCandidate[]): TickerSearchCandidate[][] {
|
|
299
|
+
const groups: TickerSearchCandidate[][] = [];
|
|
300
|
+
const place = (candidate: TickerSearchCandidate) => {
|
|
301
|
+
const group = groups.find((members) => members.some((member) => sameSearchCompany(member, candidate)));
|
|
302
|
+
if (group) group.push(candidate);
|
|
303
|
+
else groups.push([candidate]);
|
|
304
|
+
};
|
|
305
|
+
const identified = candidates.filter((candidate) => candidate.result?.companyId);
|
|
306
|
+
identified.forEach(place);
|
|
307
|
+
groupByCompany(candidates.filter((candidate) => !identified.includes(candidate)), resolveSearchName).flat().forEach(place);
|
|
308
|
+
const order = (candidate: TickerSearchCandidate) => candidates.indexOf(candidate);
|
|
309
|
+
return groups.map((group) => group.sort((left, right) => order(left) - order(right)))
|
|
310
|
+
.sort((left, right) => order(left[0]!) - order(right[0]!));
|
|
311
|
+
}
|
|
312
|
+
|
|
275
313
|
/**
|
|
276
314
|
* For a bare symbol several companies list (CAR: Avis, Carrefour, CAR Group),
|
|
277
315
|
* the company of the listing `quote CAR` reads goes first, under its home
|
|
@@ -289,10 +327,16 @@ function withPrimaryListingFirst(
|
|
|
289
327
|
const exact = candidates.filter((candidate) => candidate.symbol.toUpperCase() === symbol);
|
|
290
328
|
if (exact.some((candidate) => candidate.kind === "ticker" || candidate.saved)) return candidates;
|
|
291
329
|
const listed = exact.filter((candidate) => candidate.kind === "search" && (candidate.instrumentClass === "equity" || candidate.instrumentClass === "other"));
|
|
292
|
-
const companies =
|
|
293
|
-
if (companies.length < 2) return candidates;
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
330
|
+
const companies = searchCompanies(listed);
|
|
331
|
+
if (companies.length < 2) return withHomeLineFirst(candidates, listed);
|
|
332
|
+
const read = quotedCandidate(listed, quote);
|
|
333
|
+
if (!read) return candidates;
|
|
334
|
+
// A debt or preferred line never leads where another company's common share has its home line under the symbol, as
|
|
335
|
+
// the bare symbol reads: DTG is Daimler Truck on Xetra, not DTE Energy's debentures in New York.
|
|
336
|
+
// An equity line alone: a fund, whatever its name, is no debt line (TIP, the iShares TIPS Bond ETF).
|
|
337
|
+
const debt = (candidate: TickerSearchCandidate) => candidate.instrumentClass === "equity"
|
|
338
|
+
&& isDebtLine(candidate.result?.type ?? "", candidate.result?.name);
|
|
339
|
+
const quoted = debt(read) ? listed.find((candidate) => candidate.result?.homeListing === true && !debt(candidate)) ?? read : read;
|
|
296
340
|
// That company leads with its home line where it lists one under the symbol too (TD on TSX before NYSE).
|
|
297
341
|
const primary = companies.find((group) => group.includes(quoted))?.find((candidate) => candidate.result?.homeListing === true) ?? quoted;
|
|
298
342
|
const firsts = companies.filter((group) => !group.includes(primary)).map((group) => group[0]!);
|
|
@@ -306,6 +350,20 @@ function withPrimaryListingFirst(
|
|
|
306
350
|
));
|
|
307
351
|
}
|
|
308
352
|
|
|
353
|
+
/**
|
|
354
|
+
* One company's lines of a symbol lead with the one the service marks as its
|
|
355
|
+
* home, never a thin secondary line search ranked first: DHL is DHL Group's
|
|
356
|
+
* Xetra line, not the Vienna one.
|
|
357
|
+
*/
|
|
358
|
+
function withHomeLineFirst(candidates: TickerSearchCandidate[], listed: readonly TickerSearchCandidate[]): TickerSearchCandidate[] {
|
|
359
|
+
const home = listed.find((candidate) => candidate.result?.homeListing === true);
|
|
360
|
+
const lead = candidates.find((candidate) => candidate.category === "Primary Listing");
|
|
361
|
+
if (!home || !lead || home === lead || !listed.includes(lead)) return candidates;
|
|
362
|
+
const rest = candidates.filter((candidate) => candidate !== home);
|
|
363
|
+
const at = rest.indexOf(lead);
|
|
364
|
+
return [...rest.slice(0, at), { ...home, category: "Primary Listing" as const }, { ...lead, category: "Other Listings" as const }, ...rest.slice(at + 1)];
|
|
365
|
+
}
|
|
366
|
+
|
|
309
367
|
/**
|
|
310
368
|
* Whether a word written as a company's name (`Aeon`) leads search with the
|
|
311
369
|
* home line of the company named that word (Aeon Co., Ltd.'s 8267 on JPX)
|
|
@@ -398,7 +456,7 @@ function withQuotedNames(symbol: string, candidates: TickerSearchCandidate[], qu
|
|
|
398
456
|
const onVenue = quotedCandidate(exact, quote);
|
|
399
457
|
const name = onVenue ? quotedListingName(candidateExchange(onVenue), quote) : null;
|
|
400
458
|
if (!onVenue || !name) return candidates;
|
|
401
|
-
const company =
|
|
459
|
+
const company = searchCompanies(exact).find((group) => group.includes(onVenue)) ?? [onVenue];
|
|
402
460
|
return candidates.map((candidate) => {
|
|
403
461
|
if (!company.includes(candidate) || resolveSearchName(candidate) === name) return candidate;
|
|
404
462
|
const [, ...rest] = candidate.detail.split(" | ");
|
|
@@ -428,7 +486,12 @@ function withOtherCompaniesApart(candidates: TickerSearchCandidate[], namedWord:
|
|
|
428
486
|
?? (lead?.category === "Saved" && lead.instrumentClass === "equity" ? lead : undefined);
|
|
429
487
|
// A primary line search names no company for gives nothing to tell its company's lines by.
|
|
430
488
|
if (!primary || nameless(primary)) return candidates;
|
|
431
|
-
|
|
489
|
+
// The company ids decide where the primary and a line both carry one; the names of the primary's identified lines
|
|
490
|
+
// (Deutsche Post AG, its Vienna line) are its names for a line without one.
|
|
491
|
+
const id = primary.result?.companyId;
|
|
492
|
+
const sameId = (candidate: TickerSearchCandidate) => !!id && candidate.result?.companyId === id;
|
|
493
|
+
const names = [resolveSearchName(primary), primary.result?.formerName, ...primary.nameAliases ?? [],
|
|
494
|
+
...candidates.filter(sameId).map(resolveSearchName)];
|
|
432
495
|
// A name with more words that another business goes by is not the primary's (`companyLines`): Mitsubishi UFJ
|
|
433
496
|
// Financial Group, which lists in Tokyo beside Mitsubishi Corporation, is not one of its lines.
|
|
434
497
|
const lines = new Set(companyLines(primary, candidates.filter((candidate) => candidate === primary || (candidate.kind === "search"
|
|
@@ -444,7 +507,8 @@ function withOtherCompaniesApart(candidates: TickerSearchCandidate[], namedWord:
|
|
|
444
507
|
const otherLeads = new Set(elsewhere.map((candidate) => addedCompanyWords(resolveSearchName(candidate), primaryName)[0]).filter(Boolean));
|
|
445
508
|
const anotherBusiness = (candidate: TickerSearchCandidate) => elsewhere.includes(candidate)
|
|
446
509
|
|| otherLeads.has(addedCompanyWords(resolveSearchName(candidate), primaryName)[0] ?? "");
|
|
447
|
-
const ownLine = (candidate: TickerSearchCandidate) =>
|
|
510
|
+
const ownLine = (candidate: TickerSearchCandidate) => id && candidate.result?.companyId ? sameId(candidate)
|
|
511
|
+
: nameless(candidate)
|
|
448
512
|
? baseSymbol(candidate.symbol) === baseSymbol(primary.symbol)
|
|
449
513
|
: names.some((company) => sameCompany(resolveSearchName(candidate), company))
|
|
450
514
|
&& !anotherBusiness(candidate)
|
|
@@ -457,6 +521,33 @@ function withOtherCompaniesApart(candidates: TickerSearchCandidate[], namedWord:
|
|
|
457
521
|
return [...kept.slice(0, at), ...apart, ...kept.slice(at)];
|
|
458
522
|
}
|
|
459
523
|
|
|
524
|
+
/**
|
|
525
|
+
* The first `limit` rows, with each other company's first line of the symbol
|
|
526
|
+
* kept in place of the primary company's last venues: `search DTG` lists
|
|
527
|
+
* Daimler Truck's lines and still DTE Energy's debenture. Only a line of
|
|
528
|
+
* another company (`searchCompanies`, by id where both carry one) takes a
|
|
529
|
+
* venue's place: never one of the primary company's own lines named as it
|
|
530
|
+
* was (Deutsche Post AG for DHL Group).
|
|
531
|
+
*/
|
|
532
|
+
function cutKeepingCompanies(candidates: TickerSearchCandidate[], limit: number, symbol: string): TickerSearchCandidate[] {
|
|
533
|
+
const head = candidates.slice(0, limit);
|
|
534
|
+
if (candidates.length <= limit || !BARE_SYMBOL.test(symbol)) return head;
|
|
535
|
+
// Each company of the symbol shown above the cut, its own lines and its lines named as it was among them.
|
|
536
|
+
const companies = searchCompanies(candidates.filter((candidate) => candidate.symbol.toUpperCase() === symbol));
|
|
537
|
+
const shown = new Set(head.flatMap((candidate) => companies.filter((group) => group.includes(candidate))));
|
|
538
|
+
const missing = companies.filter((group) => !shown.has(group))
|
|
539
|
+
.flatMap((group) => group.find((candidate) => candidate.category === "Other Matches") ?? []);
|
|
540
|
+
const venues = head.filter((candidate) => candidate.category === "Other Listings");
|
|
541
|
+
// The primary company keeps at least one other venue.
|
|
542
|
+
const room = Math.min(missing.length, Math.max(0, venues.length - 1));
|
|
543
|
+
if (room === 0) return head;
|
|
544
|
+
const dropped = new Set(venues.slice(-room));
|
|
545
|
+
const kept = head.filter((candidate) => !dropped.has(candidate));
|
|
546
|
+
const at = kept.findLastIndex((candidate) => candidate.category === "Other Listings" || candidate.category === "Other Matches"
|
|
547
|
+
|| candidate.category === "Primary Listing") + 1;
|
|
548
|
+
return [...kept.slice(0, at), ...missing.slice(0, room), ...kept.slice(at)];
|
|
549
|
+
}
|
|
550
|
+
|
|
460
551
|
/** "Saved", or the broker a row came from; never the data service's internal id. */
|
|
461
552
|
function searchSourceLabel(candidate: TickerSearchCandidate): string {
|
|
462
553
|
return isSavedCandidate(candidate) ? "Saved" : candidate.result?.brokerLabel || "";
|
|
@@ -522,6 +613,9 @@ function searchCandidateRows(candidates: TickerSearchCandidate[]) {
|
|
|
522
613
|
source: searchSourceLabel(candidate),
|
|
523
614
|
providerId: candidate.result?.providerId ?? "",
|
|
524
615
|
saved: isSavedCandidate(candidate),
|
|
616
|
+
// The company the data service identifies the line as one of: lines with one id are one company, whatever each venue names it.
|
|
617
|
+
...typeof candidate.result?.companyId === "string" && candidate.result.companyId
|
|
618
|
+
? { companyId: candidate.result.companyId } : {},
|
|
525
619
|
// The company that merged into this one, whose old name the query is.
|
|
526
620
|
...candidate.result?.formerIssuer ? { formerIssuer: candidate.result.formerIssuer } : {},
|
|
527
621
|
// The name a renamed company had, which the query is.
|
|
@@ -3,13 +3,15 @@ import { ebitdaLacksDepreciation } from "../../utils/ebitda";
|
|
|
3
3
|
import { formatShortDate, parseDisplayDate } from "../../utils/datetime-format";
|
|
4
4
|
import { formatReportedMoney, REPORTING_CURRENCY_NOT_SOURCED } from "../../utils/reported-money";
|
|
5
5
|
import {
|
|
6
|
-
appTtmRate,
|
|
6
|
+
appTtmRate, computedEnterpriseValueNote, convertedPriceEarningsNote, enterpriseValueLabel,
|
|
7
7
|
enterpriseValueReconciliationNote,
|
|
8
|
-
epsConversionNote, fundamentalsCurrency,
|
|
9
|
-
|
|
8
|
+
epsConversionNote, financialEnterpriseValue, fundamentalsCurrency, isFinancialEnterpriseValueReason, reportedEnterpriseValue, trailingEpsFiscalYear, trailingEpsSourceNote, ttmAtAppRate, ttmConversionNote,
|
|
9
|
+
withFinancialEnterpriseValue,
|
|
10
10
|
} from "../../utils/fundamentals";
|
|
11
11
|
import { latestFinancialPeriod } from "../../utils/latest-financial-period";
|
|
12
12
|
import { halfYearGrowthPeriod } from "../../utils/financial-statements";
|
|
13
|
+
import { servedRatesNotMeaningful, type ServedRate } from "../../utils/served-rates";
|
|
14
|
+
import { NOT_MEANINGFUL_TEXT } from "../../utils/growth";
|
|
13
15
|
import { burnsCash, cashRunway, SHORT_RUNWAY_HISTORY, formatRunwayMonths, offeringNote, offeringsAfter, runwayMethod, type CashRunway, type OfferingFiling, type RunwayEstimate } from "../../utils/cash-runway";
|
|
14
16
|
import { exportedFundamentals, formatPriceEarnings, forwardFiscalYear, NOT_MEANINGFUL, priceEarningsOnEarnings } from "../../utils/price-earnings";
|
|
15
17
|
import { describeFundamentalMarketCap, marketCapBasisNote, selectMarketCapitalization, viewMarketCapitalization, withheldMarketCap } from "../../utils/market-capitalization";
|
|
@@ -645,8 +647,9 @@ function unsourcedCurrencyNote(metrics: readonly FundamentalsMetric[]): string |
|
|
|
645
647
|
* a loss is.
|
|
646
648
|
*/
|
|
647
649
|
function enterpriseValueFigure(figure: MetricFigure, fundamentals: TickerFinancials["fundamentals"]): MetricFigure {
|
|
648
|
-
// A bank's: its deposits are funding, not debt.
|
|
649
|
-
|
|
650
|
+
// A bank's, an insurer's or a broker's: its deposits, float or repos are funding, not debt.
|
|
651
|
+
const financial = financialEnterpriseValue(fundamentals);
|
|
652
|
+
if (financial) return { text: financial, value: "N/M", unit: figure.unit };
|
|
650
653
|
const label = enterpriseValueLabel(fundamentals);
|
|
651
654
|
if (label === "not-meaningful") return { ...multipleFigure(NOT_MEANINGFUL), unit: figure.unit };
|
|
652
655
|
// A withdrawn EV the bridge stands in for shows the bridge (listingEnterpriseView).
|
|
@@ -871,13 +874,19 @@ function fundamentalsMetrics(
|
|
|
871
874
|
epsYear?: string,
|
|
872
875
|
/** A half-year reporter's latest period growth compares halves, not quarters: "H1 2026 vs H1 2025" (halfYearGrowthPeriod). */
|
|
873
876
|
growthPeriod?: string | null,
|
|
877
|
+
/** Why a served margin or revenue growth is N/M (servedRatesNotMeaningful), as DES and RV read it. */
|
|
878
|
+
notMeaningful: Partial<Record<ServedRate, string>> = {},
|
|
874
879
|
): FundamentalsMetric[] {
|
|
875
880
|
const signed = (value: number) => colorBySign(formatPercent(value), value);
|
|
881
|
+
// N/M where the source's figure is a number that says nothing: a margin over revenue at or below zero, growth off it.
|
|
882
|
+
// The value is null, as an export's column of figures holds only numbers; the text says N/M.
|
|
883
|
+
const rate = (key: ServedRate, format: (value: number) => string): MetricFigure => notMeaningful[key] && fundamentals?.[key] != null
|
|
884
|
+
? { text: NOT_MEANINGFUL_TEXT, value: null, unit: "%" } : percentFigure(fundamentals?.[key], format);
|
|
876
885
|
const receipt = fundamentals?.sharesOutstanding != null && sharesOutstandingInReceipts(quote, fundamentals, profile?.description);
|
|
877
886
|
const withdrawn = fundamentals?.notMeaningful ?? {};
|
|
878
887
|
return [
|
|
879
888
|
{ label: "Market Cap", ...marketCap },
|
|
880
|
-
{ label: "Enterprise Value", ...enterpriseValueFigure(enterpriseValue,
|
|
889
|
+
{ label: "Enterprise Value", ...enterpriseValueFigure(enterpriseValue, withFinancialEnterpriseValue(fundamentals, profile)) },
|
|
881
890
|
// A multiple over a loss is N/M, even beside a positive one the source served from an older period, and so is one
|
|
882
891
|
// withdrawn as no multiple of the share (a warrant's, an EPS that is not net income over the shares; share-multiples).
|
|
883
892
|
{ label: epsYear ? `P/E ${epsYear}` : "P/E (TTM)", ...multipleFigure(withdrawn.trailingPE ? NOT_MEANINGFUL : priceEarningsOnEarnings(fundamentals?.trailingPE, fundamentals?.eps)) },
|
|
@@ -900,10 +909,10 @@ function fundamentalsMetrics(
|
|
|
900
909
|
{ label: "Operating Cash Flow (TTM)", ...reportedMoney(fundamentals?.operatingCashFlow, reportingCurrency) },
|
|
901
910
|
{ label: "Free Cash Flow (TTM)", ...reportedMoney(fundamentals?.freeCashFlow, reportingCurrency) },
|
|
902
911
|
// Levels, not changes, so they carry no sign.
|
|
903
|
-
{ label: "Operating Margin", ...
|
|
904
|
-
{ label: "Profit Margin", ...
|
|
905
|
-
{ label: "Revenue Growth", ...
|
|
906
|
-
{ label: growthPeriod ? `Revenue ${growthPeriod}` : "Last Quarter Growth", ...
|
|
912
|
+
{ label: "Operating Margin", ...rate("operatingMargin", formatFractionPercentCell) },
|
|
913
|
+
{ label: "Profit Margin", ...rate("profitMargin", formatFractionPercentCell) },
|
|
914
|
+
{ label: "Revenue Growth", ...rate("revenueGrowth", signed) },
|
|
915
|
+
{ label: growthPeriod ? `Revenue ${growthPeriod}` : "Last Quarter Growth", ...rate("lastQuarterGrowth", signed) },
|
|
907
916
|
{ label: "1Y Return", ...percentFigure(priceReturns.return1Y, signed) },
|
|
908
917
|
{ label: "3Y Return", ...percentFigure(priceReturns.return3Y, signed) },
|
|
909
918
|
{
|
|
@@ -1003,7 +1012,7 @@ function fundamentalsNotes(
|
|
|
1003
1012
|
// A bank's EV line says why it is n/m.
|
|
1004
1013
|
const bridged = metrics.some((metric) => metric.label === "Enterprise Value" && typeof metric.value === "number")
|
|
1005
1014
|
&& enterpriseValueLabel(fundamentals) === "unavailable";
|
|
1006
|
-
const enterpriseValue = shown("Enterprise Value") && !metrics.some((metric) => metric.text
|
|
1015
|
+
const enterpriseValue = shown("Enterprise Value") && !metrics.some((metric) => isFinancialEnterpriseValueReason(metric.text))
|
|
1007
1016
|
? bridged ? listingNote : [enterpriseValueReconciliationNote(fundamentals, enterpriseValueCurrency(priced.quote, fundamentals), priced)
|
|
1008
1017
|
?? computedEnterpriseValueNote(fundamentals), listingNote].filter(Boolean).join(" ") || undefined
|
|
1009
1018
|
: undefined;
|
|
@@ -1156,7 +1165,7 @@ function fundamentalsReportMetrics(snapshot: FundamentalsReportData, view: "fund
|
|
|
1156
1165
|
: { text: "—" };
|
|
1157
1166
|
const metrics = withoutStockRows(fundamentalsMetrics(quote, fundamentals, financials.profile, marketCap, computeTickerPriceReturns(financials),
|
|
1158
1167
|
fundamentalsCurrency(financials), listingEnterpriseView(snapshot).figure, snapshot.distributions ?? null, snapshot.bondFund ?? null, snapshot.currencyCodes === true,
|
|
1159
|
-
trailingEpsFiscalYear(financials), halfYearGrowthPeriod(financials)),
|
|
1168
|
+
trailingEpsFiscalYear(financials), halfYearGrowthPeriod(financials), servedRatesNotMeaningful(fundamentals, financials)),
|
|
1160
1169
|
resolveTickerInstrumentKind(null, financials) === "fund");
|
|
1161
1170
|
if (view === "fundamentals") {
|
|
1162
1171
|
return [...metrics, ...floatAndShortInterestMetrics(quote, fundamentals, financials.profile)]
|
|
@@ -1517,7 +1526,7 @@ export async function buildTickerReport({
|
|
|
1517
1526
|
const listing = { listedSince: ipo ? ipo.deal.listingDate ?? ipo.deal.firstDay?.session ?? null : null };
|
|
1518
1527
|
const metrics = withoutStockRows(fundamentalsMetrics(quote, priced.fundamentals, profile, { text: marketCapText }, priceReturns,
|
|
1519
1528
|
fundamentalsCurrency(financials, listing), { text: enterpriseValueText, ...listingEv.value != null ? { value: listingEv.value } : {} }, distributions, bondFund, codes, trailingEpsFiscalYear(financials),
|
|
1520
|
-
halfYearGrowthPeriod(financials)), isFund);
|
|
1529
|
+
halfYearGrowthPeriod(financials), servedRatesNotMeaningful(priced.fundamentals, financials)), isFund);
|
|
1521
1530
|
const reportedCurrency = financials.financialCurrency?.trim();
|
|
1522
1531
|
const statements = [...financials.annualStatements, ...financials.quarterlyStatements];
|
|
1523
1532
|
const fallbackCurrency = reportedCurrency && statements.every((row) => !row.currency?.trim() || row.currency.trim() === reportedCurrency)
|