@gloom-sh/terminal 0.20.21 → 0.20.23
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 +4 -3
- package/patches/electrobun-devkit@2.0.5.patch +169 -3
- package/src/account/heard-from-question.tsx +6 -4
- package/src/account/heard-from.ts +3 -4
- package/src/api-client/buybacks.ts +108 -0
- package/src/api-client/data.ts +213 -1
- package/src/api-client/dilution.ts +183 -0
- package/src/api-client/earnings.ts +2 -2
- package/src/api-client/equity-screener.ts +7 -0
- package/src/api-client/exchange-announcements.ts +16 -5
- package/src/api-client/exchange-short-balances.ts +24 -0
- package/src/api-client/heard-from.ts +5 -7
- package/src/api-client/hk-cbbc.ts +134 -0
- package/src/api-client/hk-ccass.ts +233 -0
- package/src/api-client/index.ts +55 -3
- package/src/api-client/jpx-short-positions.ts +24 -0
- package/src/api-client/market-discovery.ts +34 -6
- package/src/api-client/members.ts +5 -0
- package/src/api-client/ownership-disclosures.ts +68 -0
- package/src/api-client/paths.ts +2 -2
- package/src/api-client/request.ts +39 -10
- package/src/api-client/revenue-breakdown.ts +6 -2
- package/src/api-client/sfc-short-positions.ts +19 -0
- package/src/api-client/supply-chain.ts +22 -0
- package/src/api-client/taiwan-revenue.ts +134 -0
- package/src/api-client/types/jobs.ts +1 -0
- package/src/api-client/types/ticker-data.ts +3 -1
- package/src/api-client/types/world-venues.ts +1 -0
- package/src/app/language-observer.tsx +6 -1
- package/src/app/pane-runtime/plugin-bindings.ts +9 -4
- package/src/app/runtime/plugin-bindings.ts +20 -2
- package/src/architecture/core-builtin-allowlist.json +2 -2
- package/src/architecture/dom-cell-metrics-allowlist.json +2 -2
- package/src/architecture/dom-text-cuts-allowlist.json +2 -2
- package/src/architecture/floating-promise-allowlist.json +2 -2
- package/src/architecture/pane-tabs-allowlist.json +3 -0
- package/src/brokers/account-cache.ts +2 -1
- package/src/brokers/account-choice.ts +121 -0
- package/src/brokers/broker-portfolio-sync.ts +30 -5
- package/src/brokers/profile-form.ts +3 -0
- package/src/brokers/signed-in/adapter.ts +16 -5
- package/src/brokers/sync-broker-instance.ts +27 -3
- package/src/capabilities/asset-data-inputs.ts +8 -0
- package/src/capabilities/factories.ts +4 -0
- package/src/cli/commands/market.ts +141 -76
- package/src/cli/commands/news-search.ts +12 -0
- package/src/cli/commands/options-chain.ts +9 -3
- package/src/cli/commands/options-leaps.ts +55 -30
- package/src/cli/commands/overview.ts +20 -23
- package/src/cli/commands/search.ts +2 -1
- package/src/cli/commands/ticker.ts +17 -18
- package/src/cli/csv-export.ts +9 -5
- package/src/cli/desktop-pane-shot-browser.ts +143 -53
- package/src/cli/desktop-pane-shot.ts +50 -64
- package/src/cli/export-source.ts +9 -4
- package/src/cli/history-demergers.ts +134 -11
- package/src/cli/history-rows.ts +47 -7
- package/src/cli/listing-arg.ts +45 -18
- package/src/cli/pane-functions/catalog-snapshot.json +26 -22
- package/src/cli/pane-functions/catalog.ts +6 -2
- package/src/cli/pane-functions/data.ts +3 -1
- package/src/cli/pane-functions/dom.ts +8 -5
- package/src/cli/pane-functions/freshness.ts +6 -1
- package/src/cli/pane-functions/function-help.ts +32 -2
- package/src/cli/pane-functions/headless.ts +79 -27
- package/src/cli/pane-functions/index.ts +2 -1
- package/src/cli/pane-functions/market-session.ts +13 -3
- package/src/cli/pane-functions/resolver.ts +4 -1
- package/src/cli/pane-functions/screenshot-assessment.ts +26 -10
- package/src/cli/pane-functions/screenshot-bridge.ts +4 -1
- package/src/cli/pane-functions/screenshot-data-evidence.ts +11 -5
- package/src/cli/pane-functions/screenshot-payload.ts +21 -3
- package/src/cli/pane-functions/screenshot-render.ts +2 -0
- package/src/cli/pane-functions/ticker-question.ts +52 -47
- package/src/cli/rendered-table-rows.ts +75 -0
- package/src/cli/report-tables.ts +7 -1
- package/src/cli/result.ts +9 -2
- package/src/cli/symbol-list.ts +52 -14
- package/src/cli/ticker-resolution.ts +133 -38
- package/src/cli/visible-key-values.ts +3 -2
- package/src/components/chart/composite/composite-chart.tsx +12 -0
- package/src/components/chart/composite/format.ts +14 -1
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +37 -14
- package/src/components/chart/composite/panel-surface.tsx +1 -0
- package/src/components/chart/composite/text-renderer.ts +104 -44
- package/src/components/chart/composite/types.ts +18 -0
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +38 -15
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart-table/header.tsx +11 -5
- package/src/components/chart-table/selection.ts +20 -1
- package/src/components/command-bar/routes/root/start-here.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/results.ts +2 -1
- package/src/components/data-table/export.ts +3 -1
- package/src/components/data-table/sections.ts +12 -1
- package/src/components/data-table/view.tsx +52 -8
- package/src/components/feed-data-table/stack-view.tsx +88 -5
- package/src/components/index.ts +3 -3
- package/src/components/layout/floating-pane.tsx +5 -2
- package/src/components/layout/pane/header.tsx +33 -32
- package/src/components/layout/pane/index.tsx +6 -2
- package/src/components/layout/pane/link-note.ts +12 -0
- package/src/components/layout/pane/title.ts +1 -3
- package/src/components/market-board/index.tsx +8 -11
- package/src/components/reader/reader-text.tsx +25 -2
- package/src/components/ticker/badge/index.tsx +9 -4
- package/src/components/ticker/badge/list.tsx +3 -1
- package/src/components/ticker/list-table-view.tsx +4 -0
- package/src/components/ui/data-table/column-fit.ts +129 -0
- package/src/components/ui/data-table/display-columns.ts +28 -9
- package/src/components/ui/data-table/index.tsx +64 -16
- package/src/components/ui/data-table/muted-row.tsx +47 -0
- package/src/components/ui/data-table/opentui/index.tsx +47 -11
- package/src/components/ui/data-table/spill.ts +36 -0
- package/src/components/ui/data-table/types.ts +113 -6
- package/src/components/ui/data-table/use-column-order.ts +11 -0
- package/src/components/ui/data-table/visible-range.ts +9 -1
- package/src/components/ui/day-cell.ts +30 -0
- package/src/components/ui/icon.tsx +50 -3
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/list-view.tsx +2 -2
- package/src/components/ui/prose.tsx +3 -1
- package/src/components/ui/table-layout.ts +220 -6
- package/src/components/ui/terminal-hover-label.tsx +49 -0
- package/src/components/use-pinned-moment.ts +222 -13
- package/src/core/state/app/layout.ts +7 -2
- package/src/core/state/app/state.ts +17 -4
- package/src/core/state/app/types.ts +2 -1
- package/src/data/config/store/legacy-tabs.ts +51 -0
- package/src/data/config/store/node.ts +2 -2
- package/src/data/config/store/normalize.ts +11 -5
- package/src/data/config/store/shared-file.ts +8 -7
- package/src/data/config/store/shared-layout.ts +146 -0
- package/src/data/sqlite/access.ts +90 -12
- package/src/data/sqlite/checkpointer.ts +75 -12
- package/src/data/sqlite/database.ts +18 -1
- package/src/data/sqlite/retry.ts +1 -1
- package/src/docs/load.ts +5 -2
- package/src/docs/snapshot.json +1862 -4456
- package/src/i18n/es.ts +109 -0
- package/src/i18n/index.ts +74 -4
- package/src/i18n/ja.ts +109 -0
- package/src/i18n/ko.ts +109 -0
- package/src/i18n/react.ts +10 -2
- package/src/i18n/zh-cn.ts +109 -0
- package/src/i18n/zh-tw.ts +109 -0
- package/src/layout/pane-manager/dock-normalization.ts +61 -0
- package/src/market-data/ah-pair.ts +7 -2
- package/src/market-data/fund-actions.ts +21 -0
- package/src/market-data/market/freshness.ts +39 -35
- package/src/market-data/market/globex-day.ts +14 -0
- package/src/market-data/market/split-price-basis.ts +55 -0
- package/src/market-data/market/status.ts +2 -4
- package/src/market-data/price-adjustments.ts +115 -0
- package/src/market-data/published-us-sessions.ts +3 -2
- package/src/market-data/quotes/balance-sheet-rate.ts +6 -2
- package/src/market-data/quotes/day-range.ts +24 -9
- package/src/market-data/quotes/freshness.ts +4 -3
- package/src/market-data/quotes/live-valuation.ts +4 -2
- package/src/market-data/quotes/metadata.ts +48 -5
- package/src/market-data/quotes/regular-session-valuation.ts +18 -1
- package/src/market-data/quotes/resolution.ts +18 -29
- package/src/market-data/quotes/time.ts +138 -14
- package/src/news/query-presets.ts +6 -4
- package/src/plugins/builtin/alerts/cli-forms.ts +3 -0
- package/src/plugins/builtin/alerts/cli.ts +19 -7
- package/src/plugins/builtin/alerts/events-pane.tsx +1 -0
- package/src/plugins/builtin/alerts/format.ts +22 -10
- package/src/plugins/builtin/alerts/headless.ts +7 -4
- package/src/plugins/builtin/alerts/history-pane.tsx +93 -36
- package/src/plugins/builtin/alerts/history-rows.ts +24 -1
- package/src/plugins/builtin/alerts/index.tsx +8 -10
- package/src/plugins/builtin/alerts/metric-data.ts +24 -6
- package/src/plugins/builtin/alerts/pane.tsx +9 -0
- package/src/plugins/builtin/alerts/pro-rules.ts +1 -0
- package/src/plugins/builtin/alerts/research-builder.ts +6 -2
- package/src/plugins/builtin/alerts/research-rules.ts +12 -0
- package/src/plugins/builtin/alerts/types.ts +1 -0
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +13 -4
- package/src/plugins/builtin/awards/model.ts +36 -1
- package/src/plugins/builtin/awards/pane.tsx +29 -9
- package/src/plugins/builtin/backtest/pane.tsx +4 -2
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/detail.tsx +67 -4
- package/src/plugins/builtin/broker-manager/index.tsx +35 -4
- package/src/plugins/builtin/broker-manager/keyboard.ts +10 -0
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +35 -2
- package/src/plugins/builtin/broker-trading/orders.tsx +14 -5
- package/src/plugins/builtin/broker-trading/ticket.tsx +1 -0
- package/src/plugins/builtin/buildout/format.ts +3 -1
- package/src/plugins/builtin/buybacks/client.ts +48 -0
- package/src/plugins/builtin/buybacks/index.tsx +22 -0
- package/src/plugins/builtin/buybacks/model.ts +151 -0
- package/src/plugins/builtin/buybacks/pane.tsx +140 -0
- package/src/plugins/builtin/buybacks/series.ts +36 -0
- package/src/plugins/builtin/catalysts/detail.tsx +14 -8
- package/src/plugins/builtin/catalysts/evidence.ts +11 -3
- package/src/plugins/builtin/catalysts/headless.ts +51 -8
- package/src/plugins/builtin/catalysts/kinds.ts +413 -0
- package/src/plugins/builtin/catalysts/model.ts +61 -18
- package/src/plugins/builtin/catalysts/pane.tsx +85 -19
- package/src/plugins/builtin/cds/client.ts +9 -2
- package/src/plugins/builtin/cds/headless.ts +25 -10
- package/src/plugins/builtin/cds/model.ts +37 -12
- package/src/plugins/builtin/cds/pane.tsx +18 -10
- package/src/plugins/builtin/chart-composer/chart-spec-edit.ts +68 -7
- package/src/plugins/builtin/chart-composer/chart-title.ts +114 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +13 -1
- package/src/plugins/builtin/chart-composer/index.tsx +2 -68
- package/src/plugins/builtin/chart-composer/leverage-overlay.ts +2 -4
- package/src/plugins/builtin/chart-composer/pane.tsx +11 -3
- package/src/plugins/builtin/chart-composer/presets.ts +1 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +46 -12
- package/src/plugins/builtin/chat/channels.ts +5 -2
- package/src/plugins/builtin/chat/content/composer-runtime.ts +64 -65
- package/src/plugins/builtin/chat/content/footer.tsx +17 -7
- package/src/plugins/builtin/chat/content/index.tsx +108 -36
- package/src/plugins/builtin/chat/content/new-dm-dialog.tsx +21 -8
- package/src/plugins/builtin/chat/content/selection-runtime.ts +16 -0
- package/src/plugins/builtin/chat/content/shortcuts.ts +3 -0
- package/src/plugins/builtin/chat/content/snapshot.ts +37 -13
- package/src/plugins/builtin/chat/content/transcript.tsx +12 -0
- package/src/plugins/builtin/chat/content/types.ts +2 -0
- package/src/plugins/builtin/chat/controller/channels.ts +15 -15
- package/src/plugins/builtin/chat/controller/draft-sync.ts +13 -7
- package/src/plugins/builtin/chat/controller/index.ts +140 -34
- package/src/plugins/builtin/chat/controller/lifecycle.ts +8 -12
- package/src/plugins/builtin/chat/controller/persistence.ts +32 -4
- package/src/plugins/builtin/chat/controller/send.ts +41 -17
- package/src/plugins/builtin/chat/controller/session-runtime.ts +28 -27
- package/src/plugins/builtin/chat/controller/state.ts +21 -8
- package/src/plugins/builtin/chat/controller/storage.ts +41 -4
- package/src/plugins/builtin/chat/controller/view.ts +6 -3
- package/src/plugins/builtin/chat/index.tsx +1 -1
- package/src/plugins/builtin/chat/layout.ts +8 -1
- package/src/plugins/builtin/chat/message/desktop.tsx +15 -11
- package/src/plugins/builtin/chat/message/header.tsx +112 -30
- package/src/plugins/builtin/chat/message/reactions.tsx +10 -11
- package/src/plugins/builtin/chat/message/render-state.ts +4 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/message/types.ts +5 -0
- package/src/plugins/builtin/chat/pane-requests.ts +8 -4
- package/src/plugins/builtin/clinical-trials/model.ts +2 -2
- package/src/plugins/builtin/clinical-trials/pane.tsx +3 -3
- package/src/plugins/builtin/cloud/askg/pane.tsx +60 -50
- package/src/plugins/builtin/cloud/auth-actions.tsx +2 -1
- package/src/plugins/builtin/cloud-tweets/table.tsx +25 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +4 -2
- package/src/plugins/builtin/commodity-balances/headless.ts +2 -1
- package/src/plugins/builtin/company-attention/building-model.ts +3 -4
- package/src/plugins/builtin/company-attention/building.tsx +2 -0
- package/src/plugins/builtin/company-attention/headless.ts +2 -2
- package/src/plugins/builtin/company-attention/model.ts +2 -0
- package/src/plugins/builtin/company-attention/moves-model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +2 -0
- package/src/plugins/builtin/company-attention/pane.tsx +17 -3
- package/src/plugins/builtin/company-attention/signals-model.ts +3 -4
- package/src/plugins/builtin/company-attention/signals.tsx +5 -0
- package/src/plugins/builtin/company-kpis/headless.ts +26 -10
- package/src/plugins/builtin/company-kpis/model.ts +58 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +36 -19
- package/src/plugins/builtin/company-kpis/taiwan-monthly-model.ts +99 -0
- package/src/plugins/builtin/company-kpis/taiwan-monthly-view.tsx +327 -0
- package/src/plugins/builtin/composite/ownership-browser.ts +28 -0
- package/src/plugins/builtin/composite/ownership.ts +5 -1
- package/src/plugins/builtin/congress-trades/detail.tsx +44 -8
- package/src/plugins/builtin/congress-trades/headless.ts +15 -11
- package/src/plugins/builtin/congress-trades/model.ts +104 -11
- package/src/plugins/builtin/congress-trades/pane.tsx +11 -6
- package/src/plugins/builtin/congress-trades/table.tsx +17 -10
- package/src/plugins/builtin/congress-trades/use-feed.ts +13 -2
- package/src/plugins/builtin/correlation/compute.ts +6 -1
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/relationship/pane.tsx +11 -8
- package/src/plugins/builtin/correlation/relationship/view-model.ts +1 -19
- package/src/plugins/builtin/cot/headless.ts +1 -1
- package/src/plugins/builtin/cot/pane.tsx +7 -2
- package/src/plugins/builtin/cpi/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-documents/detail.tsx +2 -1
- package/src/plugins/builtin/credit-documents/export.ts +18 -12
- package/src/plugins/builtin/credit-documents/model.ts +106 -25
- package/src/plugins/builtin/credit-documents/pane.tsx +9 -5
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -1
- package/src/plugins/builtin/crypto-board/defi.ts +5 -4
- package/src/plugins/builtin/crypto-board/headless.ts +7 -2
- package/src/plugins/builtin/crypto-board/model.ts +6 -4
- package/src/plugins/builtin/crypto-board/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/supply.ts +4 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +15 -8
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -5
- package/src/plugins/builtin/custom-view/loader.ts +95 -34
- package/src/plugins/builtin/custom-view/pane.tsx +31 -41
- package/src/plugins/builtin/custom-view/table.ts +201 -0
- package/src/plugins/builtin/debt-maturities/headless.ts +56 -38
- package/src/plugins/builtin/debt-maturities/model.ts +2 -1
- package/src/plugins/builtin/debt-maturities/pane.tsx +24 -22
- package/src/plugins/builtin/dilution/index.tsx +74 -0
- package/src/plugins/builtin/dilution/model.ts +159 -0
- package/src/plugins/builtin/dilution/pane.tsx +592 -0
- package/src/plugins/builtin/dividend-yield/client.ts +14 -17
- package/src/plugins/builtin/dividend-yield/headless.ts +24 -16
- package/src/plugins/builtin/dividend-yield/index.tsx +2 -1
- package/src/plugins/builtin/dividend-yield/model.ts +52 -10
- package/src/plugins/builtin/dividend-yield/pane.tsx +89 -17
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +6 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +7 -3
- package/src/plugins/builtin/dividend-yield/types.ts +2 -3
- package/src/plugins/builtin/dividend-yield/view.ts +58 -12
- package/src/plugins/builtin/docs/index.tsx +1 -1
- package/src/plugins/builtin/docs/pane.tsx +7 -3
- package/src/plugins/builtin/docs/use-docs.ts +2 -1
- package/src/plugins/builtin/earnings/board-model.ts +19 -6
- package/src/plugins/builtin/earnings/board-table.ts +64 -48
- package/src/plugins/builtin/earnings/board.tsx +93 -51
- package/src/plugins/builtin/earnings/headless.ts +71 -12
- package/src/plugins/builtin/earnings/history-model.ts +28 -15
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +23 -10
- package/src/plugins/builtin/earnings-calls/format.ts +34 -0
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +22 -17
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +14 -12
- package/src/plugins/builtin/earnings-ripple/pane.tsx +4 -3
- package/src/plugins/builtin/econ/calendar-model.ts +207 -3
- package/src/plugins/builtin/econ/columns.ts +132 -0
- package/src/plugins/builtin/econ/index.tsx +27 -79
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +10 -5
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -3
- package/src/plugins/builtin/econ-statistics/view.ts +15 -4
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/model.ts +12 -3
- package/src/plugins/builtin/estimate-revisions/headless.ts +23 -2
- package/src/plugins/builtin/estimate-revisions/model.ts +63 -13
- package/src/plugins/builtin/estimate-revisions/pane.tsx +228 -225
- package/src/plugins/builtin/estimate-revisions/sorting.ts +8 -16
- package/src/plugins/builtin/exposure/drivers.ts +5 -2
- package/src/plugins/builtin/exposure/headless.ts +6 -3
- package/src/plugins/builtin/exposure/model.ts +2 -1
- package/src/plugins/builtin/exposure/pane.tsx +16 -7
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/pane.tsx +21 -7
- package/src/plugins/builtin/futures-curve/headless.ts +14 -9
- package/src/plugins/builtin/futures-curve/model.ts +12 -4
- package/src/plugins/builtin/futures-curve/pane.tsx +18 -15
- package/src/plugins/builtin/fx-matrix/headless.ts +3 -2
- package/src/plugins/builtin/gpu/headless.ts +10 -4
- package/src/plugins/builtin/holders/beneficial-model.ts +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +3 -2
- package/src/plugins/builtin/holders/ccass-market-pane.tsx +363 -0
- package/src/plugins/builtin/holders/ccass-view.tsx +323 -0
- package/src/plugins/builtin/holders/disclosures-view.tsx +66 -0
- package/src/plugins/builtin/holders/disclosures.ts +47 -0
- package/src/plugins/builtin/holders/headless.ts +9 -2
- package/src/plugins/builtin/holders/index.tsx +75 -1
- package/src/plugins/builtin/holders/pane.tsx +37 -10
- package/src/plugins/builtin/holders/report-rows.ts +2 -0
- package/src/plugins/builtin/holders/table-model.ts +14 -6
- package/src/plugins/builtin/holders/types.ts +2 -2
- package/src/plugins/builtin/insider/activity-chart.ts +141 -0
- package/src/plugins/builtin/insider/headless.ts +2 -1
- package/src/plugins/builtin/insider/index.tsx +74 -12
- package/src/plugins/builtin/insider/signals-cells.tsx +15 -8
- package/src/plugins/builtin/insider/signals.tsx +6 -5
- package/src/plugins/builtin/insider/table-model.ts +17 -17
- package/src/plugins/builtin/insider/table.tsx +18 -10
- package/src/plugins/builtin/ipo-calendar/headless.ts +55 -11
- package/src/plugins/builtin/ipo-calendar/listing-ipo.ts +31 -4
- package/src/plugins/builtin/ipo-calendar/model.ts +238 -48
- package/src/plugins/builtin/ipo-calendar/pane.tsx +91 -25
- package/src/plugins/builtin/iv-history/client.ts +17 -8
- package/src/plugins/builtin/iv-history/format.ts +23 -12
- package/src/plugins/builtin/iv-history/headless.ts +9 -5
- package/src/plugins/builtin/iv-history/model.ts +15 -13
- package/src/plugins/builtin/iv-history/pane.tsx +5 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +46 -24
- package/src/plugins/builtin/jobs/headless.ts +4 -3
- package/src/plugins/builtin/jobs/pane.tsx +6 -5
- package/src/plugins/builtin/jodi/headless.ts +15 -2
- package/src/plugins/builtin/jodi/model.ts +46 -5
- package/src/plugins/builtin/jodi/pane.tsx +17 -13
- package/src/plugins/builtin/kelly-sizer/headless.ts +11 -4
- package/src/plugins/builtin/kelly-sizer/pane.tsx +19 -9
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/units.ts +26 -0
- package/src/plugins/builtin/macro-day/pane.tsx +12 -5
- package/src/plugins/builtin/market-halts/model.ts +10 -8
- package/src/plugins/builtin/market-halts/pane.tsx +15 -3
- package/src/plugins/builtin/market-heatmap/data.ts +17 -2
- package/src/plugins/builtin/market-heatmap/headless.ts +56 -6
- package/src/plugins/builtin/market-heatmap/index.tsx +55 -1
- package/src/plugins/builtin/market-heatmap/model.ts +27 -1
- package/src/plugins/builtin/market-movers/model.ts +7 -1
- package/src/plugins/builtin/market-movers/session-table.ts +1 -0
- package/src/plugins/builtin/market-movers/session.ts +1 -1
- package/src/plugins/builtin/market-movers/table.ts +1 -1
- package/src/plugins/builtin/members/headless.ts +13 -5
- package/src/plugins/builtin/members/model.ts +35 -1
- package/src/plugins/builtin/members/pane.tsx +16 -8
- package/src/plugins/builtin/mna/distress/detail.tsx +7 -6
- package/src/plugins/builtin/mna/distress/model.ts +7 -7
- package/src/plugins/builtin/mna/distress/pane.tsx +8 -7
- package/src/plugins/builtin/mna/headless.ts +40 -7
- package/src/plugins/builtin/mna/model.ts +66 -6
- package/src/plugins/builtin/mna/pane.tsx +118 -60
- package/src/plugins/builtin/news/wire/industry-pane.tsx +1 -0
- package/src/plugins/builtin/news/wire/news/row.ts +5 -12
- package/src/plugins/builtin/news/wire/news/table.tsx +46 -44
- package/src/plugins/builtin/notes/index.tsx +2 -1
- package/src/plugins/builtin/openfda/model.ts +1 -1
- package/src/plugins/builtin/openfda/pane.tsx +37 -9
- package/src/plugins/builtin/options/analytics.ts +30 -6
- package/src/plugins/builtin/options/calc-seed.ts +38 -3
- package/src/plugins/builtin/options/footer.ts +18 -1
- package/src/plugins/builtin/options/live-quotes.ts +21 -6
- package/src/plugins/builtin/options/open-interest-as-of.ts +5 -0
- package/src/plugins/builtin/options/quote-context.tsx +21 -8
- package/src/plugins/builtin/options/table.ts +17 -2
- package/src/plugins/builtin/options/view.tsx +97 -46
- package/src/plugins/builtin/options-calculator/model.ts +65 -3
- package/src/plugins/builtin/options-calculator/pane.tsx +11 -3
- package/src/plugins/builtin/options-calculator/valuation.ts +33 -0
- package/src/plugins/builtin/options-positioning/cbbc-model.ts +160 -0
- package/src/plugins/builtin/options-positioning/cbbc-view.tsx +453 -0
- package/src/plugins/builtin/options-positioning/index.tsx +22 -1
- package/src/plugins/builtin/options-positioning/pane.tsx +16 -1
- package/src/plugins/builtin/options-scenario/charts.tsx +2 -1
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +5 -5
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +11 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +9 -1
- package/src/plugins/builtin/options-scenario/headless.ts +3 -3
- package/src/plugins/builtin/options-scenario/index.tsx +1 -1
- package/src/plugins/builtin/options-scenario/model.ts +7 -0
- package/src/plugins/builtin/options-scenario/pane.tsx +24 -14
- package/src/plugins/builtin/pe-band/headless.ts +1 -1
- package/src/plugins/builtin/pe-band/model.ts +41 -18
- package/src/plugins/builtin/pe-band/pane.tsx +8 -6
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/equity-row.tsx +4 -6
- package/src/plugins/builtin/perps/headless.ts +19 -12
- package/src/plugins/builtin/perps/markets-section.tsx +19 -15
- package/src/plugins/builtin/perps/model.ts +14 -5
- package/src/plugins/builtin/portfolio-list/cached-account.ts +3 -1
- package/src/plugins/builtin/portfolio-list/cli/import-positions.ts +6 -18
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +1 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +1 -1
- package/src/plugins/builtin/portfolio-list/positions-import/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/positions-import/lookup.ts +28 -57
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -3
- package/src/plugins/builtin/portfolio-list/table.tsx +19 -2
- package/src/plugins/builtin/power/client.ts +2 -2
- package/src/plugins/builtin/power/detail.tsx +11 -8
- package/src/plugins/builtin/power/gas-model.ts +2 -1
- package/src/plugins/builtin/power/gas.tsx +3 -2
- package/src/plugins/builtin/power/headless.ts +4 -1
- package/src/plugins/builtin/power/model.ts +19 -0
- package/src/plugins/builtin/power/pane.tsx +5 -4
- package/src/plugins/builtin/power/prices-headless.ts +4 -3
- package/src/plugins/builtin/power/prices.tsx +7 -6
- package/src/plugins/builtin/primary-dealers/headless.ts +1 -1
- package/src/plugins/builtin/primary-dealers/model.ts +2 -1
- package/src/plugins/builtin/rate-path/headless.ts +5 -2
- package/src/plugins/builtin/rate-path/pane.tsx +13 -10
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +7 -8
- package/src/plugins/builtin/realized-vol/headless.ts +3 -4
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/research/analyst-model.ts +1 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +2 -1
- package/src/plugins/builtin/research/earnings-estimates-pane.tsx +262 -0
- package/src/plugins/builtin/research/event-charts.ts +322 -0
- package/src/plugins/builtin/research/event-data.ts +140 -0
- package/src/plugins/builtin/research/event-detail.tsx +442 -0
- package/src/plugins/builtin/research/event-model.ts +338 -39
- package/src/plugins/builtin/research/event-sources.ts +58 -8
- package/src/plugins/builtin/research/event-views.tsx +397 -0
- package/src/plugins/builtin/research/events-headless.ts +60 -4
- package/src/plugins/builtin/research/headless-schema.ts +2 -2
- package/src/plugins/builtin/research/headless.ts +84 -7
- package/src/plugins/builtin/research/index.tsx +19 -17
- package/src/plugins/builtin/research/relative-valuation-columns.ts +39 -14
- package/src/plugins/builtin/research/relative-valuation-headless.ts +9 -5
- package/src/plugins/builtin/research/relative-valuation-model.ts +23 -8
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +10 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +9 -4
- package/src/plugins/builtin/revenue-breakdown/headless.ts +1 -1
- package/src/plugins/builtin/revenue-breakdown/index.tsx +2 -1
- package/src/plugins/builtin/revenue-breakdown/model.ts +2 -0
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +10 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +14 -9
- package/src/plugins/builtin/scanner/flow-pane.tsx +10 -0
- package/src/plugins/builtin/scanner/headless.ts +2 -0
- package/src/plugins/builtin/scanner/lock-note.ts +5 -9
- package/src/plugins/builtin/sec/exchange-filings.ts +69 -0
- package/src/plugins/builtin/sec/fund-facts.ts +10 -8
- package/src/plugins/builtin/sec/headless.ts +60 -8
- package/src/plugins/builtin/sec/index.tsx +169 -61
- package/src/plugins/builtin/sec/model.ts +10 -4
- package/src/plugins/builtin/sec/row-summaries.ts +1 -0
- package/src/plugins/builtin/series-inventory.ts +4 -0
- package/src/plugins/builtin/shared/beat-miss-chart.ts +66 -0
- package/src/plugins/builtin/shared/day-entries.ts +41 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +80 -53
- package/src/plugins/builtin/shared/earnings-report.ts +53 -15
- package/src/plugins/builtin/shared/history-span.ts +2 -1
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/pro-lock-note.ts +8 -12
- package/src/plugins/builtin/shared/report-freshness.ts +4 -1
- package/src/plugins/builtin/shared/ticker-request.ts +4 -2
- package/src/plugins/builtin/shared/volatility/live-session.ts +6 -7
- package/src/plugins/builtin/shared/volatility/option-snapshot.ts +30 -0
- package/src/plugins/builtin/shared/volatility/quote-session.ts +49 -0
- package/src/plugins/builtin/short-interest/exchange-balances.ts +76 -0
- package/src/plugins/builtin/short-interest/exchange-positions-pane.tsx +55 -0
- package/src/plugins/builtin/short-interest/headless.ts +15 -2
- package/src/plugins/builtin/short-interest/index.tsx +7 -3
- package/src/plugins/builtin/short-interest/jpx.ts +38 -0
- package/src/plugins/builtin/short-interest/model.ts +3 -2
- package/src/plugins/builtin/short-interest/pane.tsx +4 -3
- package/src/plugins/builtin/short-interest/publications-model.ts +73 -2
- package/src/plugins/builtin/short-interest/publications-pane.tsx +16 -4
- package/src/plugins/builtin/short-interest/sfc.ts +40 -0
- package/src/plugins/builtin/short-interest/surface.tsx +16 -2
- package/src/plugins/builtin/short-volume/headless.ts +18 -3
- package/src/plugins/builtin/short-volume/model.ts +6 -1
- package/src/plugins/builtin/short-volume/pane.tsx +8 -7
- package/src/plugins/builtin/short-volume/sgx.ts +23 -0
- package/src/plugins/builtin/social-mentions/outliers-model.ts +2 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +10 -8
- package/src/plugins/builtin/supply-chain/client.ts +10 -2
- package/src/plugins/builtin/supply-chain/directories.ts +18 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +12 -4
- package/src/plugins/builtin/supply-chain/headless.ts +20 -7
- package/src/plugins/builtin/supply-chain/pane.tsx +40 -11
- package/src/plugins/builtin/thirteenf/api.ts +299 -31
- package/src/plugins/builtin/thirteenf/data.ts +126 -32
- package/src/plugins/builtin/thirteenf/format.ts +4 -6
- package/src/plugins/builtin/thirteenf/headless.ts +68 -29
- package/src/plugins/builtin/thirteenf/model.ts +24 -11
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +16 -8
- package/src/plugins/builtin/thirteenf/pane.tsx +45 -22
- package/src/plugins/builtin/thirteenf/report-notes.ts +52 -2
- package/src/plugins/builtin/thirteenf/session-scope.ts +57 -0
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +17 -4
- package/src/plugins/builtin/thirteenf/split-history.ts +119 -0
- package/src/plugins/builtin/thirteenf/table.ts +6 -6
- package/src/plugins/builtin/thirteenf/types.ts +17 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +11 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +12 -8
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +5 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +7 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +12 -5
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +35 -5
- package/src/plugins/builtin/ticker-detail/financials/exchange-table.tsx +61 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +210 -43
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +69 -8
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +64 -10
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +132 -68
- package/src/plugins/builtin/ticker-detail/headless.ts +37 -13
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +75 -14
- package/src/plugins/builtin/ticker-detail/overview/model.ts +87 -35
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +14 -8
- package/src/plugins/builtin/ticker-detail/overview/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +50 -17
- package/src/plugins/builtin/ticker-detail/pane.tsx +5 -3
- package/src/plugins/builtin/ticker-detail/research-groups.ts +15 -2
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +2 -1
- package/src/plugins/builtin/time-sales/headless.ts +3 -3
- package/src/plugins/builtin/time-sales/model.ts +16 -9
- package/src/plugins/builtin/time-sales/pane.tsx +27 -24
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/cache.ts +44 -19
- package/src/plugins/builtin/treasury-auctions/client.ts +9 -4
- package/src/plugins/builtin/treasury-daily/client.ts +43 -9
- package/src/plugins/builtin/treasury-daily/pane.tsx +48 -27
- package/src/plugins/builtin/treasury-daily/resource.ts +33 -0
- package/src/plugins/builtin/vol-surface/charts.tsx +3 -1
- package/src/plugins/builtin/vol-surface/events.ts +8 -5
- package/src/plugins/builtin/vol-surface/evidence.ts +2 -2
- package/src/plugins/builtin/vol-surface/headless.ts +46 -28
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/model.ts +34 -9
- package/src/plugins/builtin/vol-surface/pane.tsx +35 -67
- package/src/plugins/builtin/vol-surface/quote-coverage.ts +68 -0
- package/src/plugins/builtin/vol-surface/tables.ts +57 -6
- package/src/plugins/builtin/volatility/charts.tsx +7 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -5
- package/src/plugins/builtin/volatility/pane.tsx +8 -5
- package/src/plugins/builtin/world-indices/headless.ts +5 -3
- package/src/plugins/builtin/world-venue-map/headless.ts +15 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +5 -3
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/world-venue-map/venue-exceptions.ts +72 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +20 -11
- package/src/plugins/builtin/yield-curve/headless.ts +4 -2
- package/src/plugins/builtin/yield-curve/index.tsx +4 -3
- package/src/plugins/catalog-browser.ts +3 -34
- package/src/plugins/marketplace/feed.ts +3 -2
- package/src/plugins/registry/contributions.ts +37 -10
- package/src/plugins/registry/index.ts +2 -1
- package/src/portfolio/column-values.ts +8 -9
- package/src/portfolio/positions-import/parse.ts +14 -6
- package/src/portfolio/positions-import/plan.ts +3 -2
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/i18n.ts +3 -2
- package/src/react/async-resource.ts +3 -1
- package/src/renderers/dom/css.d.ts +1 -0
- package/src/renderers/dom/data-table/index.tsx +100 -8
- package/src/renderers/dom/data-table/row.tsx +40 -4
- package/src/renderers/dom/desktop/icons.tsx +147 -3
- package/src/renderers/dom/desktop/popover.tsx +2 -2
- package/src/renderers/dom/host/media-surface.tsx +204 -45
- package/src/renderers/dom/host/tabs.tsx +1 -0
- package/src/renderers/dom/styles.css +14 -2
- package/src/renderers/electrobun/bun/desktop/backend.ts +14 -1
- package/src/renderers/electrobun/bun/desktop/rpc-timing.ts +9 -3
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +5 -2
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +7 -1
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +2 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +44 -3
- package/src/sources/gloomberb-cloud/batched-lookups.ts +12 -1
- package/src/sources/gloomberb-cloud/index.ts +44 -10
- package/src/sources/gloomberb-cloud/normalizers.ts +8 -2
- package/src/sources/listing-symbols.ts +7 -1
- package/src/sources/provider-router/cache.ts +5 -4
- package/src/sources/provider-router/financials.ts +44 -22
- package/src/sources/provider-router/index.ts +9 -1
- package/src/state/app/context/index.tsx +12 -4
- package/src/state/app/tab-cursor.ts +47 -6
- package/src/sync/broker-instances.ts +63 -11
- package/src/sync/config-merge.ts +1 -1
- package/src/sync/sanitize.ts +2 -0
- package/src/telemetry/stall-clocks.ts +3 -0
- package/src/telemetry/stall-reports.ts +12 -3
- package/src/telemetry/windows-process-activity.ts +41 -0
- package/src/telemetry/windows-time.ts +32 -0
- package/src/test-support/cloud-api.ts +34 -0
- package/src/test-support/scoped-earnings.ts +24 -0
- package/src/test-support/strict-table-capture.tsx +83 -0
- package/src/tickers/search/index.ts +23 -7
- package/src/tickers/terminal-codes.ts +1 -6
- package/src/time-series/alignment.ts +14 -4
- package/src/time-series/base-series.ts +5 -4
- package/src/time-series/chart-data.ts +2 -0
- package/src/time-series/chart-seed.ts +3 -1
- package/src/time-series/daily-valuation.ts +13 -6
- package/src/time-series/filed-trailing-eps.ts +16 -3
- package/src/time-series/fundamentals/current-valuation.ts +30 -5
- package/src/time-series/fundamentals/historical-valuation.ts +20 -0
- package/src/time-series/fundamentals/history-link.ts +25 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +50 -5
- package/src/time-series/fundamentals/series.ts +13 -1
- package/src/time-series/market.ts +30 -4
- package/src/time-series/price-comparison.ts +39 -60
- package/src/time-series/resolve.ts +18 -11
- package/src/time-series/spec.ts +2 -1
- package/src/time-series/studies/formula.ts +4 -2
- package/src/time-series/studies/indicators.ts +2 -0
- package/src/time-series/studies/pair.ts +4 -2
- package/src/time-series/studies/shared.ts +1 -0
- package/src/time-series/types.ts +2 -1
- package/src/time-series/use-chart-resolution.ts +32 -14
- package/src/time-series/valuation-currency.ts +2 -0
- package/src/types/config.ts +13 -61
- package/src/types/data-provider.ts +8 -0
- package/src/types/financials.ts +94 -15
- package/src/types/headless.ts +30 -0
- package/src/types/plugin-context.ts +8 -1
- package/src/ui/dialog-context.ts +8 -0
- package/src/utils/crypto-pair.ts +10 -0
- package/src/utils/datetime-format.ts +23 -1
- package/src/utils/day-format.ts +104 -0
- package/src/utils/declared-dividends.ts +12 -2
- package/src/utils/exchange-announcements.ts +38 -12
- package/src/utils/exchange-notation.generated.ts +3 -1
- package/src/utils/exchanges.ts +2 -1
- package/src/utils/financial-statements.ts +40 -46
- package/src/utils/format.ts +39 -12
- package/src/utils/forward-dividend.ts +2 -1
- package/src/utils/fundamentals.ts +1 -0
- package/src/utils/main-thread-stall.ts +9 -1
- package/src/utils/rpc-timeout-error.ts +36 -11
- package/src/utils/sec.ts +3 -1
- package/src/utils/share-multiples.ts +1 -1
- package/src/utils/stall-process-activity.ts +70 -0
- package/src/utils/statement-scope.ts +103 -0
- package/src/utils/trailing-dividend.ts +47 -0
- package/src/utils/trailing-eps.ts +1 -1
- package/src/utils/zoned-date-time.ts +1 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +0 -771
|
@@ -18,8 +18,9 @@ import {
|
|
|
18
18
|
import { historyReadUnanswered } from "../../../time-series/calendar-month-returns";
|
|
19
19
|
import { formatPct, formatSignedPct } from "./view";
|
|
20
20
|
import { logFailure } from "../../../utils/log-failure";
|
|
21
|
+
import { isoDayEntries } from "../shared/day-entries";
|
|
21
22
|
import { loadFuturesContractTerms } from "../../../market-data/futures-contract";
|
|
22
|
-
import { kellyCount, kellyCountMultiplier, type KellyCount } from "./units";
|
|
23
|
+
import { formatKellySizingPrice, kellyCount, kellyCountMultiplier, kellySizingPrice, type KellyCount } from "./units";
|
|
23
24
|
|
|
24
25
|
/** The fractions of full Kelly a report sizes, largest first. */
|
|
25
26
|
const KELLY_FRACTIONS = [
|
|
@@ -124,9 +125,10 @@ export const kellyHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
124
125
|
const bankrollValue = args.options.bankroll;
|
|
125
126
|
const bankroll = typeof bankrollValue === "number" && bankrollValue > 0 ? bankrollValue : null;
|
|
126
127
|
const baseCurrency = ctx.config.baseCurrency || "USD";
|
|
127
|
-
const price = quote && quote.price > 0 && Number.isFinite(quote.price) ? quote.price : null;
|
|
128
128
|
// A future is counted in contracts, each its price times the contract's multiplier.
|
|
129
129
|
const count = kellyCount(symbol, exchange, quote?.instrumentType);
|
|
130
|
+
const sizingPrice = kellySizingPrice(quote, count);
|
|
131
|
+
const price = sizingPrice?.value ?? null;
|
|
130
132
|
const [multiplier, basePrice] = bankroll == null || price == null ? [null, null] : await Promise.all([
|
|
131
133
|
kellyCountMultiplier(symbol, count, (key) => loadFuturesContractTerms(key, ctx.apiClient)),
|
|
132
134
|
// The price in the bankroll's currency, at the rate the portfolio values holdings at; null without one.
|
|
@@ -168,7 +170,12 @@ export const kellyHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
168
170
|
freshness: { asOf: inputs.latest },
|
|
169
171
|
notes,
|
|
170
172
|
sections: [
|
|
171
|
-
|
|
173
|
+
// The window's days read first in the text; JSON and CSV keep them in ISO.
|
|
174
|
+
{ title: "Inputs", ...isoDayEntries([...inputEntries(inputs, solve.expectedReturn),
|
|
175
|
+
...(bankroll != null && sizingPrice ? [{ key: "sizingPrice", label: "Sizing price", value: sizingPrice.value,
|
|
176
|
+
formatted: formatKellySizingPrice(sizingPrice), unit: sizingPrice.currency ?? undefined,
|
|
177
|
+
asOf: typeof sizingPrice.asOf === "number" ? new Date(sizingPrice.asOf).toISOString() : sizingPrice.asOf }] : []),
|
|
178
|
+
]) },
|
|
172
179
|
{
|
|
173
180
|
title: bankroll == null ? "Sizing" : `Sizing on ${formatNumber(bankroll, 0)} ${baseCurrency}`,
|
|
174
181
|
columns: [
|
|
@@ -191,7 +198,7 @@ export const kellyHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
191
198
|
expectedLogGrowth: solve.expectedLogGrowth,
|
|
192
199
|
bankroll,
|
|
193
200
|
currency: baseCurrency,
|
|
194
|
-
price:
|
|
201
|
+
price: sizingPrice,
|
|
195
202
|
...(basePrice != null && quote?.currency !== baseCurrency ? { priceInBase: { value: basePrice, currency: baseCurrency } } : {}),
|
|
196
203
|
...(count === "contracts" && multiplier != null ? { contractMultiplier: multiplier } : {}),
|
|
197
204
|
units: count,
|
|
@@ -6,6 +6,7 @@ import { colors } from "../../../theme/colors";
|
|
|
6
6
|
import {
|
|
7
7
|
EmptyState,
|
|
8
8
|
FieldGrid,
|
|
9
|
+
KeyValueRow,
|
|
9
10
|
QueryBar,
|
|
10
11
|
StatGrid,
|
|
11
12
|
fieldGridColumns,
|
|
@@ -22,7 +23,8 @@ import { useChartQueries, useFxRatesMap, useResolvedEntryValue } from "../../../
|
|
|
22
23
|
import { buildChartKey } from "../../../market-data/selectors";
|
|
23
24
|
import { useLiveTickerFinancials, useLiveTickerFinancialsMap } from "../../../state/hooks/live-ticker-financials";
|
|
24
25
|
import { buildPortfolioFinancialsMap } from "../../../market-data/portfolio-financials";
|
|
25
|
-
import { convertCurrency
|
|
26
|
+
import { convertCurrency } from "../../../utils/format";
|
|
27
|
+
import { formatUtcTime } from "../../../utils/utc-time";
|
|
26
28
|
import {
|
|
27
29
|
useAppDispatch,
|
|
28
30
|
getFocusedCollectionId,
|
|
@@ -69,7 +71,7 @@ import {
|
|
|
69
71
|
kellyTrailingHistoryRequest,
|
|
70
72
|
} from "./history";
|
|
71
73
|
import { historyReadUnanswered } from "../../../time-series/calendar-month-returns";
|
|
72
|
-
import { kellyCount, kellyCountMultiplier } from "./units";
|
|
74
|
+
import { formatKellySizingPrice, kellyCount, kellyCountMultiplier, kellySizingPrice } from "./units";
|
|
73
75
|
import { KELLY_PANE_ID } from "./constants";
|
|
74
76
|
import {
|
|
75
77
|
buildKellyCurveXAxisLabels,
|
|
@@ -286,12 +288,13 @@ export function KellySizerPane({ focused, width, height }: PaneProps) {
|
|
|
286
288
|
});
|
|
287
289
|
const bankroll = bankrollOverride ?? sourceBankroll;
|
|
288
290
|
const currentValue = currentValueOverride ?? sourceCurrentValue;
|
|
289
|
-
const price = positionFinancials?.quote?.price ?? null;
|
|
290
291
|
const priceCurrency = positionFinancials?.quote?.currency || ticker?.metadata.currency || config.baseCurrency;
|
|
291
292
|
// A future is counted in contracts, each worth its price times the contract's multiplier from its terms.
|
|
292
293
|
const count = ticker
|
|
293
294
|
? kellyCount(ticker.metadata.ticker, ticker.metadata.exchange ?? "", positionFinancials?.quote?.instrumentType ?? ticker.metadata.assetCategory)
|
|
294
295
|
: "shares";
|
|
296
|
+
const sizingPrice = kellySizingPrice(positionFinancials?.quote, count, positionFinancials?.quote?.instrumentType ?? ticker?.metadata.assetCategory);
|
|
297
|
+
const price = sizingPrice?.value ?? null;
|
|
295
298
|
const [contractMultiplier, setContractMultiplier] = useState<{ symbol: string; value: number | null } | null>(null);
|
|
296
299
|
const tickerSymbol = ticker?.metadata.ticker ?? null;
|
|
297
300
|
useEffect(() => {
|
|
@@ -560,15 +563,13 @@ export function KellySizerPane({ focused, width, height }: PaneProps) {
|
|
|
560
563
|
}),
|
|
561
564
|
];
|
|
562
565
|
const resultRows = statGridRows(resultItems, width, gridColumns);
|
|
563
|
-
|
|
564
|
-
const
|
|
566
|
+
const priceLine = sizingPrice ? formatKellySizingPrice(sizingPrice) : null;
|
|
567
|
+
const splitPriceLine = sizingPrice?.asOf != null && priceLine != null && width < priceLine.length + 8;
|
|
568
|
+
const priceRows = priceLine ? splitPriceLine ? 2 : 1 : 0;
|
|
569
|
+
const bodyRows = Math.max(0, height - 1 - tabRows - gridRows - resultRows - priceRows);
|
|
565
570
|
const chartHeight = showSensitivity ? 0 : bodyRows;
|
|
566
571
|
const showChart = !showSensitivity && chartHeight >= 6 && curvePoints.length > 0;
|
|
567
|
-
const quoteCurrency = positionFinancials?.quote?.currency || ticker?.metadata.currency || config.baseCurrency;
|
|
568
|
-
// The search shows the ticker and the Portfolio filter the account, so the
|
|
569
|
-
// context is the price first, then the account only when there is no filter.
|
|
570
572
|
const meta = [
|
|
571
|
-
price != null ? formatCurrency(price, quoteCurrency) : null,
|
|
572
573
|
portfolioTabs.length > 1 ? null : activePortfolio?.name ?? null,
|
|
573
574
|
bankrollOverride != null || currentValueOverride != null ? "override" : null,
|
|
574
575
|
tickerSearchStatus,
|
|
@@ -646,6 +647,15 @@ export function KellySizerPane({ focused, width, height }: PaneProps) {
|
|
|
646
647
|
|
|
647
648
|
{tabStrip && <Box height={1} paddingX={1}>{tabStrip}</Box>}
|
|
648
649
|
|
|
650
|
+
{sizingPrice && priceLine && (
|
|
651
|
+
<Box flexDirection="column" paddingX={1} flexShrink={0}>
|
|
652
|
+
<KeyValueRow label="Price" value={splitPriceLine ? formatKellySizingPrice({ ...sizingPrice, asOf: null }) : priceLine}
|
|
653
|
+
labelWidth={6} width={width - 2} emphasis={false} />
|
|
654
|
+
{splitPriceLine && sizingPrice.asOf != null && <KeyValueRow label="As of" value={formatUtcTime(sizingPrice.asOf)}
|
|
655
|
+
labelWidth={6} width={width - 2} emphasis={false} />}
|
|
656
|
+
</Box>
|
|
657
|
+
)}
|
|
658
|
+
|
|
649
659
|
<FieldGrid
|
|
650
660
|
fields={gridFields}
|
|
651
661
|
activeId={activeInputId}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { formatDay } from "../../../utils/day-format";
|
|
1
2
|
import { useMemo } from "react";
|
|
2
3
|
import {
|
|
3
4
|
DataTableView,
|
|
@@ -25,7 +26,7 @@ export function buildKellyHistoryItems(inputs: KellyHistoryInputs): StatItem[] {
|
|
|
25
26
|
const payoff = inputs.downsideReturn < 0 ? inputs.upsideReturn / -inputs.downsideReturn : null;
|
|
26
27
|
return [
|
|
27
28
|
// The dates take a row of their own so a narrow pane never cuts them.
|
|
28
|
-
{ id: "window", label: "Window", value: `${inputs.start} to ${inputs.end}`, detail: `${inputs.periods} monthly returns${inputs.rollNote ? `, ${inputs.rollNote}` : ""}`, wide: true },
|
|
29
|
+
{ id: "window", label: "Window", value: `${formatDay(inputs.start)} to ${formatDay(inputs.end)}`, detail: `${inputs.periods} monthly returns${inputs.rollNote ? `, ${inputs.rollNote}` : ""}`, wide: true },
|
|
29
30
|
{ id: "winRate", label: "Win rate", value: formatPct(inputs.winProbability, 1), detail: `${inputs.wins}/${inputs.periods}` },
|
|
30
31
|
{ id: "avgGain", label: "Avg gain", value: formatSignedPct(inputs.upsideReturn), color: priceColor(inputs.upsideReturn) },
|
|
31
32
|
{ id: "avgLoss", label: "Avg loss", value: formatSignedPct(inputs.downsideReturn), color: priceColor(inputs.downsideReturn) },
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { FuturesContractTermsPayload } from "../../../api-client/futures-curve";
|
|
2
2
|
import { isFuturesInstrument, loadFuturesContractTermsCached } from "../../../market-data/futures-contract";
|
|
3
|
+
import { resolveAssetDisplayKind } from "../../../market-data/market/format";
|
|
4
|
+
import { getCompletedRegularSessionDisplay, getExtendedSessionDisplay } from "../../../market-data/market/status";
|
|
5
|
+
import { regularSessionValuationPrice, regularSessionValuationTime } from "../../../market-data/quotes/regular-session-valuation";
|
|
3
6
|
import { futuresContractSize } from "../../../portfolio/futures-positions";
|
|
7
|
+
import type { Quote } from "../../../types/financials";
|
|
4
8
|
import { isRoundTheClockCoin } from "../../../utils/crypto-pair";
|
|
9
|
+
import { formatCurrencyCode, formatNumber } from "../../../utils/format";
|
|
5
10
|
import { logFailure } from "../../../utils/log-failure";
|
|
11
|
+
import { formatUtcTime } from "../../../utils/utc-time";
|
|
6
12
|
|
|
7
13
|
/** What a Kelly position is counted in: shares of a stock or fund, units of a coin, contracts of a future. */
|
|
8
14
|
export type KellyCount = "shares" | "units" | "contracts";
|
|
@@ -12,6 +18,26 @@ export function kellyCount(symbol: string, exchange: string, instrumentType: str
|
|
|
12
18
|
return isRoundTheClockCoin(symbol, exchange) ? "units" : "shares";
|
|
13
19
|
}
|
|
14
20
|
|
|
21
|
+
export function kellySizingPrice(quote: Quote | null | undefined, count: KellyCount, instrumentType = quote?.instrumentType) {
|
|
22
|
+
if (!quote) return null;
|
|
23
|
+
const equity = count === "shares" && resolveAssetDisplayKind({ assetCategory: instrumentType }) === "equity";
|
|
24
|
+
const completed = equity && getCompletedRegularSessionDisplay(quote) != null;
|
|
25
|
+
if (equity && !completed && (getExtendedSessionDisplay(quote) || quote.marketState === "PRE" || quote.marketState === "POST")) return null;
|
|
26
|
+
const value = equity ? regularSessionValuationPrice(quote) : quote.price;
|
|
27
|
+
if (value == null || !Number.isFinite(value) || value <= 0) return null;
|
|
28
|
+
const stamp = equity ? regularSessionValuationTime(quote)
|
|
29
|
+
: Number.isFinite(quote.lastUpdated) && quote.lastUpdated > 0 ? { time: quote.lastUpdated, dateOnly: false } : null;
|
|
30
|
+
const asOf = stamp?.dateOnly ? new Date(stamp.time).toISOString().slice(0, 10) : stamp?.time ?? null;
|
|
31
|
+
const session = completed || (equity && quote.marketState === "CLOSED") ? "Regular close"
|
|
32
|
+
: equity && quote.marketState === "REGULAR" ? "Regular session" : "Last quote";
|
|
33
|
+
return { value, currency: quote.currency || null, asOf, session };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function formatKellySizingPrice(price: NonNullable<ReturnType<typeof kellySizingPrice>>) {
|
|
37
|
+
const amount = price.currency ? formatCurrencyCode(price.value, price.currency) : formatNumber(price.value, 4);
|
|
38
|
+
return [amount, price.session, price.asOf == null ? null : formatUtcTime(price.asOf)].filter(Boolean).join(" · ");
|
|
39
|
+
}
|
|
40
|
+
|
|
15
41
|
/**
|
|
16
42
|
* What one of the count is worth per unit of price: a future's contract
|
|
17
43
|
* multiplier from the exchange's terms (ES's $50 a point, ZC's 5,000 bushels
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dayCell, formatDay } from "../../../components/ui/day-cell";
|
|
1
2
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
2
3
|
import { DataTableView, EmptyState, PaneStatusBody, QueryBar, StatGrid, statGridRows, usePaneFooter, usePaneNoticeFooter,
|
|
3
4
|
usePaneTicker, type DataTableCell, type DataTableColumn, type StatItem } from "../../../components";
|
|
@@ -32,12 +33,18 @@ const SURPRISE_OPTIONS = [{ value: "all", label: "All" }, ...MACRO_SURPRISES.map
|
|
|
32
33
|
|
|
33
34
|
const times = (value: number | null | undefined) => value == null ? MISSING_VALUE : `${value.toFixed(1)}x`;
|
|
34
35
|
|
|
35
|
-
const DATE: DataTableColumn = { id: "date", label: "Date", width:
|
|
36
|
+
const DATE: DataTableColumn = { id: "date", label: "Date", width: 20, align: "left" };
|
|
36
37
|
/** The move and its multiple of a normal day's; a yield's move is in basis points, and its header says so. */
|
|
37
38
|
const moveColumns = (basis: MacroDayMoveBasis): DataTableColumn[] => [
|
|
38
39
|
{ id: "move", label: basis === "yield" ? "Move bp" : "Move", width: 9, align: "right" },
|
|
39
40
|
{ id: "multiple", label: "vs Normal", width: 10, align: "right" },
|
|
40
41
|
];
|
|
42
|
+
/**
|
|
43
|
+
* What a narrow desktop pane gives up first: the figures the economic calendar
|
|
44
|
+
* also holds, from the prior print to the actual. The day, its release and the
|
|
45
|
+
* move are what the pane is for.
|
|
46
|
+
*/
|
|
47
|
+
const COLUMN_DROP_ORDER = ["prior", "forecast", "surprise", "actual"] as const;
|
|
41
48
|
/** What each release came out with, under the labels the economic calendar gives them. */
|
|
42
49
|
const FIGURES = [["actual", "Actual"], ["forecast", "Forecast"], ["prior", "Prior"]] as const;
|
|
43
50
|
|
|
@@ -160,7 +167,7 @@ function MacroDayComparisonPane({ width, height, focused, list }: PaneProps & {
|
|
|
160
167
|
const scoped = useMemo(() => compareMacroDays(models).filter((event) => release === "all" || event.kind === release), [models, release]);
|
|
161
168
|
const rows = useMemo(() => scoped.filter((event) => matchesSurprise(event, surprise)), [scoped, surprise]);
|
|
162
169
|
const columns = useMemo<DataTableColumn[]>(() => [
|
|
163
|
-
{ ...DATE, width:
|
|
170
|
+
{ ...DATE, width: 11 }, { id: "release", label: "Release", width: 12, align: "left" },
|
|
164
171
|
...models.map((model) => ({ id: model.symbol, label: macroDayComparisonHeader(model),
|
|
165
172
|
width: Math.max(8, displayWidth(macroDayComparisonHeader(model))), align: "right" as const })),
|
|
166
173
|
...figureColumns(rows),
|
|
@@ -182,7 +189,7 @@ function MacroDayComparisonPane({ width, height, focused, list }: PaneProps & {
|
|
|
182
189
|
{ id: "basis", parts: [{ text: "daily close-to-close", tone: "muted" as const }] },
|
|
183
190
|
] }), [stale]);
|
|
184
191
|
const renderCell = (event: MacroDayComparisonRow, column: DataTableColumn): DataTableCell => {
|
|
185
|
-
if (column.id === "date") return
|
|
192
|
+
if (column.id === "date") return dayCell(event.date);
|
|
186
193
|
if (column.id === "release") return { text: macroDayEventLabel(event) };
|
|
187
194
|
if (column.id === "actual" || column.id === "forecast" || column.id === "prior") return { text: event.figures?.[column.id] ?? "" };
|
|
188
195
|
if (column.id === "surprise") return { text: macroSurpriseText(event) };
|
|
@@ -255,7 +262,7 @@ function SingleMacroDayPane({ width, height, focused }: PaneProps) {
|
|
|
255
262
|
] }), [history.loading, history.data?.stale, history.data?.earnings.stale, model?.start, model?.asOf]);
|
|
256
263
|
|
|
257
264
|
const renderCell = useCallback((event: MacroDayEvent, column: DataTableColumn): DataTableCell => {
|
|
258
|
-
if (column.id === "date") return { text: event.session === event.date ? event.date : `${event.date} → ${event.session
|
|
265
|
+
if (column.id === "date") return { text: event.session === event.date ? formatDay(event.date) : `${formatDay(event.date)} → ${formatDay(event.session, "no-year")}`, value: event.date };
|
|
259
266
|
if (column.id === "release") return { text: release === "all" ? macroDayEventLabel(event) : macroDayEventNote(event) };
|
|
260
267
|
// The print colored against the consensus, as the economic calendar colors it.
|
|
261
268
|
if (column.id === "actual") return { text: event.figures?.actual ?? "", color: event.figures?.surprise === "hot" ? colors.positive
|
|
@@ -281,7 +288,7 @@ function SingleMacroDayPane({ width, height, focused }: PaneProps) {
|
|
|
281
288
|
error={!model ? history.error ?? identityError ?? null : null} empty={!!model && !model.events.length}>
|
|
282
289
|
{model ? <>
|
|
283
290
|
<StatGrid items={stats} width={width} maxLines={statMaxLines} />
|
|
284
|
-
<DataTableView<MacroDayEvent> focused={focused} columns={columns} items={rows} rootWidth={width} rootHeight={contentHeight}
|
|
291
|
+
<DataTableView<MacroDayEvent> focused={focused} columns={columns} columnDropOrder={COLUMN_DROP_ORDER} items={rows} rootWidth={width} rootHeight={contentHeight}
|
|
285
292
|
getItemKey={macroDayKey} emptyStateTitle={surprise === "all" ? "No release days." : `No ${MACRO_SURPRISE_LABELS[surprise].toLowerCase()} prints.`} sortColumnId={null} sortDirection="desc" selectedTextOverridesCellColor
|
|
286
293
|
selection={{ kind: "id", selectedId: selectedRow, getId: macroDayKey, onChange: setSelectedRow }}
|
|
287
294
|
getExportMetadata={() => [["symbol", model.symbol], ["from", model.start ?? ""], ["to", model.asOf ?? ""],
|
|
@@ -167,6 +167,7 @@ export function haltStatusLabel(status: HaltStatus): string {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
/** A halt in force in red, quoting before trading in amber; a resumed one is back to normal and takes no colour. */
|
|
170
171
|
export function haltStatusColor(status: HaltStatus): string {
|
|
171
172
|
switch (status) {
|
|
172
173
|
case "halted":
|
|
@@ -174,7 +175,7 @@ export function haltStatusColor(status: HaltStatus): string {
|
|
|
174
175
|
case "quote":
|
|
175
176
|
return colors.warning;
|
|
176
177
|
case "resumed":
|
|
177
|
-
return colors.
|
|
178
|
+
return colors.text;
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
|
|
@@ -278,18 +279,19 @@ const REASON_MIN_WIDTH = 14;
|
|
|
278
279
|
const HALT_COLUMNS: readonly HaltColumn[] = [
|
|
279
280
|
{ id: "symbol", label: "SYMBOL", width: 8, align: "left" },
|
|
280
281
|
// "Non NASDAQ" and "NYSE Arca" are real feed values, so MKT holds all ten cells.
|
|
281
|
-
{ id: "market", label: "MKT", width: 10, align: "left" },
|
|
282
|
+
{ id: "market", label: "MKT", width: 10, align: "left", omitWhenSame: true },
|
|
282
283
|
{ id: "company", label: "COMPANY", width: COMPANY_MIN_WIDTH, align: "left", flexGrow: 1 },
|
|
283
|
-
{ id: "code", label: "CODE", width: 6, align: "left" },
|
|
284
|
+
{ id: "code", label: "CODE", width: 6, align: "left", omitWhenSame: true },
|
|
284
285
|
{ id: "reason", label: "REASON", width: REASON_MIN_WIDTH, align: "left", flexGrow: 1 },
|
|
285
|
-
{ id: "date", label: "DATE ET", width: 10, align: "left" },
|
|
286
|
+
{ id: "date", label: "DATE ET", width: 10, align: "left", omitWhenSame: true },
|
|
286
287
|
{ id: "age", label: "AGE", width: 6, align: "right" },
|
|
287
288
|
{ id: "halted", label: "HALT ET", width: 9, align: "left" },
|
|
288
|
-
// Set when quoting and trading resume: a halt still in force has neither.
|
|
289
|
-
{ id: "quote", label: "QUOTE ET", width: 12, align: "left", mayBeBlank: true },
|
|
290
|
-
{ id: "trade", label: "TRADE ET", width: 12, align: "left", mayBeBlank: true },
|
|
289
|
+
// Set when quoting and trading resume: a halt still in force has neither, so a list of halts in force has no column for them.
|
|
290
|
+
{ id: "quote", label: "QUOTE ET", width: 12, align: "left", mayBeBlank: true, omitWhenEmpty: true },
|
|
291
|
+
{ id: "trade", label: "TRADE ET", width: 12, align: "left", mayBeBlank: true, omitWhenEmpty: true },
|
|
291
292
|
{ id: "duration", label: "HALTED FOR", width: 12, align: "right" },
|
|
292
|
-
|
|
293
|
+
// The list is the whole feed, so one status on every row (the Active or Resumed tab) needs no column.
|
|
294
|
+
{ id: "status", label: "STATUS", width: 8, align: "left", omitWhenSame: true },
|
|
293
295
|
];
|
|
294
296
|
|
|
295
297
|
/**
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
type DataTableKeyEvent
|
|
8
8
|
} from "../../../components";
|
|
9
9
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
10
|
+
import { usePinnedList } from "../../../components/use-pinned-moment";
|
|
10
11
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
11
12
|
import { useShortcut } from "../../../react/input";
|
|
12
13
|
import { colors } from "../../../theme/colors";
|
|
@@ -44,6 +45,9 @@ import {
|
|
|
44
45
|
type HaltSortPreference,
|
|
45
46
|
} from "./model";
|
|
46
47
|
|
|
48
|
+
const haltId = (row: HaltRecord) => row.id;
|
|
49
|
+
const haltMoment = (row: HaltRecord) => row.haltedAt;
|
|
50
|
+
|
|
47
51
|
/** Halted rows flip to resumed on the clock alone, so the pane re-reads it. */
|
|
48
52
|
const EMPTY_RECORDS: HaltRecord[] = [];
|
|
49
53
|
const STATUS_TICK_MS = 15_000;
|
|
@@ -79,10 +83,17 @@ export function MarketHaltsPane({ focused, width, height }: PaneProps) {
|
|
|
79
83
|
[filter, now, records, sortPreference],
|
|
80
84
|
);
|
|
81
85
|
|
|
86
|
+
// A crosshair pinned in the tab picks the newest halt by then and mutes
|
|
87
|
+
// the later ones; the selection follows the pin when it moves, not when a
|
|
88
|
+
// refresh brings a halt in. Status and age still read the clock now.
|
|
89
|
+
const { pinnedRow, isAfterPin } = usePinnedList<HaltRecord>("market-halts:pin", {
|
|
90
|
+
rows, getId: haltId, moment: haltMoment, selectedId, select: setSelectedId,
|
|
91
|
+
});
|
|
92
|
+
|
|
82
93
|
useEffect(() => {
|
|
83
94
|
if (selectedId && rows.some((row) => row.id === selectedId)) return;
|
|
84
|
-
setSelectedId(rows[0]?.id ?? null);
|
|
85
|
-
}, [rows, selectedId]);
|
|
95
|
+
setSelectedId((pinnedRow ?? rows[0])?.id ?? null);
|
|
96
|
+
}, [pinnedRow, rows, selectedId]);
|
|
86
97
|
|
|
87
98
|
const refresh = useCallback(() => load(), [load]);
|
|
88
99
|
const selectFilter = useCallback((value: string) => setFilter(value as HaltFilter), [setFilter]);
|
|
@@ -189,7 +200,7 @@ export function MarketHaltsPane({ focused, width, height }: PaneProps) {
|
|
|
189
200
|
return {
|
|
190
201
|
text: haltStatusLabel(rowStatus),
|
|
191
202
|
color: selectedColor ?? haltStatusColor(rowStatus),
|
|
192
|
-
attributes: TextAttributes.BOLD,
|
|
203
|
+
attributes: rowStatus === "resumed" ? 0 : TextAttributes.BOLD,
|
|
193
204
|
};
|
|
194
205
|
}
|
|
195
206
|
}
|
|
@@ -235,6 +246,7 @@ export function MarketHaltsPane({ focused, width, height }: PaneProps) {
|
|
|
235
246
|
getItemKey={(row) => row.id}
|
|
236
247
|
onActivate={openTicker}
|
|
237
248
|
renderCell={renderCell}
|
|
249
|
+
isRowMuted={isAfterPin}
|
|
238
250
|
emptyStateTitle={haltsEmptyTitle(filter)}
|
|
239
251
|
/>
|
|
240
252
|
</Box>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { apiClient } from "../../../api-client";
|
|
2
2
|
import { cloudDisplayScope } from "../../../api-client/plan-access";
|
|
3
3
|
import { createTtlCache } from "../../../data/ttl-cache";
|
|
4
|
-
import type { MarketHeatmapResult, MarketHeatmapUniverseId } from "../../../api-client/market-discovery";
|
|
4
|
+
import type { MarketHeatmapAsset, MarketHeatmapResult, MarketHeatmapUniverseId } from "../../../api-client/market-discovery";
|
|
5
5
|
export type { MarketHeatmapUniverseId } from "../../../api-client/market-discovery";
|
|
6
6
|
|
|
7
7
|
export const MARKET_HEATMAP_UNIVERSES = [
|
|
@@ -63,6 +63,21 @@ export function dedupeHeatmapAssets<T extends { symbol: string; size: number | n
|
|
|
63
63
|
return result;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* A real-time board's tile the server's live read did not price comes as a
|
|
68
|
+
* tile with no move and no price, the shape older clients draw blank, with
|
|
69
|
+
* its delayed figures in `delayedQuote`. This client holds it as a name that
|
|
70
|
+
* has moved in the session but has no live move yet (`hasChange` true,
|
|
71
|
+
* `changePercent` null), whatever `hasChange` the server sent: the tile then
|
|
72
|
+
* shows its delayed figures, marked, until the stream's live quote of the
|
|
73
|
+
* name gives it a move of its own. Every other tile is left as it came.
|
|
74
|
+
*/
|
|
75
|
+
export function holdDelayedHeatmapTiles<T extends MarketHeatmapAsset>(assets: readonly T[]): T[] {
|
|
76
|
+
return assets.map((asset) => (asset.delayedQuote && typeof asset.delayedQuote === "object"
|
|
77
|
+
? { ...asset, hasChange: true, change: null, changePercent: null, price: 0, volume: null, regularChangePercent: null }
|
|
78
|
+
: asset));
|
|
79
|
+
}
|
|
80
|
+
|
|
66
81
|
async function loadMarketHeatmap(universe: MarketHeatmapUniverseId, count: number, sources?: MarketHeatmapSources): Promise<MarketHeatmapBoard> {
|
|
67
82
|
const response = await (sources?.client ?? apiClient).getMarketHeatmap(universe, count);
|
|
68
83
|
if (!response.data || !Array.isArray(response.data.assets) || response.data.universe !== universe
|
|
@@ -70,7 +85,7 @@ async function loadMarketHeatmap(universe: MarketHeatmapUniverseId, count: numbe
|
|
|
70
85
|
return {
|
|
71
86
|
...response.data,
|
|
72
87
|
stale: response.stale === true || response.data.stale === true,
|
|
73
|
-
assets: dedupeHeatmapAssets(response.data.assets).slice(0, count),
|
|
88
|
+
assets: holdDelayedHeatmapTiles(dedupeHeatmapAssets(response.data.assets).slice(0, count)),
|
|
74
89
|
checkedAt: Date.now(),
|
|
75
90
|
topCount: Math.min(count, response.data.assets.length),
|
|
76
91
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { HeadlessFreshnessStatus } from "../../../types/headless";
|
|
1
2
|
import type { HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
|
|
2
3
|
import { formatCompact, formatPercentRaw } from "../../../utils/format";
|
|
3
4
|
import { MARKET_HEATMAP_REQUEST_COUNT, MARKET_HEATMAP_UNIVERSES, fetchMarketHeatmap, type MarketHeatmapBoard, type MarketHeatmapUniverseId } from "./data";
|
|
4
|
-
import { heatmapMove, summarizeHeatmapGroups, type HeatmapGroupBy, type HeatmapGroupSummary } from "./model";
|
|
5
|
+
import { heatmapDelayedPrintTime, heatmapDelayedQuote, heatmapMove, summarizeHeatmapGroups, type HeatmapGroupBy, type HeatmapGroupSummary } from "./model";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* A few names always lack a move (foreign listings and new tickers the snapshot
|
|
@@ -39,6 +40,33 @@ function noMoveNotice(symbols: readonly string[], names: number): string {
|
|
|
39
40
|
return `${symbols.length} of ${names} names have no move yet and count toward size only: ${shown}${rest}.`;
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
/** A real-time board's names the server could not price live, as the report lists them. */
|
|
44
|
+
interface DelayedName {
|
|
45
|
+
symbol: string;
|
|
46
|
+
move: number | null;
|
|
47
|
+
price: number | null;
|
|
48
|
+
printedAt: string | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function delayedNames(assets: MarketHeatmapBoard["assets"]): DelayedName[] {
|
|
52
|
+
return assets.flatMap((asset) => {
|
|
53
|
+
const delayed = heatmapDelayedQuote(asset);
|
|
54
|
+
if (!delayed) return [];
|
|
55
|
+
const printedAt = typeof delayed.printedAt === "number" && delayed.printedAt > 0 ? new Date(delayed.printedAt).toISOString() : null;
|
|
56
|
+
return [{ symbol: asset.symbol, move: delayed.changePercent, price: delayed.price, printedAt }];
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function delayedNotice(names: readonly DelayedName[], assets: MarketHeatmapBoard["assets"], now: number): string {
|
|
61
|
+
const bySymbol = new Map(assets.map((asset) => [asset.symbol, asset]));
|
|
62
|
+
const shown = names.slice(0, 8).map((name) => {
|
|
63
|
+
const delayed = heatmapDelayedQuote(bySymbol.get(name.symbol)!);
|
|
64
|
+
return `${name.symbol} ${delayed ? heatmapDelayedPrintTime(delayed, now) : "delayed"}`;
|
|
65
|
+
}).join(", ");
|
|
66
|
+
const rest = names.length > 8 ? ` and ${names.length - 8} more` : "";
|
|
67
|
+
return `${names.length} of ${assets.length} names had no live price and are left out of the moves; their delayed figures are in metadata.delayed: ${shown}${rest}.`;
|
|
68
|
+
}
|
|
69
|
+
|
|
42
70
|
/**
|
|
43
71
|
* When the board's figures are from, and whose sessions they follow: when its
|
|
44
72
|
* prices printed, from a server that says (`pricesAsOf`). Otherwise, outside
|
|
@@ -54,6 +82,21 @@ function boardObservation(board: Pick<MarketHeatmapBoard, "fetchedAt" | "regular
|
|
|
54
82
|
return { asOf, sessionExchange: "NYSE" };
|
|
55
83
|
}
|
|
56
84
|
|
|
85
|
+
/**
|
|
86
|
+
* How current the report's figures are. A Pro account's board is priced from a
|
|
87
|
+
* live read and everyone else's is fifteen minutes behind. While the regular
|
|
88
|
+
* session trades, a Pro board the server says is stale is stale, and one with
|
|
89
|
+
* no name moving at all is delayed: it has no live read yet, or nothing has
|
|
90
|
+
* traded since the open, so every figure it holds is a delayed one beside its
|
|
91
|
+
* tile. Outside the session a Pro board reads as live, as before.
|
|
92
|
+
*/
|
|
93
|
+
function boardFreshness(result: Pick<MarketHeatmapBoard, "access" | "session" | "stale">, moved: number): HeadlessFreshnessStatus {
|
|
94
|
+
if (result.access !== "realtime") return "delayed";
|
|
95
|
+
if (result.session !== "REGULAR") return "live";
|
|
96
|
+
if (result.stale) return "stale";
|
|
97
|
+
return moved > 0 ? "live" : "delayed";
|
|
98
|
+
}
|
|
99
|
+
|
|
57
100
|
function projectRow(summary: HeatmapGroupSummary, groupBy: HeatmapGroupBy, whole = false) {
|
|
58
101
|
return {
|
|
59
102
|
group: whole ? "All" : summary.group ?? (summary.sector ? "No industry" : groupBy === "industry" ? "Unclassified" : "No sector"),
|
|
@@ -103,6 +146,7 @@ export const marketHeatmapHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
103
146
|
dataRequirements: ["Gloom Cloud market heatmap snapshot"],
|
|
104
147
|
limitations: [
|
|
105
148
|
"The snapshot the pane starts from: real-time with Pro, fifteen minutes behind otherwise; the pane's live-streamed colors are not in the report.",
|
|
149
|
+
"On a real-time board, a name the server had no live price for is left out of the moves and listed with its delayed figures and when they printed.",
|
|
106
150
|
"Sizes, shares and the weighted move use market cap (net assets for ETFs), not the pane's tile area, which follows its Size by setting (the day's move by default).",
|
|
107
151
|
],
|
|
108
152
|
},
|
|
@@ -124,15 +168,20 @@ export const marketHeatmapHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
124
168
|
ctx.signal.throwIfAborted();
|
|
125
169
|
const { grouping, groups, board } = summarizeHeatmapGroups(result.assets, groupBy);
|
|
126
170
|
const flat = grouping === "flat";
|
|
127
|
-
const
|
|
171
|
+
const delayed = delayedNames(result.assets);
|
|
172
|
+
const delayedSymbols = new Set(delayed.map((name) => name.symbol));
|
|
173
|
+
const noMove = result.assets.filter((asset) => heatmapMove(asset) == null && !delayedSymbols.has(asset.symbol)).map((asset) => asset.symbol);
|
|
128
174
|
const covered = result.assets.length > 0 && board.moved / board.names >= MIN_MOVE_COVERAGE;
|
|
175
|
+
const notices = [
|
|
176
|
+
...(delayed.length > 0 ? [delayedNotice(delayed, result.assets, Date.now())] : []),
|
|
177
|
+
...(noMove.length > 0 ? [noMoveNotice(noMove, result.assets.length)] : []),
|
|
178
|
+
];
|
|
129
179
|
return {
|
|
130
180
|
columns: columns(universe, groupBy, flat),
|
|
131
181
|
rows: groups.map((summary) => projectRow(summary, groupBy, flat)),
|
|
132
182
|
complete: !result.stale && covered,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
unavailableSymbols: covered ? [] : noMove,
|
|
183
|
+
freshness: { status: boardFreshness(result, board.moved), tradingDayMarket: "US" },
|
|
184
|
+
unavailableSymbols: covered ? [] : [...delayedSymbols, ...noMove],
|
|
136
185
|
metadata: {
|
|
137
186
|
universe,
|
|
138
187
|
groupBy: flat ? null : groupBy,
|
|
@@ -142,7 +191,8 @@ export const marketHeatmapHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
142
191
|
regularSessionDate: result.regularSessionDate ?? null,
|
|
143
192
|
names: result.assets.length,
|
|
144
193
|
noMove,
|
|
145
|
-
|
|
194
|
+
delayed,
|
|
195
|
+
...(notices.length > 0 ? { notices } : {}),
|
|
146
196
|
board: projectRow(board, groupBy, true),
|
|
147
197
|
unit: "move and sharePercent in percent; size in USD",
|
|
148
198
|
weighting: universe === "us-etf"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import type { MarketHeatmapDelayedQuote } from "../../../api-client/market-discovery";
|
|
2
3
|
import { useCloudDisplayScope } from "../../../api-client/plan-access";
|
|
3
4
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
4
5
|
import { Box, useUiCapabilities } from "../../../ui";
|
|
@@ -92,8 +93,11 @@ import {
|
|
|
92
93
|
import { useMarketHeatmapEvidence } from "./evidence";
|
|
93
94
|
import { marketHeatmapHeadless } from "./headless";
|
|
94
95
|
import {
|
|
96
|
+
DELAYED_TILE_MARK,
|
|
95
97
|
HEATMAP_NAME_COUNTS,
|
|
96
98
|
heatmapBoardCaption,
|
|
99
|
+
heatmapDelayedPrintTime,
|
|
100
|
+
heatmapDelayedQuote,
|
|
97
101
|
heatmapExtendedPrintTime,
|
|
98
102
|
heatmapMove,
|
|
99
103
|
heatmapNameCount,
|
|
@@ -218,9 +222,43 @@ function buildLayoutItems(
|
|
|
218
222
|
*/
|
|
219
223
|
const paintItemCache = new WeakMap<HeatmapBoardAsset, MetricTreemapItem<HeatmapBoardAsset>>();
|
|
220
224
|
|
|
225
|
+
/**
|
|
226
|
+
* A tile of a real-time board the server could not price live, until the
|
|
227
|
+
* stream does: grey, as a tile without a move, with the delayed move marked
|
|
228
|
+
* by the clock and dated in its tooltip, so it never reads as a live one.
|
|
229
|
+
*/
|
|
230
|
+
function delayedPaintItem(asset: HeatmapBoardAsset, delayed: MarketHeatmapDelayedQuote): MetricTreemapItem<HeatmapBoardAsset> {
|
|
231
|
+
const details = [
|
|
232
|
+
typeof delayed.price === "number" && delayed.price > 0 ? formatCurrency(delayed.price, asset.currency) : null,
|
|
233
|
+
sizeLabel(asset),
|
|
234
|
+
delayed.volume != null ? `Vol ${formatCompact(delayed.volume)}` : null,
|
|
235
|
+
].filter((part): part is string => !!part);
|
|
236
|
+
const name = asset.name && asset.name !== asset.symbol ? asset.name : null;
|
|
237
|
+
const move = `${delayed.changePercent == null ? MISSING_VALUE : formatPercentRaw(delayed.changePercent)} ${DELAYED_TILE_MARK} ${heatmapDelayedPrintTime(delayed, Date.now())}`;
|
|
238
|
+
return {
|
|
239
|
+
id: asset.symbol,
|
|
240
|
+
label: asset.symbol,
|
|
241
|
+
weight: asset.weight ?? asset.size ?? 0,
|
|
242
|
+
colorValue: null,
|
|
243
|
+
primaryText: formatHeatTileMove(delayed.changePercent),
|
|
244
|
+
primaryTextSuffix: DELAYED_TILE_MARK,
|
|
245
|
+
tooltip: [
|
|
246
|
+
name ? { text: [asset.symbol, name, move].join(" · "), keepEnd: ` · ${move}` } : [asset.symbol, move].join(" · "),
|
|
247
|
+
...(details.length > 0 ? [details.join(" · ")] : []),
|
|
248
|
+
],
|
|
249
|
+
data: asset,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
221
253
|
function paintItem(asset: HeatmapBoardAsset): MetricTreemapItem<HeatmapBoardAsset> {
|
|
222
254
|
const cached = paintItemCache.get(asset);
|
|
223
255
|
if (cached) return cached;
|
|
256
|
+
const delayed = heatmapDelayedQuote(asset);
|
|
257
|
+
if (delayed) {
|
|
258
|
+
const item = delayedPaintItem(asset, delayed);
|
|
259
|
+
paintItemCache.set(asset, item);
|
|
260
|
+
return item;
|
|
261
|
+
}
|
|
224
262
|
const change = heatmapMove(asset);
|
|
225
263
|
const details = [
|
|
226
264
|
asset.price > 0 ? formatCurrency(asset.price, asset.currency) : null,
|
|
@@ -658,7 +696,23 @@ function MarketHeatmapPane({ focused, width, height }: PaneProps) {
|
|
|
658
696
|
|
|
659
697
|
usePaneFooter("market-heatmap", () => {
|
|
660
698
|
const printTime = selectedAsset ? heatmapExtendedPrintTime(selectedAsset) : null;
|
|
661
|
-
const
|
|
699
|
+
const delayed = selectedAsset ? heatmapDelayedQuote(selectedAsset) : null;
|
|
700
|
+
// A selected tile the server could not price live shows its delayed figures, marked, and when they printed.
|
|
701
|
+
const selected: PaneFooterSegment[] = selectedAsset && delayed ? [{
|
|
702
|
+
id: "selected",
|
|
703
|
+
parts: [
|
|
704
|
+
{ text: selectedAsset.symbol, tone: "label" as const },
|
|
705
|
+
{ text: delayed.changePercent == null ? MISSING_VALUE : formatPercentRaw(delayed.changePercent), tone: "muted" as const, bold: true },
|
|
706
|
+
{ text: `${DELAYED_TILE_MARK} ${heatmapDelayedPrintTime(delayed, Date.now())}`, tone: "warning" as const },
|
|
707
|
+
...(typeof delayed.price === "number" && delayed.price > 0
|
|
708
|
+
? [{ text: formatCurrency(delayed.price, selectedAsset.currency), tone: "muted" as const }]
|
|
709
|
+
: []),
|
|
710
|
+
...(sizeLabel(selectedAsset) ? [{ text: sizeLabel(selectedAsset)!, tone: "muted" as const }] : []),
|
|
711
|
+
...(delayed.volume != null
|
|
712
|
+
? [{ text: `Vol ${formatCompact(delayed.volume)}`, tone: "muted" as const }]
|
|
713
|
+
: []),
|
|
714
|
+
],
|
|
715
|
+
}] : selectedAsset ? [{
|
|
662
716
|
id: "selected",
|
|
663
717
|
parts: [
|
|
664
718
|
{ text: selectedAsset.symbol, tone: "label" as const },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MarketHeatmapAsset } from "../../../api-client/market-discovery";
|
|
1
|
+
import type { MarketHeatmapAsset, MarketHeatmapDelayedQuote } from "../../../api-client/market-discovery";
|
|
2
2
|
import { formatShortDate } from "../../../utils/datetime-format";
|
|
3
3
|
import { displayWidth } from "../../../utils/format";
|
|
4
4
|
import { zonedDateKey, zonedDateTimeParts } from "../../../utils/zoned-date-time";
|
|
@@ -80,6 +80,32 @@ const dayLabel = (day: string) => formatShortDate(day, { year: false, utc: true,
|
|
|
80
80
|
const isTimestamp = (value: number | null | undefined): value is number =>
|
|
81
81
|
typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
82
82
|
|
|
83
|
+
/** What a tile shows after a delayed move: the clock the app's delayed footers show. */
|
|
84
|
+
export const DELAYED_TILE_MARK = "◷";
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The delayed figures a real-time board's tile carries for a name the
|
|
88
|
+
* server's live read did not price (`delayedQuote`), while nothing live
|
|
89
|
+
* replaces them: null once the tile has a live move of its own (a streamed
|
|
90
|
+
* quote), and on every other tile. Such a tile is never coloured as live.
|
|
91
|
+
*/
|
|
92
|
+
export function heatmapDelayedQuote(
|
|
93
|
+
asset: Pick<MarketHeatmapAsset, "hasChange" | "changePercent" | "regularChangePercent" | "delayedQuote"> & { extendedSession?: string },
|
|
94
|
+
): MarketHeatmapDelayedQuote | null {
|
|
95
|
+
const delayed = asset.delayedQuote;
|
|
96
|
+
if (!delayed || heatmapMove(asset) != null) return null;
|
|
97
|
+
return delayed;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** When a tile's delayed figures printed, as "delayed 11:21 ET", dated ("delayed 23 Nov 15:59 ET") when not today in New York. */
|
|
101
|
+
export function heatmapDelayedPrintTime(delayed: Pick<MarketHeatmapDelayedQuote, "printedAt">, now: number): string {
|
|
102
|
+
if (!isTimestamp(delayed.printedAt)) return "delayed";
|
|
103
|
+
const { hour, minute } = zonedDateTimeParts(delayed.printedAt, NEW_YORK);
|
|
104
|
+
const day = zonedDateKey(delayed.printedAt, NEW_YORK);
|
|
105
|
+
const clock = `${twoDigits(hour)}:${twoDigits(minute)} ET`;
|
|
106
|
+
return `delayed ${day === zonedDateKey(now, NEW_YORK) ? clock : `${dayLabel(day)} ${clock}`}`;
|
|
107
|
+
}
|
|
108
|
+
|
|
83
109
|
export function heatmapExtendedPrintTime(asset: { extendedSession?: string | null; lastUpdated?: number | null }): string | null {
|
|
84
110
|
if (!asset.extendedSession) return null;
|
|
85
111
|
if (!isTimestamp(asset.lastUpdated)) return "print time unavailable";
|