gloomberb 0.20.7 → 0.20.9
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/README.ja.md +74 -0
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/package.json +6 -1
- package/src/account/auth-model.ts +22 -0
- package/src/api-client/auth.ts +7 -2
- package/src/api-client/awards.ts +5 -0
- package/src/api-client/bond-trades.ts +22 -0
- package/src/api-client/catalysts.ts +11 -1
- package/src/api-client/data.ts +30 -6
- package/src/api-client/debt-maturities.ts +7 -0
- package/src/api-client/equity-screener.ts +17 -0
- package/src/api-client/errors.ts +2 -0
- package/src/api-client/exchange-announcements.ts +14 -7
- package/src/api-client/fund-facts.ts +21 -3
- package/src/api-client/futures-curve.ts +19 -2
- package/src/api-client/geo.ts +10 -0
- package/src/api-client/hiring.ts +2 -0
- package/src/api-client/index.ts +3 -0
- package/src/api-client/insider-signals.ts +14 -0
- package/src/api-client/members.ts +30 -2
- package/src/api-client/money-markets.ts +11 -1
- package/src/api-client/paths.ts +6 -1
- package/src/api-client/perps.ts +2 -0
- package/src/api-client/request.ts +2 -1
- package/src/api-client/socket.ts +7 -0
- package/src/api-client/types/econ.ts +2 -1
- package/src/api-client/types/filings-and-calls.ts +6 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/web-experiments.ts +5 -6
- package/src/app/runtime/update.ts +2 -1
- package/src/architecture/floating-promise-allowlist.json +33 -106
- package/src/capabilities/asset-data-inputs.ts +183 -0
- package/src/capabilities/factories.ts +8 -2
- package/src/cli/base-converter.ts +36 -2
- package/src/cli/commands/api.ts +2 -2
- package/src/cli/commands/command-utils.ts +18 -0
- package/src/cli/commands/hong-kong-movers.ts +50 -0
- package/src/cli/commands/market.ts +539 -130
- package/src/cli/commands/options-chain.ts +7 -1
- package/src/cli/commands/overview.ts +76 -14
- package/src/cli/commands/plugins.ts +7 -6
- package/src/cli/commands/search.ts +52 -9
- package/src/cli/commands/system.ts +15 -10
- package/src/cli/commands/ticker.ts +97 -44
- package/src/cli/content-figures.ts +45 -0
- package/src/cli/context.ts +5 -0
- package/src/cli/desktop-pane-shot-routes.ts +13 -4
- package/src/cli/desktop-pane-shot.ts +86 -12
- package/src/cli/earnings-calendar.ts +36 -5
- package/src/cli/export-source.ts +17 -3
- package/src/cli/fx-pair.ts +111 -11
- package/src/cli/glossary.ts +36 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/history-export.ts +29 -11
- package/src/cli/history-rows.ts +130 -21
- package/src/cli/index.ts +8 -5
- package/src/cli/known-gaps.ts +45 -1
- package/src/cli/listing-arg.ts +366 -19
- package/src/cli/pane-functions/capabilities.ts +2 -2
- package/src/cli/pane-functions/catalog.ts +105 -9
- package/src/cli/pane-functions/data.ts +3 -2
- package/src/cli/pane-functions/discovery.ts +2 -0
- package/src/cli/pane-functions/dom.ts +46 -9
- package/src/cli/pane-functions/freshness.ts +7 -3
- package/src/cli/pane-functions/function-help.ts +9 -6
- package/src/cli/pane-functions/headless.ts +78 -6
- package/src/cli/pane-functions/index.ts +141 -23
- package/src/cli/pane-functions/options.ts +1 -3
- package/src/cli/pane-functions/plugin-code.ts +169 -0
- package/src/cli/pane-functions/report.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +69 -21
- package/src/cli/pane-functions/screenshot-assessment.ts +82 -3
- package/src/cli/pane-functions/screenshot-data-evidence.ts +3 -1
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/quote-answer.ts +49 -2
- package/src/cli/registry.ts +42 -4
- package/src/cli/report-tables.ts +26 -6
- package/src/cli/result.ts +13 -2
- package/src/cli/series-search.ts +17 -7
- package/src/cli/statement-filings.ts +22 -8
- package/src/cli/symbol-args.ts +9 -0
- package/src/cli/symbol-cells.ts +6 -0
- package/src/cli/symbol-list.ts +14 -6
- package/src/cli/symbol-rows.ts +12 -5
- package/src/cli/ticker-resolution.ts +3 -2
- package/src/cli/unknown-command.ts +111 -14
- package/src/components/chart/composite/format.ts +15 -1
- package/src/components/chart/composite/legend.tsx +101 -47
- package/src/components/chart/composite/panel-labels.ts +4 -4
- package/src/components/chart/composite/panel-surface.tsx +4 -6
- package/src/components/chart/composite/scene/build.ts +180 -0
- package/src/components/chart/composite/scene/cursor.ts +226 -0
- package/src/components/chart/composite/scene/domain.ts +170 -0
- package/src/components/chart/composite/scene/markers.ts +115 -0
- package/src/components/chart/composite/scene/panels.ts +85 -0
- package/src/components/chart/composite/scene/points.ts +169 -0
- package/src/components/chart/composite/scene/projection.ts +105 -0
- package/src/components/chart/composite/scene/timeline.ts +71 -0
- package/src/components/chart/composite/scene.ts +12 -1066
- package/src/components/chart/composite/types.ts +4 -2
- package/src/components/chart/curve/model.ts +2 -2
- package/src/components/chart-table/axis.ts +18 -6
- package/src/components/command-bar/layout-items/focused-pane.ts +3 -0
- package/src/components/command-bar/list/model.ts +9 -0
- package/src/components/command-bar/pane-templates/items.ts +61 -15
- package/src/components/command-bar/pane-templates/workflow.ts +16 -5
- package/src/components/command-bar/routes/root/plugin-install.ts +7 -46
- package/src/components/command-bar/routes/root/provider-search.ts +8 -5
- package/src/components/command-bar/routes/root/results.ts +6 -1
- package/src/components/command-bar/routes/root/runtime.ts +1 -0
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +4 -1
- package/src/components/command-bar/routes/ticker-search/actions.ts +7 -5
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -3
- package/src/components/command-bar/view-model.ts +12 -0
- package/src/components/command-bar/workflow/ops.ts +21 -4
- package/src/components/command-bar/workflow/ticker-listing-picker.ts +3 -1
- package/src/components/command-bar/workflow/tickers.ts +6 -2
- package/src/components/data-table/view.tsx +46 -1
- package/src/components/form-modal/confirm.tsx +3 -2
- package/src/components/form-modal/content.tsx +3 -2
- package/src/components/form-modal/field-row.tsx +2 -0
- package/src/components/form-modal/host.tsx +18 -3
- package/src/components/form-modal/remote-reads.test-helpers.ts +34 -0
- package/src/components/index.ts +1 -1
- package/src/components/layout/pane/title.ts +21 -5
- package/src/components/layout/shell/pane/layers.tsx +20 -14
- package/src/components/layout/shell/pane-occlusion.ts +21 -0
- package/src/components/onboarding/desks-step.tsx +7 -1
- package/src/components/onboarding/onboarding-keyboard.ts +48 -6
- package/src/components/onboarding/onboarding-wizard.tsx +47 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +17 -3
- package/src/components/onboarding/use-onboarding-progress.ts +57 -14
- package/src/components/onboarding/wizard-positions.ts +2 -0
- package/src/components/paged-rows.ts +11 -5
- package/src/components/ticker/list-table-view.tsx +24 -5
- package/src/components/toggle-list.tsx +44 -1
- package/src/components/ui/data-table/opentui/index.tsx +7 -6
- package/src/components/ui/data-table/opentui/model.ts +7 -3
- package/src/components/ui/data-table/types.ts +13 -2
- package/src/components/ui/fields.tsx +16 -4
- package/src/components/ui/page-stack-view.tsx +24 -6
- package/src/components/ui/query-bar.tsx +43 -9
- package/src/components/ui/table-layout.ts +56 -2
- package/src/core/app-services.ts +7 -2
- package/src/core/connection-health.ts +26 -0
- package/src/core/state/app/layout.ts +12 -4
- package/src/data/config/layout.ts +3 -1
- package/src/data/config/store/node.ts +4 -2
- package/src/docs/snapshot.json +756 -216
- package/src/i18n/es.ts +4 -1
- package/src/i18n/ja.ts +4 -1
- package/src/i18n/ko.ts +4 -1
- package/src/i18n/zh-cn.ts +4 -1
- package/src/i18n/zh-tw.ts +4 -1
- package/src/layout/pane-follow.ts +1 -1
- package/src/layout/pane-manager/gridlock.ts +18 -5
- package/src/layout/pane-manager/index.ts +1 -0
- package/src/layout/pane-manager/transient.ts +56 -0
- package/src/layout-marketplace/gallery.tsx +2 -1
- package/src/layout-marketplace/model.ts +4 -10
- package/src/market-data/commodity-names.ts +24 -0
- package/src/market-data/connection-follow.ts +9 -7
- package/src/market-data/coordinator/auxiliary.ts +4 -3
- package/src/market-data/coordinator/entries.ts +22 -1
- package/src/market-data/coordinator/financials.ts +2 -3
- package/src/market-data/coordinator/index.ts +67 -12
- package/src/market-data/coordinator/quotes.ts +2 -3
- package/src/market-data/fund-facts.ts +7 -1
- package/src/market-data/futures-board.ts +38 -4
- package/src/market-data/futures-contract.ts +5 -2
- package/src/market-data/futures-roll-returns.ts +226 -0
- package/src/market-data/fx-closes.ts +4 -1
- package/src/market-data/market/bar-period.ts +15 -0
- package/src/market-data/market/format.ts +4 -2
- package/src/market-data/market/freshness.ts +4 -0
- package/src/market-data/market/session-close-note.ts +41 -4
- package/src/market-data/market/status.ts +23 -3
- package/src/market-data/options-alternatives.ts +21 -9
- package/src/market-data/published-futures-sessions.ts +9 -0
- package/src/market-data/quotes/balance-sheet-rate.ts +34 -0
- package/src/market-data/quotes/delisting.ts +26 -2
- package/src/market-data/quotes/freshness.ts +62 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +254 -19
- package/src/market-data/quotes/regular-session-valuation.ts +8 -0
- package/src/market-data/realized-volatility.ts +3 -1
- package/src/market-data/request-types.ts +2 -0
- package/src/market-data/selectors.ts +1 -0
- package/src/news/aggregator.ts +3 -3
- package/src/plugins/builtin/account-management/delete-account.ts +78 -0
- package/src/plugins/builtin/account-management/pane.tsx +22 -19
- package/src/plugins/builtin/account-management/password-dialog.tsx +75 -0
- package/src/plugins/builtin/alerts/alert-log.ts +3 -2
- package/src/plugins/builtin/alerts/cli-forms.ts +1 -1
- package/src/plugins/builtin/alerts/cli.ts +72 -4
- package/src/plugins/builtin/alerts/format.ts +8 -2
- package/src/plugins/builtin/alerts/index.tsx +8 -5
- package/src/plugins/builtin/alerts/pane.tsx +5 -3
- package/src/plugins/builtin/alerts/research-builder.ts +12 -0
- package/src/plugins/builtin/analytics/index.tsx +3 -3
- package/src/plugins/builtin/analytics/risk-client.ts +14 -3
- package/src/plugins/builtin/analytics/risk-pane.tsx +3 -3
- package/src/plugins/builtin/attention/pane.tsx +1 -1
- package/src/plugins/builtin/attention/trending.tsx +1 -1
- package/src/plugins/builtin/awards/detail.tsx +4 -1
- package/src/plugins/builtin/awards/headless.ts +7 -3
- package/src/plugins/builtin/awards/model.ts +11 -0
- package/src/plugins/builtin/awards/pane.tsx +12 -5
- package/src/plugins/builtin/backtest/client.ts +16 -4
- package/src/plugins/builtin/backtest/headless.ts +2 -1
- package/src/plugins/builtin/backtest/pane.tsx +5 -3
- package/src/plugins/builtin/backtest/report.ts +22 -6
- package/src/plugins/builtin/backtest/window.ts +17 -9
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/buildout/company/pane.tsx +1 -1
- package/src/plugins/builtin/buildout/model/index.ts +2 -2
- package/src/plugins/builtin/catalysts/headless.ts +9 -6
- package/src/plugins/builtin/catalysts/model.ts +72 -10
- package/src/plugins/builtin/catalysts/pane.tsx +10 -7
- package/src/plugins/builtin/cds/pane.tsx +5 -3
- package/src/plugins/builtin/central-bank-rates/pane.tsx +3 -2
- package/src/plugins/builtin/chart-composer/catalog-series.ts +59 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -1
- package/src/plugins/builtin/chart-composer/headless.ts +104 -23
- package/src/plugins/builtin/chart-composer/index.tsx +6 -3
- package/src/plugins/builtin/chart-composer/legend-names.ts +19 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +37 -10
- package/src/plugins/builtin/chart-composer/presets.ts +63 -6
- package/src/plugins/builtin/chart-composer/roll-events.ts +38 -0
- package/src/plugins/builtin/chart-composer/series-catalog.ts +12 -5
- package/src/plugins/builtin/chart-composer/series-expression.ts +8 -4
- package/src/plugins/builtin/chart-composer/series-listings.ts +33 -9
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +2 -2
- package/src/plugins/builtin/clinical-trials/client.ts +13 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +1 -1
- package/src/plugins/builtin/clinical-trials/pane.tsx +77 -27
- package/src/plugins/builtin/clinical-trials/search.ts +117 -0
- package/src/plugins/builtin/cloud/askg/conversation-store.ts +17 -6
- package/src/plugins/builtin/cloud/askg/lock-note.ts +4 -2
- package/src/plugins/builtin/cloud/askg/manifest.ts +3 -2
- package/src/plugins/builtin/cloud/askg/pane.tsx +2 -2
- package/src/plugins/builtin/cloud/askg/sources.ts +3 -3
- package/src/plugins/builtin/cloud/one-tap/one-tap-prompt.tsx +7 -3
- package/src/plugins/builtin/cloud/team/acm-tab.tsx +1 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +17 -10
- package/src/plugins/builtin/cloud/team/views.ts +15 -3
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +105 -16
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +17 -2
- package/src/plugins/builtin/cloud/thesis/module.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/store.ts +17 -3
- package/src/plugins/builtin/commodities-energy/index.tsx +35 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -1
- package/src/plugins/builtin/company-attention/app-rank.tsx +1 -1
- package/src/plugins/builtin/company-attention/building.tsx +1 -1
- package/src/plugins/builtin/company-attention/model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +1 -1
- package/src/plugins/builtin/company-attention/pane.tsx +1 -1
- package/src/plugins/builtin/company-attention/signals.tsx +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +1 -1
- package/src/plugins/builtin/correlation/headless.ts +13 -7
- package/src/plugins/builtin/correlation/history.ts +17 -6
- package/src/plugins/builtin/correlation/index.tsx +8 -4
- package/src/plugins/builtin/correlation/matrix/model.ts +15 -1
- package/src/plugins/builtin/correlation/relationship/history.ts +1 -1
- package/src/plugins/builtin/correlation/relationship/model.ts +15 -1
- package/src/plugins/builtin/correlation/relationship/pane.tsx +5 -3
- package/src/plugins/builtin/cot/headless.ts +10 -3
- package/src/plugins/builtin/cot/pane.tsx +2 -2
- package/src/plugins/builtin/cpi/pane.tsx +1 -1
- package/src/plugins/builtin/credit-boards/model.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +1 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -2
- package/src/plugins/builtin/crypto-board/defi.ts +9 -3
- package/src/plugins/builtin/crypto-board/headless.ts +19 -10
- package/src/plugins/builtin/crypto-board/model.ts +8 -0
- package/src/plugins/builtin/crypto-board/pane.tsx +11 -5
- package/src/plugins/builtin/crypto-board/series.ts +17 -3
- package/src/plugins/builtin/crypto-board/supply.ts +26 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +3 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +13 -3
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -3
- package/src/plugins/builtin/custom-view/pane.tsx +5 -5
- package/src/plugins/builtin/debt-maturities/client.ts +5 -0
- package/src/plugins/builtin/debt-maturities/headless.ts +3 -1
- package/src/plugins/builtin/debt-maturities/model.ts +1 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/model.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +1 -1
- package/src/plugins/builtin/earnings/board.tsx +2 -2
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/data.ts +2 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +15 -0
- package/src/plugins/builtin/earnings-calls/model.ts +68 -8
- package/src/plugins/builtin/earnings-calls/pane.tsx +29 -8
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +32 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +94 -2
- package/src/plugins/builtin/econ/detail-view.tsx +15 -11
- package/src/plugins/builtin/econ/index.tsx +25 -9
- package/src/plugins/builtin/econ/types.ts +4 -1
- package/src/plugins/builtin/equity-screener/headless.ts +23 -7
- package/src/plugins/builtin/equity-screener/index.tsx +3 -0
- package/src/plugins/builtin/equity-screener/live.ts +39 -12
- package/src/plugins/builtin/equity-screener/model.ts +86 -5
- package/src/plugins/builtin/equity-screener/pane.tsx +20 -21
- package/src/plugins/builtin/equity-screener/results.ts +12 -3
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +2 -2
- package/src/plugins/builtin/executives/pane.tsx +2 -2
- package/src/plugins/builtin/exposure/pane.tsx +1 -1
- package/src/plugins/builtin/fear-greed/data.ts +3 -1
- package/src/plugins/builtin/fear-greed/headless.ts +8 -2
- package/src/plugins/builtin/fear-greed/pane.tsx +8 -4
- package/src/plugins/builtin/filing-events/pane.tsx +1 -1
- package/src/plugins/builtin/futures/index.tsx +5 -4
- package/src/plugins/builtin/futures/model.ts +17 -9
- package/src/plugins/builtin/futures/returns.ts +2 -0
- package/src/plugins/builtin/futures/series.ts +44 -8
- package/src/plugins/builtin/futures/table.tsx +3 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -0
- package/src/plugins/builtin/futures-curve/headless.ts +17 -12
- package/src/plugins/builtin/futures-curve/index.tsx +7 -4
- package/src/plugins/builtin/futures-curve/model.ts +117 -7
- package/src/plugins/builtin/futures-curve/pane.tsx +18 -7
- package/src/plugins/builtin/fx-matrix/amount.ts +2 -1
- package/src/plugins/builtin/fx-matrix/index.tsx +9 -0
- package/src/plugins/builtin/gpu/changes.tsx +1 -1
- package/src/plugins/builtin/gpu/equities.tsx +1 -1
- package/src/plugins/builtin/gpu/pane.tsx +2 -2
- package/src/plugins/builtin/help/function-card.tsx +4 -2
- package/src/plugins/builtin/help/function-index.ts +12 -6
- package/src/plugins/builtin/help/index.tsx +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +1 -1
- package/src/plugins/builtin/holders/pane.tsx +1 -1
- package/src/plugins/builtin/insider/base-values.ts +55 -0
- package/src/plugins/builtin/insider/headless.ts +307 -83
- package/src/plugins/builtin/insider/index.tsx +65 -23
- package/src/plugins/builtin/insider/insiders.tsx +26 -16
- package/src/plugins/builtin/insider/model.ts +2 -2
- package/src/plugins/builtin/insider/signals-cells.tsx +4 -1
- package/src/plugins/builtin/insider/signals-model.ts +13 -5
- package/src/plugins/builtin/insider/signals.tsx +5 -3
- package/src/plugins/builtin/insider/tickers.tsx +466 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +1 -1
- package/src/plugins/builtin/iv-history/client.ts +35 -4
- package/src/plugins/builtin/iv-history/headless.ts +10 -4
- package/src/plugins/builtin/iv-history/model.ts +85 -16
- package/src/plugins/builtin/iv-history/pane.tsx +2 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +6 -3
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/kelly-sizer/headless.ts +2 -2
- package/src/plugins/builtin/kelly-sizer/history.ts +10 -3
- package/src/plugins/builtin/kelly-sizer/pane.tsx +2 -2
- package/src/plugins/builtin/kelly-sizer/sections.tsx +1 -1
- package/src/plugins/builtin/macro-day/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/release-table.ts +5 -5
- package/src/plugins/builtin/macro-day/releases.ts +11 -9
- package/src/plugins/builtin/market-movers/headless.ts +6 -2
- package/src/plugins/builtin/market-movers/screener.ts +18 -4
- package/src/plugins/builtin/members/breadth-pane.tsx +3 -3
- package/src/plugins/builtin/members/client.ts +24 -2
- package/src/plugins/builtin/members/headless.ts +66 -9
- package/src/plugins/builtin/members/index.tsx +7 -6
- package/src/plugins/builtin/members/model.ts +89 -5
- package/src/plugins/builtin/members/pane.tsx +70 -21
- package/src/plugins/builtin/mna/distress/pane.tsx +2 -1
- package/src/plugins/builtin/mna/pane.tsx +1 -1
- package/src/plugins/builtin/money-markets/client.ts +43 -15
- package/src/plugins/builtin/money-markets/headless.ts +18 -11
- package/src/plugins/builtin/money-markets/index.tsx +7 -6
- package/src/plugins/builtin/money-markets/model.ts +20 -5
- package/src/plugins/builtin/money-markets/pane.tsx +28 -17
- package/src/plugins/builtin/news/wire/news/footer.ts +11 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +15 -5
- package/src/plugins/builtin/notes/headless.ts +94 -0
- package/src/plugins/builtin/notes/index.tsx +3 -1
- package/src/plugins/builtin/notes/store.ts +10 -3
- package/src/plugins/builtin/options/footer.ts +8 -2
- package/src/plugins/builtin/options/open-interest-as-of.ts +12 -3
- package/src/plugins/builtin/options/view.tsx +10 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/options-positioning/client.ts +35 -8
- package/src/plugins/builtin/options-positioning/headless.ts +17 -7
- package/src/plugins/builtin/options-positioning/index.tsx +10 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +16 -7
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/pane.tsx +2 -2
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -2
- package/src/plugins/builtin/perps/client.ts +54 -15
- package/src/plugins/builtin/perps/headless.ts +39 -13
- package/src/plugins/builtin/perps/index.tsx +2 -1
- package/src/plugins/builtin/perps/model.ts +43 -1
- package/src/plugins/builtin/perps/pane.tsx +35 -18
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +74 -0
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +7 -3
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +33 -3
- package/src/plugins/builtin/portfolio-list/cli/render.ts +149 -24
- package/src/plugins/builtin/portfolio-list/headless.ts +30 -9
- package/src/plugins/builtin/portfolio-list/income.ts +17 -8
- package/src/plugins/builtin/portfolio-list/index.tsx +4 -4
- package/src/plugins/builtin/portfolio-list/pane/fx-day-moves.ts +52 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +76 -9
- package/src/plugins/builtin/portfolio-list/pane/target-weights.tsx +178 -0
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +44 -5
- package/src/plugins/builtin/portfolio-list/settings.ts +12 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +9 -4
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +21 -2
- package/src/plugins/builtin/portfolio-list/table.tsx +33 -25
- package/src/plugins/builtin/power/gas.tsx +2 -2
- package/src/plugins/builtin/power/prices.tsx +2 -2
- package/src/plugins/builtin/primary-dealers/pane.tsx +10 -11
- package/src/plugins/builtin/rate-path/model.ts +9 -0
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +27 -0
- package/src/plugins/builtin/realized-vol/headless.ts +19 -12
- package/src/plugins/builtin/realized-vol/model.ts +14 -6
- package/src/plugins/builtin/realized-vol/pane.tsx +15 -8
- package/src/plugins/builtin/realized-vol/settings.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +1 -1
- package/src/plugins/builtin/research/analyst-headless.ts +5 -1
- package/src/plugins/builtin/research/analyst-model.ts +7 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/relative-valuation-basis.ts +44 -4
- package/src/plugins/builtin/research/relative-valuation-headless.ts +59 -14
- package/src/plugins/builtin/research/relative-valuation-model.ts +65 -26
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +42 -17
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +34 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +30 -15
- package/src/plugins/builtin/reverse-dcf/model.ts +190 -29
- package/src/plugins/builtin/reverse-dcf/pane.tsx +35 -13
- package/src/plugins/builtin/risk-factors/pane.tsx +2 -2
- package/src/plugins/builtin/roadmap/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-pane.tsx +4 -4
- package/src/plugins/builtin/scanner/headless.ts +15 -1
- package/src/plugins/builtin/seasonality/client.ts +66 -17
- package/src/plugins/builtin/seasonality/headless.ts +7 -2
- package/src/plugins/builtin/seasonality/model.ts +12 -3
- package/src/plugins/builtin/seasonality/pane.tsx +5 -3
- package/src/plugins/builtin/sec/fund-facts-view.tsx +5 -2
- package/src/plugins/builtin/sec/fund-facts.ts +41 -1
- package/src/plugins/builtin/sec/headless.ts +8 -4
- package/src/plugins/builtin/sec/index.tsx +41 -13
- package/src/plugins/builtin/shared/ticker-company.ts +111 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +65 -8
- package/src/plugins/builtin/shared/volatility/live-session.ts +23 -0
- package/src/plugins/builtin/shared/volatility-indices.ts +2 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +1 -1
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +3 -3
- package/src/plugins/builtin/social-mentions/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +1 -1
- package/src/plugins/builtin/themes/pane.tsx +4 -4
- package/src/plugins/builtin/thirteenf/api.ts +1 -0
- package/src/plugins/builtin/thirteenf/format.ts +5 -0
- package/src/plugins/builtin/thirteenf/headless.ts +2 -2
- package/src/plugins/builtin/thirteenf/model.ts +128 -5
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/report-notes.ts +10 -3
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/table.ts +2 -2
- package/src/plugins/builtin/thirteenf/types.ts +12 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +27 -14
- package/src/plugins/builtin/ticker-detail/data-panes/returns-history.ts +6 -3
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +14 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +87 -19
- package/src/plugins/builtin/ticker-detail/financials/exchange-results.ts +54 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +114 -9
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +37 -20
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +42 -19
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +3 -2
- package/src/plugins/builtin/ticker-detail/headless.ts +90 -31
- package/src/plugins/builtin/ticker-detail/overview/model.ts +22 -15
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +5 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +12 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +21 -0
- package/src/plugins/builtin/trace-bonds/client.ts +107 -10
- package/src/plugins/builtin/trace-bonds/detail.tsx +1 -1
- package/src/plugins/builtin/trace-bonds/headless.ts +20 -5
- package/src/plugins/builtin/trace-bonds/pane.tsx +15 -4
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/pane.tsx +1 -1
- package/src/plugins/builtin/treasury-daily/pane.tsx +2 -2
- package/src/plugins/builtin/vol-surface/charts.tsx +30 -5
- package/src/plugins/builtin/vol-surface/client.ts +40 -12
- package/src/plugins/builtin/vol-surface/events.ts +213 -0
- package/src/plugins/builtin/vol-surface/headless.ts +82 -13
- package/src/plugins/builtin/vol-surface/index.tsx +5 -1
- package/src/plugins/builtin/vol-surface/model.ts +42 -6
- package/src/plugins/builtin/vol-surface/pane.tsx +95 -23
- package/src/plugins/builtin/volatility/dvol.ts +14 -2
- package/src/plugins/builtin/volatility/headless.ts +3 -2
- package/src/plugins/builtin/volatility/index.tsx +1 -1
- package/src/plugins/builtin/volatility/pane.tsx +1 -1
- package/src/plugins/builtin/volatility/series.ts +7 -3
- package/src/plugins/builtin/world-venue-map/activity-series.ts +89 -0
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +123 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +2 -0
- package/src/plugins/builtin/world-venue-map/geo-series.ts +35 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +58 -9
- package/src/plugins/builtin/world-venue-map/index.ts +6 -3
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +6 -1
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/yield-curve/index.tsx +12 -10
- package/src/plugins/builtin/yield-curve/swaps.tsx +1 -1
- package/src/plugins/extracted-plugins.ts +14 -10
- package/src/plugins/installer.ts +17 -1
- package/src/plugins/marketplace/feed.ts +14 -0
- package/src/plugins/marketplace/install-offer.ts +64 -0
- package/src/plugins/registry/contributions.ts +46 -8
- package/src/plugins/registry/index.ts +5 -0
- package/src/portfolio/collection-name.ts +38 -4
- package/src/portfolio/column-values.ts +32 -4
- package/src/portfolio/period-pnl.ts +4 -2
- package/src/react/async-resource.ts +24 -8
- package/src/remote/endpoint.ts +38 -12
- package/src/remote/secrets.ts +22 -6
- package/src/remote/server.ts +20 -4
- package/src/renderers/dom/data-table/index.tsx +2 -1
- package/src/renderers/dom/data-table/row.tsx +49 -7
- package/src/renderers/dom/desktop/controls.tsx +3 -1
- package/src/renderers/dom/desktop/query-bar.tsx +57 -7
- package/src/renderers/dom/host/surface-3d.tsx +46 -5
- package/src/renderers/dom/styles.css +24 -4
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -21
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +16 -61
- package/src/renderers/electrobun/view/cli-pane-shot-socket.ts +134 -0
- package/src/renderers/electrobun/view/host-route.ts +119 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +6 -5
- package/src/renderers/opentui/box-width.ts +30 -0
- package/src/renderers/opentui/toast-host.tsx +6 -3
- package/src/renderers/opentui/ui-host.tsx +29 -5
- package/src/series/registry.ts +1 -0
- package/src/series/standalone-catalog.ts +40 -0
- package/src/series/types.ts +10 -0
- package/src/series/validate.ts +5 -0
- package/src/shares/portable-layout.ts +2 -7
- package/src/sources/gloomberb-cloud/dated-chunks.ts +133 -0
- package/src/sources/gloomberb-cloud/index.ts +46 -5
- package/src/sources/gloomberb-cloud/news.ts +15 -9
- package/src/sources/gloomberb-cloud/normalizers.ts +17 -0
- package/src/sources/history-coverage.ts +13 -0
- package/src/sources/history-result.ts +1 -0
- package/src/sources/provider-errors.ts +9 -0
- package/src/sources/provider-router/batches.ts +7 -3
- package/src/sources/provider-router/financial-routes.ts +3 -1
- package/src/sources/provider-router/history.ts +6 -4
- package/src/sources/provider-router/index.ts +5 -1
- package/src/sources/provider-router/primary.ts +4 -3
- package/src/sources/provider-router/retrieved-at.ts +12 -0
- package/src/team/store.ts +17 -4
- package/src/telemetry/crash-reports.ts +3 -1
- package/src/test-support/cli-context.ts +3 -2
- package/src/test-support/test-env.ts +7 -0
- package/src/theme/themes.ts +16 -9
- package/src/theme/tone-contrast.ts +29 -5
- package/src/tickers/company-name-listing.ts +31 -3
- package/src/tickers/company-name.ts +9 -0
- package/src/tickers/index-roots.ts +56 -4
- package/src/tickers/listing-name.ts +7 -2
- package/src/tickers/listing-venues.ts +17 -2
- package/src/tickers/search/home-listing.ts +2 -0
- package/src/tickers/search/index.ts +64 -11
- package/src/tickers/search/major-listings.json +595 -592
- package/src/tickers/search/ranking.ts +19 -1
- package/src/tickers/terminal-codes.ts +5 -3
- package/src/time-series/bar-aggregation.ts +3 -2
- package/src/time-series/base-series.ts +18 -1
- package/src/time-series/chart-data.ts +9 -6
- package/src/time-series/chart-seed.ts +11 -3
- package/src/time-series/currency-conversion.ts +1 -0
- package/src/time-series/date-window.ts +8 -0
- package/src/time-series/formula-months.ts +57 -0
- package/src/time-series/fundamentals/period-points.ts +3 -3
- package/src/time-series/fundamentals/source-statements.ts +5 -4
- package/src/time-series/leverage.ts +12 -4
- package/src/time-series/live-bars.ts +12 -7
- package/src/time-series/live-quotes.ts +6 -2
- package/src/time-series/market.ts +10 -3
- package/src/time-series/price-comparison.ts +106 -0
- package/src/time-series/range.ts +10 -0
- package/src/time-series/resolve-context.ts +7 -2
- package/src/time-series/resolve.ts +61 -5
- package/src/time-series/series-name.ts +2 -2
- package/src/time-series/series-presentation.ts +91 -2
- package/src/time-series/session-bar.ts +13 -7
- package/src/time-series/spec.ts +21 -2
- package/src/time-series/studies/formula.ts +262 -36
- package/src/time-series/studies/leverage.ts +9 -3
- package/src/time-series/studies/resolve.ts +7 -2
- package/src/time-series/types.ts +34 -0
- package/src/time-series/use-chart-resolution.ts +18 -1
- package/src/types/data-provider.ts +7 -0
- package/src/types/financials.ts +117 -2
- package/src/types/headless.ts +70 -3
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-context.ts +9 -0
- package/src/types/plugin-pane-templates.ts +6 -0
- package/src/types/plugin-panes.ts +7 -0
- package/src/types/price-history.ts +6 -0
- package/src/ui/host.tsx +3 -1
- package/src/ui/index.tsx +7 -2
- package/src/utils/cli-output.ts +21 -1
- package/src/utils/currency-units.ts +14 -0
- package/src/utils/datetime-format.ts +11 -0
- package/src/utils/exchange-announcements.ts +26 -3
- package/src/utils/exchange-notation.generated.ts +3 -4
- package/src/utils/exchange-results.ts +144 -0
- package/src/utils/exchanges.ts +10 -0
- package/src/utils/financial-statements.ts +212 -22
- package/src/utils/fire-and-forget.ts +1 -1
- package/src/utils/fiscal-period.ts +41 -3
- package/src/utils/format.ts +10 -6
- package/src/utils/fundamentals.ts +223 -15
- package/src/utils/futures-generic.ts +26 -0
- package/src/utils/lease-liabilities.ts +15 -5
- package/src/utils/lookup-token.ts +22 -0
- package/src/utils/max-drawdown.ts +25 -4
- package/src/utils/price-history-integrity.ts +56 -8
- package/src/utils/price-history.ts +6 -2
- package/src/utils/price-window.ts +38 -2
- package/src/utils/replace-file.ts +47 -0
- package/src/utils/rpc-timeout-error.ts +16 -2
- package/src/utils/untrusted-text.ts +14 -0
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { useCallback, useMemo, useRef, useState, type ReactNode } from "react";
|
|
2
|
+
import {
|
|
3
|
+
DataTableStackView,
|
|
4
|
+
PaneLinkMenu,
|
|
5
|
+
PaneStatusBody,
|
|
6
|
+
QueryBar,
|
|
7
|
+
sortStackItems,
|
|
8
|
+
usePaneNoticeFooter,
|
|
9
|
+
usePaneStatusFooter,
|
|
10
|
+
type DataTableCell,
|
|
11
|
+
type QueryBarView,
|
|
12
|
+
type StackSortPreference,
|
|
13
|
+
} from "../../../components";
|
|
14
|
+
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
15
|
+
import { useAsyncResource, useAutoRefresh } from "../../../public/react";
|
|
16
|
+
import { useThemeColors } from "../../../theme/theme-context";
|
|
17
|
+
import { Box, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
18
|
+
import { useAppSelector } from "../../../state/app/context";
|
|
19
|
+
import { getSharedMarketData } from "../../registry";
|
|
20
|
+
import { mapWithConcurrency } from "../../../utils/concurrency";
|
|
21
|
+
import { displayWidth } from "../../../utils/format";
|
|
22
|
+
import { formatShortDate } from "../../../utils/datetime-format";
|
|
23
|
+
import { parsePublicTickerKey } from "../../../utils/exchanges";
|
|
24
|
+
import { compareSortValues, nextHeaderSort, type SortDirection } from "../../../utils/sort-values";
|
|
25
|
+
import { usePluginPaneState } from "../../runtime";
|
|
26
|
+
import { SignInWall } from "../cloud/auth-actions";
|
|
27
|
+
import { listingCell } from "../shared/research-cells";
|
|
28
|
+
import { isCloudSessionRequired, useResearchCloudSession } from "../shared/research-cloud-session";
|
|
29
|
+
import { FORM4_CURRENCY } from "./base-values";
|
|
30
|
+
import { INSIDER_REPORT_FILINGS, loadParsedInsiderFilings } from "./client";
|
|
31
|
+
import { InsiderDetail, insiderDetailTitle } from "./detail";
|
|
32
|
+
import { insiderActivityCell, type InsiderViewControl } from "./insiders";
|
|
33
|
+
import { insiderEmptyNotice } from "./issuer";
|
|
34
|
+
import {
|
|
35
|
+
DEFAULT_INSIDER_TYPE_FILTER,
|
|
36
|
+
isInsiderTypeFilter,
|
|
37
|
+
matchesInsiderTypeFilter,
|
|
38
|
+
type InsiderTypeFilter,
|
|
39
|
+
type ParsedInsiderFiling,
|
|
40
|
+
} from "./model";
|
|
41
|
+
import { renderInsiderCell } from "./table";
|
|
42
|
+
import {
|
|
43
|
+
buildInsiderColumns,
|
|
44
|
+
buildInsiderTableRows,
|
|
45
|
+
compareInsiderRows,
|
|
46
|
+
type InsiderColumn,
|
|
47
|
+
type InsiderColumnId,
|
|
48
|
+
type InsiderTableRow,
|
|
49
|
+
} from "./table-model";
|
|
50
|
+
import { DEFAULT_INSIDER_SIGNAL_WINDOW, loadInsiderCompany } from "./signals-client";
|
|
51
|
+
import {
|
|
52
|
+
buildInsiderActivityColumns,
|
|
53
|
+
INSIDER_SIGNAL_WINDOW_OPTIONS,
|
|
54
|
+
insiderActivityEmptyTitle,
|
|
55
|
+
insiderActivityFirstDirection,
|
|
56
|
+
insiderActivityKey,
|
|
57
|
+
insiderActivityLines,
|
|
58
|
+
insiderActivitySortValue,
|
|
59
|
+
insiderSignalsCoverageNotice,
|
|
60
|
+
insiderSignalsQueryFrom,
|
|
61
|
+
insiderViewMode,
|
|
62
|
+
INSIDER_VIEW_OPTIONS,
|
|
63
|
+
type InsiderActivityColumn,
|
|
64
|
+
type InsiderActivityColumnId,
|
|
65
|
+
type InsiderActivityLine,
|
|
66
|
+
type InsiderViewMode,
|
|
67
|
+
} from "./signals-model";
|
|
68
|
+
import type { InsiderOpenedCompany } from "./signals";
|
|
69
|
+
|
|
70
|
+
/** Companies whose insiders are read at once. */
|
|
71
|
+
const TICKER_CONCURRENCY = 3;
|
|
72
|
+
/** Cells between two columns. */
|
|
73
|
+
const COLUMN_GAP = 1;
|
|
74
|
+
/** The width from which the Type filter shows every choice, as INS on a ticker does. */
|
|
75
|
+
const TYPE_FILTER_INLINE_WIDTH = 80;
|
|
76
|
+
|
|
77
|
+
type TickerLine = InsiderActivityLine & { ticker: string };
|
|
78
|
+
type TickerColumnId = InsiderActivityColumnId | "ticker";
|
|
79
|
+
type TickerColumn = Omit<InsiderActivityColumn, "id"> & { id: TickerColumnId };
|
|
80
|
+
|
|
81
|
+
interface TickersAnswer {
|
|
82
|
+
key: string;
|
|
83
|
+
lines: TickerLine[];
|
|
84
|
+
/** A company with no insider trades in the window, or whose list failed, as a line each. */
|
|
85
|
+
notes: string[];
|
|
86
|
+
asOf: string | null;
|
|
87
|
+
stale: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface TickersViewProps {
|
|
91
|
+
symbols: readonly string[];
|
|
92
|
+
width: number;
|
|
93
|
+
height: number;
|
|
94
|
+
focused: boolean;
|
|
95
|
+
renderCompany: (company: InsiderOpenedCompany) => ReactNode;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* INS on several tickers (`INS MO,PM,LMT`, or a watchlist's name), as `fn INS
|
|
100
|
+
* MO,PM,LMT` reads them: their Form 4 lines in one table with the Ticker
|
|
101
|
+
* column first, or their insiders, a choice in the query bar as for one
|
|
102
|
+
* ticker.
|
|
103
|
+
*/
|
|
104
|
+
export function InsiderTickersView(props: TickersViewProps) {
|
|
105
|
+
const [storedView, setView] = usePluginPaneState<InsiderViewMode>("insider:view", "trades");
|
|
106
|
+
const view = insiderViewMode(storedView);
|
|
107
|
+
const viewBar = useMemo<QueryBarView<InsiderViewMode>>(() => ({ value: view, options: INSIDER_VIEW_OPTIONS, onChange: setView }), [setView, view]);
|
|
108
|
+
return view === "insiders"
|
|
109
|
+
? <TickersInsidersView {...props} viewBar={viewBar} />
|
|
110
|
+
: <TickersTradesView {...props} viewBar={viewBar} />;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** A company's Form 4 lines in the several tickers' table: the line with its company. */
|
|
114
|
+
type TickerTradeRow = InsiderTableRow & { ticker: string };
|
|
115
|
+
type TradeColumnId = InsiderColumnId | "ticker";
|
|
116
|
+
type TradeColumn = Omit<InsiderColumn, "id"> & { id: TradeColumnId };
|
|
117
|
+
|
|
118
|
+
interface TradesAnswer {
|
|
119
|
+
key: string;
|
|
120
|
+
/** Each company's own Form 4 lines, newest first, in the order the tickers were given. */
|
|
121
|
+
parsed: Array<{ ticker: string; entries: ParsedInsiderFiling[] }>;
|
|
122
|
+
/** A company with no Form 4 of its own, or whose filings failed, as a line each. */
|
|
123
|
+
notes: string[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const TYPE_FILTER_LABELS: Record<InsiderTypeFilter, string> = { all: "All", trades: "Buys and sells", other: "Other" };
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The several tickers' trades: each company's last Form 4 filings, as many as
|
|
130
|
+
* `fn INS` reads (20), its lines together and newest first in the order the
|
|
131
|
+
* tickers were given, the Ticker column first. The Type filter is the one INS
|
|
132
|
+
* on a ticker has, opening on buys and sells; Enter opens a line's filing.
|
|
133
|
+
*/
|
|
134
|
+
function TickersTradesView({ symbols, width, height, focused, viewBar }: TickersViewProps & { viewBar: QueryBarView<InsiderViewMode> }) {
|
|
135
|
+
const colors = useThemeColors();
|
|
136
|
+
const key = symbols.join(",");
|
|
137
|
+
const loader = useCallback(async (_force: boolean): Promise<TradesAnswer> => {
|
|
138
|
+
const provider = getSharedMarketData();
|
|
139
|
+
if (!provider) throw new Error("Insider filing data unavailable");
|
|
140
|
+
const reads = await mapWithConcurrency([...symbols], TICKER_CONCURRENCY, async (ticker) => {
|
|
141
|
+
try {
|
|
142
|
+
return { ticker, read: await loadParsedInsiderFilings(provider, ticker, { limit: INSIDER_REPORT_FILINGS }) };
|
|
143
|
+
} catch (error) {
|
|
144
|
+
return { ticker, error };
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const read = reads.flatMap((entry) => "read" in entry && entry.read ? [{ ticker: entry.ticker, ...entry.read }] : []);
|
|
148
|
+
const failed = reads.flatMap((entry) => "error" in entry ? [entry] : []);
|
|
149
|
+
if (read.length === 0 && failed[0]) throw failed[0].error;
|
|
150
|
+
return {
|
|
151
|
+
key,
|
|
152
|
+
parsed: read.map((entry) => ({ ticker: entry.ticker, entries: entry.parsed })),
|
|
153
|
+
notes: [
|
|
154
|
+
...read.filter((entry) => entry.parsed.length === 0).map((entry) => `${entry.ticker}: ${insiderEmptyNotice(entry.foreignPrivateIssuer)}`),
|
|
155
|
+
...failed.map((entry) => `${entry.ticker}: ${entry.error instanceof Error ? entry.error.message : String(entry.error)}`),
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
}, [key, symbols]);
|
|
159
|
+
const resource = useAsyncResource(loader, { keepPreviousData: true });
|
|
160
|
+
const answer = resource.data?.key === key ? resource.data : null;
|
|
161
|
+
useAutoRefresh(resource.updatedAt, resource.load);
|
|
162
|
+
|
|
163
|
+
const [storedType, setTypeFilter] = usePluginPaneState<InsiderTypeFilter>("insider:typeFilter", DEFAULT_INSIDER_TYPE_FILTER);
|
|
164
|
+
const typeFilter = isInsiderTypeFilter(storedType) ? storedType : DEFAULT_INSIDER_TYPE_FILTER;
|
|
165
|
+
const [sort, setSort] = useState<StackSortPreference<TradeColumnId> | null>(null);
|
|
166
|
+
const [selectedId, setSelectedId] = useState<string | null>(null);
|
|
167
|
+
const [openId, setOpenId] = useState<string | null>(null);
|
|
168
|
+
const detailScrollRef = useRef<ScrollBoxRenderable | null>(null);
|
|
169
|
+
usePaneRefreshKey(resource.reload, { focused, enabled: !openId });
|
|
170
|
+
|
|
171
|
+
const typeCounts = useMemo(() => {
|
|
172
|
+
const counts: Record<InsiderTypeFilter, number> = { all: 0, trades: 0, other: 0 };
|
|
173
|
+
for (const { entries } of answer?.parsed ?? []) {
|
|
174
|
+
for (const entry of entries) {
|
|
175
|
+
if (entry.isLoading) continue;
|
|
176
|
+
counts.all += 1;
|
|
177
|
+
if (matchesInsiderTypeFilter(entry, "trades")) counts.trades += 1;
|
|
178
|
+
if (matchesInsiderTypeFilter(entry, "other")) counts.other += 1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return counts;
|
|
182
|
+
}, [answer]);
|
|
183
|
+
// Each company's lines newest first, by trade day, as INS on a ticker opens.
|
|
184
|
+
const rows = useMemo<TickerTradeRow[]>(() => (answer?.parsed ?? []).flatMap(({ ticker, entries }) =>
|
|
185
|
+
sortStackItems(buildInsiderTableRows(entries.filter((entry) => matchesInsiderTypeFilter(entry, typeFilter))), { columnId: "date", direction: "desc" }, compareInsiderRows)
|
|
186
|
+
.map((row) => ({ ...row, id: `${ticker}:${row.id}`, ticker }))), [answer, typeFilter]);
|
|
187
|
+
// As given until a header is clicked: each company's lines together, newest first.
|
|
188
|
+
const sortedRows = useMemo(() => {
|
|
189
|
+
if (!sort) return rows;
|
|
190
|
+
const order = new Map(rows.map((row, index) => [row.id, index]));
|
|
191
|
+
return sortStackItems(rows, sort, (a, b, columnId) => columnId === "ticker"
|
|
192
|
+
? a.ticker.localeCompare(b.ticker)
|
|
193
|
+
: compareInsiderRows(a, b, columnId), (a, b) => order.get(a.id)! - order.get(b.id)!);
|
|
194
|
+
}, [rows, sort]);
|
|
195
|
+
// Form 4 amounts are dollars: a reader whose base currency is another one gets them named, as INS on a ticker does.
|
|
196
|
+
const baseCurrency = useAppSelector((state) => state.config.baseCurrency);
|
|
197
|
+
const amountCurrency = baseCurrency.trim().toUpperCase() === FORM4_CURRENCY ? undefined : FORM4_CURRENCY;
|
|
198
|
+
const columns = useMemo<TradeColumn[]>(() => {
|
|
199
|
+
const tickerWidth = Math.max(displayWidth("Ticker") + 2, ...rows.map((row) => displayWidth(row.ticker)));
|
|
200
|
+
return [
|
|
201
|
+
{ id: "ticker", label: "Ticker", width: tickerWidth, align: "left" },
|
|
202
|
+
...buildInsiderColumns(Math.max(0, width - tickerWidth - COLUMN_GAP), rows, amountCurrency),
|
|
203
|
+
];
|
|
204
|
+
}, [amountCurrency, rows, width]);
|
|
205
|
+
const openRow = openId ? rows.find((row) => row.id === openId) ?? null : null;
|
|
206
|
+
|
|
207
|
+
usePaneStatusFooter({
|
|
208
|
+
registrationId: "insider:tickers:trades",
|
|
209
|
+
enabled: !openRow,
|
|
210
|
+
loading: resource.loading,
|
|
211
|
+
error: answer ? resource.error : null,
|
|
212
|
+
});
|
|
213
|
+
usePaneNoticeFooter({ registrationId: "insider:tickers:trades:notices", focused, enabled: !openRow, notices: answer?.notes ?? [] });
|
|
214
|
+
|
|
215
|
+
const typeOptions = useMemo(() => (["all", "trades", "other"] as const).map((value) => ({
|
|
216
|
+
value,
|
|
217
|
+
label: `${TYPE_FILTER_LABELS[value]} (${typeCounts[value]})`,
|
|
218
|
+
})), [typeCounts]);
|
|
219
|
+
const queryBar = (
|
|
220
|
+
<QueryBar
|
|
221
|
+
width={width}
|
|
222
|
+
filters={[{
|
|
223
|
+
id: "type",
|
|
224
|
+
label: "Type",
|
|
225
|
+
value: typeFilter,
|
|
226
|
+
defaultValue: DEFAULT_INSIDER_TYPE_FILTER,
|
|
227
|
+
options: typeOptions,
|
|
228
|
+
// Every count in view where there is room, as on one ticker.
|
|
229
|
+
inline: width >= TYPE_FILTER_INLINE_WIDTH,
|
|
230
|
+
onChange: (value: string) => {
|
|
231
|
+
if (!isInsiderTypeFilter(value)) return;
|
|
232
|
+
setTypeFilter(value);
|
|
233
|
+
setSelectedId(null);
|
|
234
|
+
},
|
|
235
|
+
}]}
|
|
236
|
+
view={viewBar}
|
|
237
|
+
/>
|
|
238
|
+
);
|
|
239
|
+
if (!answer) {
|
|
240
|
+
return (
|
|
241
|
+
<Box flexDirection="column" width={width} height={height}>
|
|
242
|
+
<QueryBar width={width} view={viewBar} />
|
|
243
|
+
<PaneStatusBody
|
|
244
|
+
loading={resource.loading}
|
|
245
|
+
error={resource.error}
|
|
246
|
+
retry={{ onRetry: resource.reloadAndWait, pending: resource.loading }}
|
|
247
|
+
subject="Insider filings"
|
|
248
|
+
/>
|
|
249
|
+
</Box>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
const renderCell = (row: TickerTradeRow, column: TradeColumn, index: number, state: { selected: boolean }): DataTableCell =>
|
|
253
|
+
column.id === "ticker"
|
|
254
|
+
? listingCell(row.ticker, colors, state.selected)
|
|
255
|
+
: renderInsiderCell(row, column as InsiderColumn, index, state);
|
|
256
|
+
return (
|
|
257
|
+
<DataTableStackView<TickerTradeRow, TradeColumn>
|
|
258
|
+
focused={focused}
|
|
259
|
+
detailOpen={!!openRow}
|
|
260
|
+
onBack={() => setOpenId(null)}
|
|
261
|
+
detailTitle={openRow ? `${openRow.ticker} · ${insiderDetailTitle(openRow)}` : undefined}
|
|
262
|
+
detailScrollRef={detailScrollRef}
|
|
263
|
+
detailContent={openRow ? <PaneLinkMenu><InsiderDetail row={openRow} width={width} scrollRef={detailScrollRef} /></PaneLinkMenu> : <Box flexGrow={1} />}
|
|
264
|
+
rootBefore={queryBar}
|
|
265
|
+
rootWidth={width}
|
|
266
|
+
rootHeight={height}
|
|
267
|
+
columns={columns}
|
|
268
|
+
items={sortedRows}
|
|
269
|
+
getItemKey={(row) => row.id}
|
|
270
|
+
selection={{ kind: "id", selectedId, getId: (row) => row.id, onChange: setSelectedId }}
|
|
271
|
+
onActivate={(row) => {
|
|
272
|
+
setSelectedId(row.id);
|
|
273
|
+
setOpenId(row.id);
|
|
274
|
+
}}
|
|
275
|
+
sortColumnId={sort?.columnId ?? null}
|
|
276
|
+
sortDirection={sort?.direction ?? "desc"}
|
|
277
|
+
onHeaderClick={(columnId) => setSort((current) => nextHeaderSort(current ?? { columnId: null, direction: "desc" }, columnId as TradeColumnId, {
|
|
278
|
+
firstDirection: (id) => id === "ticker" || id === "insider" || id === "role" || id === "type" || id === "security" ? "asc" : "desc",
|
|
279
|
+
}))}
|
|
280
|
+
renderCell={renderCell}
|
|
281
|
+
selectedTextOverridesCellColor
|
|
282
|
+
showHorizontalScrollbar={false}
|
|
283
|
+
emptyStateTitle={typeFilter === "trades" ? "No open-market buys or sells in these filings." : "No insider transactions."}
|
|
284
|
+
emptyStateHint={typeFilter === "trades" && typeCounts.other > 0 ? `Type Other has ${typeCounts.other} awards, exercises, tax and gift lines.` : undefined}
|
|
285
|
+
/>
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The several tickers' insiders: each company's insiders over the window in
|
|
291
|
+
* one table, the Ticker column first, as `fn INS MO,PM,LMT --view insiders`
|
|
292
|
+
* lists them. Enter opens the row's company on that insider's trades, Back
|
|
293
|
+
* returns here.
|
|
294
|
+
*/
|
|
295
|
+
function TickersInsidersView({ symbols, width, height, focused, renderCompany, viewBar }: TickersViewProps & { viewBar: QueryBarView<InsiderViewMode> }) {
|
|
296
|
+
const colors = useThemeColors();
|
|
297
|
+
const { nativePaneChrome } = useUiCapabilities();
|
|
298
|
+
const session = useResearchCloudSession();
|
|
299
|
+
const [storedWindow, setWindow] = usePluginPaneState<number>("insider:signals:window", DEFAULT_INSIDER_SIGNAL_WINDOW);
|
|
300
|
+
const window = insiderSignalsQueryFrom({ window: storedWindow }).window;
|
|
301
|
+
const key = `${symbols.join(",")}:${window}`;
|
|
302
|
+
const loader = useCallback(async (force: boolean): Promise<TickersAnswer> => {
|
|
303
|
+
const reads = await mapWithConcurrency([...symbols], TICKER_CONCURRENCY, async (symbol) => {
|
|
304
|
+
try {
|
|
305
|
+
return { symbol, read: await loadInsiderCompany({ ticker: parsePublicTickerKey(symbol).symbol, window }, { force }) };
|
|
306
|
+
} catch (error) {
|
|
307
|
+
return { symbol, error };
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
const read = reads.flatMap((entry) => "read" in entry && entry.read ? [{ symbol: entry.symbol, ...entry.read }] : []);
|
|
311
|
+
const failed = reads.flatMap((entry) => "error" in entry ? [entry] : []);
|
|
312
|
+
// Nothing read: the first failure is the answer, so a signed-out pane shows its wall.
|
|
313
|
+
if (read.length === 0 && failed[0]) throw failed[0].error;
|
|
314
|
+
const lines = read.flatMap((entry) => insiderActivityLines(entry.payload).map((line) => ({ ...line, ticker: entry.symbol })));
|
|
315
|
+
const notes = [
|
|
316
|
+
...read.filter((entry) => !lines.some((line) => line.ticker === entry.symbol))
|
|
317
|
+
.map((entry) => `${entry.symbol}: ${insiderActivityEmptyTitle(window)}`),
|
|
318
|
+
...failed.map((entry) => `${entry.symbol}: ${entry.error instanceof Error ? entry.error.message : String(entry.error)}`),
|
|
319
|
+
...new Set(read.flatMap((entry) => [entry.payload.buy, entry.payload.sell]
|
|
320
|
+
.map((payload) => insiderSignalsCoverageNotice(payload, { subject: "this list" }))
|
|
321
|
+
.filter((notice): notice is string => !!notice))),
|
|
322
|
+
];
|
|
323
|
+
return {
|
|
324
|
+
key,
|
|
325
|
+
lines,
|
|
326
|
+
notes,
|
|
327
|
+
asOf: read.map((entry) => entry.payload.buy.asOf).filter((at): at is string => !!at).sort().at(-1) ?? null,
|
|
328
|
+
stale: read.some((entry) => entry.stale),
|
|
329
|
+
};
|
|
330
|
+
}, [key, symbols, window]);
|
|
331
|
+
const resource = useAsyncResource(loader, {
|
|
332
|
+
clearOnError: (error) => error instanceof Error && isCloudSessionRequired(error.message),
|
|
333
|
+
keepPreviousData: true,
|
|
334
|
+
});
|
|
335
|
+
const answer = resource.data?.key === key ? resource.data : resource.loading ? resource.data ?? null : null;
|
|
336
|
+
useAutoRefresh(resource.updatedAt, resource.load);
|
|
337
|
+
|
|
338
|
+
// The opened company, and the insider whose trades it shows.
|
|
339
|
+
const [openTicker, setOpenTicker] = usePluginPaneState<string | null>("insider:tickers:open", null);
|
|
340
|
+
const [openInsider, setOpenInsider] = usePluginPaneState<string | null>("insider:tickers:insider", null);
|
|
341
|
+
const [openView, setOpenView] = useState<InsiderViewMode>("trades");
|
|
342
|
+
const [transactionOpen, setTransactionOpen] = useState(false);
|
|
343
|
+
const detailOpen = !!openTicker;
|
|
344
|
+
usePaneRefreshKey(resource.reload, { focused, enabled: !detailOpen });
|
|
345
|
+
|
|
346
|
+
const [sort, setSort] = useState<{ columnId: TickerColumnId; direction: SortDirection }>({ columnId: "bought", direction: "desc" });
|
|
347
|
+
const lines = useMemo(() => answer?.lines ?? [], [answer]);
|
|
348
|
+
const sortedLines = useMemo(() => {
|
|
349
|
+
const order = new Map(lines.map((line, index) => [line, index]));
|
|
350
|
+
const value = (line: TickerLine) => sort.columnId === "ticker" ? line.ticker : insiderActivitySortValue(line, sort.columnId);
|
|
351
|
+
return [...lines].sort((a, b) => compareSortValues(value(a), value(b), sort.direction) || order.get(a)! - order.get(b)!);
|
|
352
|
+
}, [lines, sort]);
|
|
353
|
+
const columns = useMemo<TickerColumn[]>(() => {
|
|
354
|
+
const tickerWidth = Math.max(displayWidth("Ticker") + 2, ...lines.map((line) => displayWidth(line.ticker)));
|
|
355
|
+
return [
|
|
356
|
+
{ id: "ticker", label: "Ticker", width: tickerWidth, align: "left" },
|
|
357
|
+
...buildInsiderActivityColumns(Math.max(0, width - tickerWidth - COLUMN_GAP), lines),
|
|
358
|
+
];
|
|
359
|
+
}, [lines, width]);
|
|
360
|
+
const lineKey = useCallback((line: TickerLine) => `${line.ticker}:${insiderActivityKey(line)}`, []);
|
|
361
|
+
const [selectedKey, setSelectedKey] = useState<string | null>(null);
|
|
362
|
+
|
|
363
|
+
usePaneStatusFooter({
|
|
364
|
+
registrationId: "insider:tickers",
|
|
365
|
+
enabled: !detailOpen,
|
|
366
|
+
loading: resource.loading,
|
|
367
|
+
error: answer ? resource.error : null,
|
|
368
|
+
stale: !!answer?.stale,
|
|
369
|
+
info: answer?.asOf
|
|
370
|
+
? [{ id: "asof", asOf: true, parts: [{ text: `as of ${formatShortDate(answer.asOf, { utc: true })}`, tone: "muted" as const }] }]
|
|
371
|
+
: [],
|
|
372
|
+
});
|
|
373
|
+
usePaneNoticeFooter({ registrationId: "insider:tickers:notices", focused, enabled: !detailOpen, notices: answer?.notes ?? [] });
|
|
374
|
+
|
|
375
|
+
const openControl = useMemo<InsiderViewControl>(() => ({
|
|
376
|
+
view: openView, setView: setOpenView, window, setWindow, side: "buy",
|
|
377
|
+
}), [openView, setWindow, window]);
|
|
378
|
+
const openCompany = useCallback((line: TickerLine) => {
|
|
379
|
+
setSelectedKey(lineKey(line));
|
|
380
|
+
setOpenView("trades");
|
|
381
|
+
setOpenInsider(line.buyer.name);
|
|
382
|
+
setOpenTicker(line.ticker);
|
|
383
|
+
}, [lineKey, setOpenInsider, setOpenTicker]);
|
|
384
|
+
const closeCompany = useCallback(() => {
|
|
385
|
+
setTransactionOpen(false);
|
|
386
|
+
setOpenTicker(null);
|
|
387
|
+
setOpenInsider(null);
|
|
388
|
+
}, [setOpenInsider, setOpenTicker]);
|
|
389
|
+
|
|
390
|
+
const renderCell = (line: TickerLine, column: TickerColumn, _index: number, state: { selected: boolean }): DataTableCell =>
|
|
391
|
+
column.id === "ticker"
|
|
392
|
+
? listingCell(line.ticker, colors, state.selected)
|
|
393
|
+
: insiderActivityCell(line, column as InsiderActivityColumn, colors, state.selected, !!nativePaneChrome);
|
|
394
|
+
|
|
395
|
+
if (!answer && isCloudSessionRequired(resource.error)) {
|
|
396
|
+
return <SignInWall placement="insider-tickers-signin" width={width} height={height} action="view insiders" needsVerification={session.needsVerification} />;
|
|
397
|
+
}
|
|
398
|
+
const queryBar = (
|
|
399
|
+
<QueryBar
|
|
400
|
+
width={width}
|
|
401
|
+
filters={[{
|
|
402
|
+
id: "window",
|
|
403
|
+
label: "Window",
|
|
404
|
+
title: "Days of insider buying and selling",
|
|
405
|
+
value: String(window),
|
|
406
|
+
defaultValue: String(DEFAULT_INSIDER_SIGNAL_WINDOW),
|
|
407
|
+
options: INSIDER_SIGNAL_WINDOW_OPTIONS,
|
|
408
|
+
inline: true,
|
|
409
|
+
onChange: (value: string) => setWindow(Number(value)),
|
|
410
|
+
}]}
|
|
411
|
+
view={viewBar}
|
|
412
|
+
/>
|
|
413
|
+
);
|
|
414
|
+
if (!answer && !detailOpen) {
|
|
415
|
+
return (
|
|
416
|
+
<Box flexDirection="column" width={width} height={height}>
|
|
417
|
+
{queryBar}
|
|
418
|
+
<PaneStatusBody
|
|
419
|
+
loading={resource.loading}
|
|
420
|
+
error={resource.error}
|
|
421
|
+
retry={{ onRetry: resource.reloadAndWait, pending: resource.loading }}
|
|
422
|
+
subject="Insiders"
|
|
423
|
+
/>
|
|
424
|
+
</Box>
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
const company = openTicker
|
|
428
|
+
? renderCompany({
|
|
429
|
+
symbol: parsePublicTickerKey(openTicker).symbol,
|
|
430
|
+
title: openTicker,
|
|
431
|
+
control: openControl,
|
|
432
|
+
...(openInsider ? { insider: openInsider } : {}),
|
|
433
|
+
width,
|
|
434
|
+
height,
|
|
435
|
+
focused,
|
|
436
|
+
onDetailChange: setTransactionOpen,
|
|
437
|
+
})
|
|
438
|
+
: null;
|
|
439
|
+
return (
|
|
440
|
+
<DataTableStackView<TickerLine, TickerColumn>
|
|
441
|
+
focused={focused && !transactionOpen}
|
|
442
|
+
detailOpen={detailOpen}
|
|
443
|
+
onBack={closeCompany}
|
|
444
|
+
detailTitle={openTicker ?? undefined}
|
|
445
|
+
detailContent={company}
|
|
446
|
+
rootWidth={width}
|
|
447
|
+
rootHeight={height}
|
|
448
|
+
rootBefore={queryBar}
|
|
449
|
+
columns={columns}
|
|
450
|
+
items={sortedLines}
|
|
451
|
+
getItemKey={lineKey}
|
|
452
|
+
selection={{ kind: "id", selectedId: selectedKey, getId: lineKey, onChange: setSelectedKey }}
|
|
453
|
+
onActivate={openCompany}
|
|
454
|
+
sortColumnId={sort.columnId}
|
|
455
|
+
sortDirection={sort.direction}
|
|
456
|
+
onHeaderClick={(columnId) => setSort((current) => nextHeaderSort(current, columnId as TickerColumnId, {
|
|
457
|
+
firstDirection: (id) => id === "ticker" ? "asc" : insiderActivityFirstDirection(id as InsiderActivityColumnId),
|
|
458
|
+
}))}
|
|
459
|
+
renderCell={renderCell}
|
|
460
|
+
selectedTextOverridesCellColor
|
|
461
|
+
showHorizontalScrollbar={false}
|
|
462
|
+
emptyStateTitle={insiderActivityEmptyTitle(window)}
|
|
463
|
+
emptyStateHint="Enter on an insider shows their trades."
|
|
464
|
+
/>
|
|
465
|
+
);
|
|
466
|
+
}
|
|
@@ -89,7 +89,7 @@ export function IpoCalendarPane({ focused, width, height }: PaneProps) {
|
|
|
89
89
|
const { active: searching, focus: focusSearch, blur: blurSearch, searchProps } = useQueryBarSearch();
|
|
90
90
|
|
|
91
91
|
useAutoRefresh(resource.updatedAt, resource.load);
|
|
92
|
-
usePaneRefreshKey(() =>
|
|
92
|
+
usePaneRefreshKey(() => resource.reload(), { focused, enabled: !searching });
|
|
93
93
|
|
|
94
94
|
// One clock per board, so a deal's status, its place and a search for it agree.
|
|
95
95
|
const now = useMemo(() => new Date(), [deals, resource.updatedAt]);
|
|
@@ -31,8 +31,9 @@ export interface IvPoint {
|
|
|
31
31
|
iv180: number | null;
|
|
32
32
|
iv365: number | null;
|
|
33
33
|
/**
|
|
34
|
-
* 30-day 25-delta put and call IV
|
|
35
|
-
*
|
|
34
|
+
* 30-day 25-delta put and call IV: on quote captures, and on trade closes
|
|
35
|
+
* from servers that read the wings from the closes too. Optional: a server
|
|
36
|
+
* that leaves them out has no skew history to give.
|
|
36
37
|
*/
|
|
37
38
|
put25_30?: number | null;
|
|
38
39
|
call25_30?: number | null;
|
|
@@ -43,6 +44,8 @@ export interface IvStats {
|
|
|
43
44
|
value: number;
|
|
44
45
|
date: string;
|
|
45
46
|
method: IvMethod;
|
|
47
|
+
/** The underlying at the reading: a close's session close, a quote capture's spot. Absent from older servers. */
|
|
48
|
+
spot?: number | null;
|
|
46
49
|
basis?: IvCloseBasis | null;
|
|
47
50
|
rank: number | null;
|
|
48
51
|
percentile: number | null;
|
|
@@ -55,6 +58,29 @@ export interface IvStats {
|
|
|
55
58
|
/** Why rank or percentile is empty, when one is. */
|
|
56
59
|
rankNote?: string | null;
|
|
57
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* The latest 30-day 25-delta risk reversal (call IV minus put IV, decimal)
|
|
63
|
+
* against its own prior 52 weeks, closes against closes (a symbol whose closes
|
|
64
|
+
* carry no wings: quote captures against quote captures). Rank and percentile
|
|
65
|
+
* come from `minSamples` prior sessions; until they reach back a year
|
|
66
|
+
* (`fullYear`) a reader says how many there are. Absent from older servers.
|
|
67
|
+
*/
|
|
68
|
+
export interface IvRiskReversalStats {
|
|
69
|
+
value: number;
|
|
70
|
+
put25: number;
|
|
71
|
+
call25: number;
|
|
72
|
+
date: string;
|
|
73
|
+
method: IvMethod;
|
|
74
|
+
basis?: IvCloseBasis | null;
|
|
75
|
+
rank: number | null;
|
|
76
|
+
percentile: number | null;
|
|
77
|
+
low: number | null;
|
|
78
|
+
high: number | null;
|
|
79
|
+
samples: number;
|
|
80
|
+
windowStart: string | null;
|
|
81
|
+
minSamples: number;
|
|
82
|
+
fullYear: boolean;
|
|
83
|
+
}
|
|
58
84
|
interface IvReading {
|
|
59
85
|
date: string;
|
|
60
86
|
method: IvMethod;
|
|
@@ -78,7 +104,7 @@ export interface IvHistoryPayload {
|
|
|
78
104
|
/** First trade close with a one-year reading; the 1Y series starts later and is sparser. */
|
|
79
105
|
iv365Since?: string | null;
|
|
80
106
|
} | null;
|
|
81
|
-
stats: { iv30: IvStats | null; iv90: IvStats | null; iv365?: IvStats | null };
|
|
107
|
+
stats: { iv30: IvStats | null; iv90: IvStats | null; iv365?: IvStats | null; rr25?: IvRiskReversalStats | null };
|
|
82
108
|
latest: IvReading | null;
|
|
83
109
|
series: IvPoint[];
|
|
84
110
|
warnings: string[];
|
|
@@ -98,7 +124,9 @@ export interface IvScreenRow {
|
|
|
98
124
|
iv365?: IvStats | null;
|
|
99
125
|
iv365Since?: string | null;
|
|
100
126
|
latest: IvReading | null;
|
|
127
|
+
/** The newest quote capture's wings; `rr25` is the ranked close's, where the server gives it. */
|
|
101
128
|
skew: { date: string; put25: number; call25: number; skew: number } | null;
|
|
129
|
+
rr25?: IvRiskReversalStats | null;
|
|
102
130
|
}
|
|
103
131
|
/** Why a name IV history covers has no rank yet, by where its history stands. */
|
|
104
132
|
const IV_COVERAGE_REASONS: Partial<Record<IvCoverageStatus, string>> = {
|
|
@@ -180,6 +208,8 @@ export interface ScreenHv {
|
|
|
180
208
|
date: string | null;
|
|
181
209
|
/** HV after each session's close, oldest first; sessions without a full window are left out. */
|
|
182
210
|
series: ReadonlyArray<readonly [date: string, value: number]>;
|
|
211
|
+
/** Each session's close, by date: the spot of a trade-close reading a server does not price. */
|
|
212
|
+
closes?: ReadonlyMap<string, number>;
|
|
183
213
|
}
|
|
184
214
|
|
|
185
215
|
const barDay = (value: Date) => new Date(value).toISOString().slice(0, 10);
|
|
@@ -196,7 +226,8 @@ export function screenHv(history: readonly PricePoint[], window: number): Screen
|
|
|
196
226
|
const date = barDay(point.date);
|
|
197
227
|
return latest == null || date > latest ? date : latest;
|
|
198
228
|
}, null);
|
|
199
|
-
|
|
229
|
+
const closes = new Map(history.flatMap((point) => Number.isFinite(point.close) && point.close > 0 ? [[barDay(point.date), point.close] as const] : []));
|
|
230
|
+
return { value: rolling.at(-1)?.values[window] ?? null, date: newest, series, closes };
|
|
200
231
|
}
|
|
201
232
|
|
|
202
233
|
/**
|
|
@@ -3,7 +3,7 @@ import { resolveHeadlessInstrument } from "../shared/headless-market-data";
|
|
|
3
3
|
import { createRealizedVolatilityDependencies, loadRealizedVolatilityHistory } from "../realized-vol/client";
|
|
4
4
|
import { createHvDependencies, loadIvHistory, loadIvScreen, loadScreenVolatilities } from "./client";
|
|
5
5
|
import { formatPoints, formatRank, formatSpot, formatStat, formatVol, IMPLIED_VOL_WORDS, readingLabel, sharedDates, skewHeader, statSource, vcaDefinitions, verdictLabel } from "./format";
|
|
6
|
-
import { HV_WINDOWS, type HvWindow, type IvLookback, type IvStatRow, projectIvHistory, projectRichCheap, type RichCheapRow, richCheapDates, screenCoverage, screenStaleNote, VCA_LIMIT, VCA_PRESETS } from "./model";
|
|
6
|
+
import { HV_WINDOWS, type HvWindow, type IvLookback, type IvStatRow, projectIvHistory, projectRichCheap, type RichCheapRow, richCheapDates, screenCoverage, screenRiskReversalNote, screenStaleNote, VCA_LIMIT, VCA_PRESETS } from "./model";
|
|
7
7
|
import { vcaUniverse } from "./universe";
|
|
8
8
|
import { offsetText, releaseOffsetRows } from "./events";
|
|
9
9
|
import { loadMacroReleases } from "../macro-day/client";
|
|
@@ -32,7 +32,8 @@ export const ivHistoryHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
32
32
|
discovery: { aliases: ["HIVG"], suggestFor: IMPLIED_VOL_WORDS, screenshotReadiness: "live-dom", dataRequirements: ["Cloud stored implied volatility", "Daily price history"],
|
|
33
33
|
limitations: ["History starts February 2024 (daily option trade closes).", "Rank and percentile use trade-close readings only.",
|
|
34
34
|
"IV1Y needs long-dated trades: it can start later, has gaps, and ranks from 60 prior sessions.",
|
|
35
|
-
"skew25d (put-call) and rr25d (call-put) come from
|
|
35
|
+
"skew25d (put-call) and rr25d (call-put) come from each session's close where it carries the 25-delta wings, else its quote capture.",
|
|
36
|
+
"The 25D RR percentile ranks closes against closes and needs 20 prior sessions; until a year exists the notes say how many it rests on."] },
|
|
36
37
|
options: [
|
|
37
38
|
{ key: "lookback", type: "enum", values: [{ value: "1Y" }, { value: "2Y" }, { value: "ALL" }], defaultValue: "1Y", description: "Visible history" },
|
|
38
39
|
{ key: "hvWindow", type: "enum", values: HV_WINDOWS.map((window) => ({ value: String(window) })), defaultValue: "20", description: "Realized volatility window in sessions" },
|
|
@@ -82,7 +83,8 @@ export const ivHistoryHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
82
83
|
// With nothing served, the fate is why: no "not a ticker" or missing-history errors beside it.
|
|
83
84
|
const { notes: fateNotes, errors } = listingFateReport(fate, { served },
|
|
84
85
|
[prices.error, ...model.warnings].filter((value): value is string => !!value));
|
|
85
|
-
const notes = [...fateNotes, ...[model.oneYearNote, model.skewNote, model.staleNote]
|
|
86
|
+
const notes = [...fateNotes, ...[model.oneYearNote, model.skewNote, model.riskReversalNote, model.staleNote]
|
|
87
|
+
.filter((note): note is string => !!note)];
|
|
86
88
|
if (event && releases) {
|
|
87
89
|
const lookback = String(args.options.lookback) as IvLookback;
|
|
88
90
|
const label = MACRO_EVENT_LABELS[event];
|
|
@@ -194,6 +196,7 @@ export const ivScreenHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
194
196
|
const coverage = screenCoverage(rows, { explained: new Set([...noted].filter(([, entry]) => entry.fate.endedOn).map(([symbol]) => symbol)) });
|
|
195
197
|
const dates = richCheapDates(rows);
|
|
196
198
|
const hasSkew = rows.some((row) => row.riskReversal != null);
|
|
199
|
+
const hasSkewRank = rows.some((row) => row.riskReversalPercentile != null);
|
|
197
200
|
const hasIv1y = rows.some((row) => row.iv1y != null), hasIv1yRank = rows.some((row) => row.iv1yPercentile != null);
|
|
198
201
|
const dated = (value: unknown) => typeof value === "string" ? value : "--";
|
|
199
202
|
return {
|
|
@@ -211,6 +214,8 @@ export const ivScreenHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
211
214
|
...(hasIv1yRank ? [{ key: "iv1yPercentile", header: "IVP1Y", format: (value: unknown) => formatRank(value as number | null) }] : []),
|
|
212
215
|
{ key: "termSlope", header: "30-90", format: (value: unknown) => formatPoints(value as number | null) },
|
|
213
216
|
...(hasSkew ? [{ key: "riskReversal", header: skewHeader("25D RR", "call-put"), format: (value: unknown) => formatPoints(value as number | null) }] : []),
|
|
217
|
+
// Where that risk reversal sits in its own year: how many sessions it rests on is said under the table until a year is in.
|
|
218
|
+
...(hasSkewRank ? [{ key: "riskReversalPercentile", header: "RR pctl", format: (value: unknown) => formatRank(value as number | null) }] : []),
|
|
214
219
|
...(hasSkew && dates.skewApart ? [{ key: "skewDate", header: "RR as of", format: dated }] : []),
|
|
215
220
|
{ key: "hv", header: "HV20", format: percent },
|
|
216
221
|
// Said only where an HV is not the one of its IV's date: a stale reading's, or one a few sessions off.
|
|
@@ -221,7 +226,8 @@ export const ivScreenHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
221
226
|
// A symbol with no options history is final; only history still to come leaves the screen incomplete.
|
|
222
227
|
complete: !coverage.pending.length && !universe.error, unavailableSymbols: coverage.missing,
|
|
223
228
|
errors: [universe.error].filter((value): value is string => !!value),
|
|
224
|
-
notes: [...coverage.notes, ...[screenStaleNote(rows)].filter((note): note is string => !!note),
|
|
229
|
+
notes: [...coverage.notes, ...[screenStaleNote(rows), screenRiskReversalNote(rows)].filter((note): note is string => !!note),
|
|
230
|
+
...vcaDefinitions({ skew: hasSkew })],
|
|
225
231
|
metadata: { presets: VCA_PRESETS, methodology: METHODOLOGY },
|
|
226
232
|
};
|
|
227
233
|
},
|