gloomberb 0.19.2 → 0.19.4
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.md +7 -1
- package/package.json +2 -2
- package/patches/electrobun@1.18.1.patch +108 -1
- package/src/account/upgrade-dialog.tsx +4 -23
- package/src/api-client/coalesce.ts +118 -0
- package/src/api-client/credit-boards.ts +13 -0
- package/src/api-client/crypto-etf-flows.ts +6 -0
- package/src/api-client/crypto-markets.ts +40 -0
- package/src/api-client/data.ts +201 -14
- package/src/api-client/equity-screener.ts +10 -0
- package/src/api-client/errors.ts +28 -0
- package/src/api-client/gpu.ts +29 -0
- package/src/api-client/index.ts +23 -2
- package/src/api-client/plan-access.ts +10 -1
- package/src/api-client/plan-rules.ts +35 -0
- package/src/api-client/request.ts +295 -42
- package/src/api-client/research-activity.ts +1 -32
- package/src/api-client/socket.ts +95 -0
- package/src/api-client/types.ts +21 -1
- package/src/app/attention-notice.tsx +94 -0
- package/src/app/keybindings/actions.ts +1 -1
- package/src/app/pane-runtime/index.tsx +1 -1
- package/src/app/pane-runtime/ticker-inspector-runtime.ts +1 -1
- package/src/app/pane-runtime/ticker-open-runtime.ts +1 -1
- package/src/app/pane-runtime/ticker-open-target.ts +12 -2
- package/src/app.tsx +23 -1
- package/src/architecture/core-builtin-allowlist.json +2 -1
- package/src/capabilities/factories.ts +1 -0
- package/src/cli/ascii-output.ts +42 -0
- package/src/cli/base-converter.ts +10 -2
- package/src/cli/command-options.ts +16 -1
- package/src/cli/commands/crypto-hints.ts +23 -4
- package/src/cli/commands/market.ts +92 -23
- package/src/cli/commands/news-search.ts +24 -5
- package/src/cli/commands/overview.ts +9 -4
- package/src/cli/commands/search.ts +71 -12
- package/src/cli/commands/system.ts +22 -30
- package/src/cli/commands/ticker.ts +49 -9
- package/src/cli/commands/version.ts +33 -0
- package/src/cli/context.ts +5 -9
- package/src/cli/data-dir.ts +7 -0
- package/src/cli/desktop-pane-shot-api-policy.ts +93 -0
- package/src/cli/desktop-pane-shot-browser.ts +320 -0
- package/src/cli/desktop-pane-shot-routes.ts +26 -1
- package/src/cli/desktop-pane-shot.ts +197 -256
- package/src/cli/early-command.ts +42 -0
- package/src/cli/earnings-calendar.ts +9 -0
- package/src/cli/entry.ts +19 -13
- package/src/cli/errors.ts +12 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/history-export.ts +22 -2
- package/src/cli/history-rows.ts +154 -4
- package/src/cli/index.ts +18 -1
- package/src/cli/known-gaps.ts +40 -5
- package/src/cli/listing-arg.ts +46 -9
- package/src/cli/options.ts +1 -1
- package/src/cli/output-file.ts +60 -13
- package/src/cli/pane-functions/catalog.ts +14 -3
- package/src/cli/pane-functions/data.ts +1 -1
- package/src/cli/pane-functions/dom.ts +45 -0
- package/src/cli/pane-functions/freshness.ts +46 -9
- package/src/cli/pane-functions/function-help.ts +17 -9
- package/src/cli/pane-functions/headless.ts +22 -14
- package/src/cli/pane-functions/index.ts +6 -2
- package/src/cli/pane-functions/options.ts +6 -2
- package/src/cli/pane-functions/resolver.ts +27 -5
- package/src/cli/pane-functions/screenshot-assessment.ts +33 -0
- package/src/cli/pane-functions/screenshot-bridge.ts +94 -13
- package/src/cli/pane-functions/screenshot-http.ts +70 -0
- package/src/cli/pane-functions/screenshot-render.ts +19 -5
- package/src/cli/quote-answer.ts +20 -0
- package/src/cli/registry.ts +41 -13
- package/src/cli/result.ts +12 -6
- package/src/cli/ticker-resolution.ts +2 -1
- package/src/cli/types.ts +2 -0
- package/src/components/chart/composite/format.ts +3 -0
- package/src/components/chart-table/header.tsx +1 -1
- package/src/components/chart-table/layout.ts +28 -11
- package/src/components/command-bar/action-runtime.ts +6 -0
- package/src/components/command-bar/commands/direct/index.ts +18 -33
- package/src/components/command-bar/commands/direct/runtime.ts +8 -3
- package/src/components/command-bar/commands/registry.ts +10 -1
- package/src/components/command-bar/helpers.ts +2 -0
- package/src/components/command-bar/list/model.ts +9 -0
- package/src/components/command-bar/pane-actions.ts +46 -35
- package/src/components/command-bar/pane-templates/workflow.ts +6 -0
- package/src/components/command-bar/panel/index.tsx +30 -3
- package/src/components/command-bar/panel/types.ts +7 -0
- package/src/components/command-bar/routes/root/command-items.ts +9 -4
- package/src/components/command-bar/routes/root/results.ts +4 -4
- package/src/components/command-bar/routes/root/runtime.ts +24 -1
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +21 -16
- package/src/components/command-bar/routing/launch-request.ts +3 -2
- package/src/components/command-bar/routing/list-state.ts +4 -1
- package/src/components/command-bar/surface/index.tsx +24 -4
- package/src/components/company-logo.tsx +2 -1
- package/src/components/layout/floating-pane.tsx +10 -0
- package/src/components/layout/header.tsx +8 -3
- package/src/components/layout/market-summary.ts +25 -7
- package/src/components/layout/pane/footer/index.tsx +7 -2
- package/src/components/layout/pane/footer/model.ts +40 -5
- package/src/components/layout/pane/frame.tsx +6 -0
- package/src/components/layout/pane/header.tsx +244 -42
- package/src/components/layout/pane/index.tsx +20 -2
- package/src/components/layout/shell/active-drag.ts +128 -27
- package/src/components/layout/shell/drag/index.ts +99 -96
- package/src/components/layout/shell/drag/live.ts +3 -17
- package/src/components/layout/shell/drag/magnets.ts +198 -0
- package/src/components/layout/shell/drag/overlays.tsx +77 -75
- package/src/components/layout/shell/drag/runtime.ts +12 -7
- package/src/components/layout/shell/index.tsx +66 -32
- package/src/components/layout/shell/native/pointer-runtime.ts +7 -2
- package/src/components/layout/shell/native/surfaces.ts +1 -9
- package/src/components/layout/shell/native/window-state.ts +21 -25
- package/src/components/layout/shell/pane/layers.tsx +153 -24
- package/src/components/layout/shell/shortcuts.ts +4 -1
- package/src/components/layout/shell/terminal-pointer-runtime.ts +24 -1
- package/src/components/layout/shell/window-mode/overlays.tsx +14 -6
- package/src/components/layout/status-bar.tsx +75 -6
- package/src/components/market-board/index.tsx +3 -2
- package/src/components/onboarding/desks-step.tsx +12 -4
- package/src/components/onboarding/first-run-workspace.ts +81 -4
- package/src/components/onboarding/onboarding-frame.tsx +2 -1
- package/src/components/onboarding/onboarding-keyboard.ts +8 -5
- package/src/components/onboarding/onboarding-wizard.tsx +54 -23
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +7 -2
- package/src/components/onboarding/run-setup-again.ts +24 -0
- package/src/components/onboarding/use-onboarding-progress.ts +33 -15
- package/src/components/onboarding/use-onboarding-upgrade.ts +2 -6
- package/src/components/onboarding/wizard-model.ts +57 -3
- package/src/components/onboarding/wizard-positions.ts +1 -1
- package/src/components/ui/delayed-mark.tsx +56 -0
- package/src/components/ui/external-link.tsx +3 -6
- package/src/components/ui/icon.tsx +8 -1
- package/src/components/ui/logo-mark.tsx +8 -5
- package/src/components/ui/stat-grid.tsx +263 -19
- package/src/core/app-runtime.ts +4 -1
- package/src/core/connection-health.ts +76 -1
- package/src/core/state/app/command-bar-launch.ts +12 -0
- package/src/core/state/app/layout.ts +4 -3
- package/src/core/state/app/types.ts +4 -1
- package/src/data/config/layout.ts +2 -2
- package/src/data/config/store/fold-panes.ts +6 -1
- package/src/data/config/store/node.ts +11 -5
- package/src/data/config/store/normalize.ts +16 -3
- package/src/data/profile-permissions.ts +47 -0
- package/src/data/resource-store.ts +34 -31
- package/src/data/sqlite/access.ts +19 -8
- package/src/data/sqlite/checkpointer.ts +95 -8
- package/src/data/sqlite/database.ts +40 -7
- package/src/docs/snapshot.json +191 -78
- package/src/i18n/es.ts +26 -3
- package/src/i18n/ja.ts +26 -3
- package/src/i18n/ko.ts +26 -3
- package/src/i18n/zh-cn.ts +26 -3
- package/src/i18n/zh-tw.ts +26 -3
- package/src/layout/desk-keys.ts +4 -1
- package/src/layout/desks.ts +38 -5
- package/src/layout/pane-follow.ts +3 -2
- package/src/layout/pane-layout-move.ts +2 -1
- package/src/layout/pane-manager/dock-stack.ts +38 -0
- package/src/layout/pane-manager/dock-tree.ts +76 -15
- package/src/layout/pane-manager/docking.ts +48 -6
- package/src/layout/pane-manager/floating-actions.ts +12 -3
- package/src/layout/pane-manager/floating-placement.ts +189 -0
- package/src/layout/pane-manager/floating.ts +23 -4
- package/src/layout/pane-manager/gridlock.ts +16 -4
- package/src/layout/pane-manager/hidden-panes.ts +30 -1
- package/src/layout/pane-manager/index.ts +2 -0
- package/src/layout/pane-manager/layout-state.ts +17 -0
- package/src/layout/pane-manager/types.ts +4 -1
- package/src/layout/ticker-retarget.ts +88 -0
- package/src/layout-marketplace/cloud.ts +9 -1
- package/src/layout-marketplace/gallery-desktop.tsx +45 -16
- package/src/market-data/batched-reads.ts +16 -0
- package/src/market-data/connection-follow.ts +68 -0
- package/src/market-data/coordinator/auxiliary.ts +4 -2
- package/src/market-data/coordinator/entries.ts +15 -3
- package/src/market-data/coordinator/financials.ts +20 -7
- package/src/market-data/coordinator/index.ts +228 -6
- package/src/market-data/coordinator/quotes.ts +10 -0
- package/src/market-data/futures-board.ts +1 -1
- package/src/market-data/futures-contract.ts +3 -1
- package/src/market-data/hooks.tsx +31 -0
- package/src/market-data/market/index-level.ts +6 -4
- package/src/market-data/published-apac-sessions.ts +6 -0
- package/src/news/aggregator.ts +19 -5
- package/src/news/news-model.ts +11 -0
- package/src/news/story-id.ts +22 -0
- package/src/news/ticker-symbols.ts +17 -1
- package/src/notifications/app-notifier.ts +35 -14
- package/src/plugins/builtin/account-management/form-components.tsx +1 -1
- package/src/plugins/builtin/account-management/index.tsx +2 -3
- package/src/plugins/builtin/account-management/model.ts +1 -1
- package/src/plugins/builtin/alerts/cli-forms.ts +15 -1
- package/src/plugins/builtin/alerts/events-pane.tsx +7 -5
- package/src/plugins/builtin/alerts/events.ts +10 -2
- package/src/plugins/builtin/alerts/index.tsx +5 -5
- package/src/plugins/builtin/alerts/research-builder.ts +5 -1
- package/src/plugins/builtin/alerts/research-rules.ts +18 -0
- package/src/plugins/builtin/alerts/targets.ts +4 -1
- package/src/plugins/builtin/attention/headless.ts +1 -1
- package/src/plugins/builtin/attention/index.tsx +2 -4
- package/src/plugins/builtin/attention/listing.ts +1 -1
- package/src/plugins/builtin/attention/series.ts +1 -1
- package/src/plugins/builtin/awards/index.tsx +1 -2
- package/src/plugins/builtin/backtest/client.ts +1 -0
- package/src/plugins/builtin/backtest/index.tsx +1 -2
- package/src/plugins/builtin/backtest/rules.ts +3 -1
- package/src/plugins/builtin/backtest/window.ts +8 -7
- package/src/plugins/builtin/broker-manager/detail.tsx +16 -3
- package/src/plugins/builtin/broker-manager/index.tsx +1 -1
- package/src/plugins/builtin/buildout/cells.tsx +5 -0
- package/src/plugins/builtin/buildout/company/flow.tsx +367 -0
- package/src/plugins/builtin/buildout/company/id.ts +2 -0
- package/src/plugins/builtin/buildout/company/model.ts +247 -0
- package/src/plugins/builtin/buildout/company/pane.tsx +318 -0
- package/src/plugins/builtin/buildout/data-runtime.ts +31 -10
- package/src/plugins/builtin/buildout/facilities.ts +309 -0
- package/src/plugins/builtin/buildout/format.ts +9 -0
- package/src/plugins/builtin/buildout/index.tsx +51 -5
- package/src/plugins/builtin/buildout/model/index.ts +68 -10
- package/src/plugins/builtin/buildout/model/normalizers.ts +5 -0
- package/src/plugins/builtin/buildout/model/types.ts +11 -2
- package/src/plugins/builtin/buildout/pane/index.tsx +93 -21
- package/src/plugins/builtin/buildout/pane/status.tsx +1 -1
- package/src/plugins/builtin/buildout/pane/themes.tsx +110 -0
- package/src/plugins/builtin/buildout/table-model.ts +26 -2
- package/src/plugins/builtin/builtin-plugin-meta.ts +16 -0
- package/src/plugins/builtin/cds/headless.ts +10 -2
- package/src/plugins/builtin/cds/model.ts +7 -3
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +2 -1
- package/src/plugins/builtin/changelog/index.tsx +3 -2
- package/src/plugins/builtin/chart-composer/headless-schema.ts +7 -2
- package/src/plugins/builtin/chart-composer/headless.ts +88 -21
- package/src/plugins/builtin/chart-composer/index.tsx +15 -3
- package/src/plugins/builtin/chart-composer/pane.tsx +26 -2
- package/src/plugins/builtin/chart-composer/series-expression.ts +3 -2
- package/src/plugins/builtin/chart-composer/studies.ts +1 -1
- package/src/plugins/builtin/chat/controller/index.ts +11 -4
- package/src/plugins/builtin/chat/controller/messages.ts +15 -4
- package/src/plugins/builtin/chat/controller/session-runtime.ts +9 -2
- package/src/plugins/builtin/chat/ghost-user.ts +8 -0
- package/src/plugins/builtin/chat/index.tsx +5 -5
- package/src/plugins/builtin/chat/status-widget.tsx +3 -1
- package/src/plugins/builtin/clinical-trials/index.tsx +1 -2
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -1
- package/src/plugins/builtin/cloud/index.tsx +1 -2
- package/src/plugins/builtin/cloud/plugin.tsx +6 -4
- package/src/plugins/builtin/cloud/team/module.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/module.tsx +1 -1
- package/src/plugins/builtin/cloud/trial-offer-status-widget.tsx +24 -1
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +39 -15
- package/src/plugins/builtin/comment-letters/index.tsx +1 -2
- package/src/plugins/builtin/commodity-balances/index.tsx +3 -3
- package/src/plugins/builtin/commodity-balances/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/aggregates.ts +13 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +20 -4
- package/src/plugins/builtin/congress-trades/headless.ts +2 -0
- package/src/plugins/builtin/congress-trades/model.ts +92 -64
- package/src/plugins/builtin/congress-trades/table.tsx +14 -2
- package/src/plugins/builtin/connections/index.ts +2 -3
- package/src/plugins/builtin/cot/index.tsx +1 -2
- package/src/plugins/builtin/cpi/index.tsx +1 -2
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +2 -1
- package/src/plugins/builtin/credit-boards/client.ts +7 -2
- package/src/plugins/builtin/credit-boards/headless.ts +25 -12
- package/src/plugins/builtin/credit-boards/model.ts +29 -0
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -4
- package/src/plugins/builtin/crypto-board/bitcoin-network.ts +143 -0
- package/src/plugins/builtin/crypto-board/headless.ts +4 -3
- package/src/plugins/builtin/crypto-board/index.tsx +4 -2
- package/src/plugins/builtin/crypto-board/series.ts +2 -0
- package/src/plugins/builtin/crypto-etf-flows/client.ts +9 -2
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +61 -6
- package/src/plugins/builtin/crypto-etf-flows/index.tsx +1 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +14 -1
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -5
- package/src/plugins/builtin/debt-maturities/headless.ts +4 -3
- package/src/plugins/builtin/debt-maturities/model.ts +17 -1
- package/src/plugins/builtin/debt-maturities/pane.tsx +18 -4
- package/src/plugins/builtin/debug/index.tsx +1 -1
- package/src/plugins/builtin/dividend-yield/client.ts +32 -2
- package/src/plugins/builtin/dividend-yield/headless.ts +58 -33
- package/src/plugins/builtin/dividend-yield/index.tsx +37 -2
- package/src/plugins/builtin/dividend-yield/pane.tsx +32 -13
- package/src/plugins/builtin/dividend-yield/ranking-reads.ts +73 -0
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +163 -0
- package/src/plugins/builtin/dividend-yield/ranking.ts +1 -1
- package/src/plugins/builtin/dividend-yield/view.ts +21 -0
- package/src/plugins/builtin/docs/index.tsx +2 -3
- package/src/plugins/builtin/doe/headless.ts +16 -3
- package/src/plugins/builtin/doe/index.tsx +5 -4
- package/src/plugins/builtin/earnings/board.tsx +2 -1
- package/src/plugins/builtin/earnings/history.tsx +2 -1
- package/src/plugins/builtin/earnings-ripple/client.ts +32 -7
- package/src/plugins/builtin/earnings-ripple/index.tsx +1 -2
- package/src/plugins/builtin/econ/calendar-model.ts +29 -6
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -2
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/headless.ts +1 -0
- package/src/plugins/builtin/equity-screener/ideas.ts +30 -1
- package/src/plugins/builtin/equity-screener/index.tsx +1 -2
- package/src/plugins/builtin/equity-screener/model.ts +28 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +5 -0
- package/src/plugins/builtin/equity-screener/screen-check.ts +23 -1
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -2
- package/src/plugins/builtin/exposure/holdings.ts +35 -13
- package/src/plugins/builtin/exposure/index.tsx +1 -2
- package/src/plugins/builtin/fear-greed/cli.ts +44 -0
- package/src/plugins/builtin/fear-greed/index.tsx +5 -53
- package/src/plugins/builtin/fear-greed/pane.tsx +2 -1
- package/src/plugins/builtin/fixed-income/index.tsx +1 -2
- package/src/plugins/builtin/futures/board-reads.ts +25 -0
- package/src/plugins/builtin/futures/coalesced-bump.ts +44 -0
- package/src/plugins/builtin/futures/index.tsx +15 -0
- package/src/plugins/builtin/futures/model.ts +14 -0
- package/src/plugins/builtin/futures/use-board-terms.ts +22 -15
- package/src/plugins/builtin/futures/use-front-returns.ts +20 -14
- package/src/plugins/builtin/futures-curve/headless.ts +6 -1
- package/src/plugins/builtin/futures-curve/index.tsx +1 -2
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/gpu/board.tsx +51 -12
- package/src/plugins/builtin/gpu/client.ts +15 -2
- package/src/plugins/builtin/gpu/equities.tsx +5 -2
- package/src/plugins/builtin/gpu/headless.ts +14 -2
- package/src/plugins/builtin/gpu/index.tsx +1 -2
- package/src/plugins/builtin/gpu/model.ts +20 -2
- package/src/plugins/builtin/gpu/pane.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +2 -2
- package/src/plugins/builtin/holders/index-holders.ts +24 -12
- package/src/plugins/builtin/holders/index.tsx +2 -3
- package/src/plugins/builtin/ipo-calendar/index.tsx +1 -2
- package/src/plugins/builtin/iv-history/index.tsx +1 -2
- package/src/plugins/builtin/jodi/index.tsx +1 -2
- package/src/plugins/builtin/kelly-sizer/index.tsx +1 -2
- package/src/plugins/builtin/layout-manager/index.tsx +9 -8
- package/src/plugins/builtin/macro-day/pane.tsx +4 -2
- package/src/plugins/builtin/market-halts/index.tsx +1 -2
- package/src/plugins/builtin/market-heatmap/index.tsx +11 -2
- package/src/plugins/builtin/market-movers/index.tsx +7 -1
- package/src/plugins/builtin/market-movers/session-body.tsx +4 -1
- package/src/plugins/builtin/market-valuation/index.tsx +1 -2
- package/src/plugins/builtin/members/index.tsx +1 -2
- package/src/plugins/builtin/money-markets/index.tsx +1 -2
- package/src/plugins/builtin/money-markets/pane.tsx +2 -1
- package/src/plugins/builtin/news/headless.ts +7 -0
- package/src/plugins/builtin/news/wire/index.tsx +1 -1
- package/src/plugins/builtin/news/wire/news/pop-out.tsx +9 -3
- package/src/plugins/builtin/notes/index.tsx +3 -6
- package/src/plugins/builtin/openfda/index.tsx +1 -2
- package/src/plugins/builtin/options/view.tsx +6 -5
- package/src/plugins/builtin/options-calculator/index.tsx +1 -2
- package/src/plugins/builtin/options-positioning/index.tsx +1 -2
- package/src/plugins/builtin/options-scenario/index.tsx +2 -4
- package/src/plugins/builtin/perps/index.tsx +1 -2
- package/src/plugins/builtin/plugin-marketplace/index.tsx +2 -3
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +2 -1
- package/src/plugins/builtin/plugin-module.ts +16 -2
- package/src/plugins/builtin/portfolio-list/cli/render.ts +53 -3
- package/src/plugins/builtin/portfolio-list/index.tsx +1 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +11 -0
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/power/index.tsx +1 -2
- package/src/plugins/builtin/rate-path/index.tsx +1 -2
- package/src/plugins/builtin/realized-vol/headless.ts +2 -0
- package/src/plugins/builtin/realized-vol/index.tsx +1 -2
- package/src/plugins/builtin/realized-vol/model.ts +16 -2
- package/src/plugins/builtin/realized-vol/pane.tsx +3 -3
- package/src/plugins/builtin/relative-rotation/index.tsx +1 -2
- package/src/plugins/builtin/research/analyst-headless.ts +33 -6
- package/src/plugins/builtin/research/analyst-model.ts +37 -2
- package/src/plugins/builtin/research/analyst-pane.tsx +25 -5
- package/src/plugins/builtin/research/index.tsx +5 -8
- package/src/plugins/builtin/research-search/index.tsx +1 -2
- package/src/plugins/builtin/revenue-breakdown/headless.ts +22 -8
- package/src/plugins/builtin/revenue-breakdown/model.ts +23 -0
- package/src/plugins/builtin/reverse-dcf/pane.tsx +4 -2
- package/src/plugins/builtin/roadmap/index.tsx +2 -3
- package/src/plugins/builtin/roadmap/pane.tsx +49 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +18 -1
- package/src/plugins/builtin/scanner/hilo-pane.tsx +12 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +7 -4
- package/src/plugins/builtin/sec/filing-content.ts +38 -6
- package/src/plugins/builtin/sec/headless.ts +5 -1
- package/src/plugins/builtin/sec/index.tsx +4 -2
- package/src/plugins/builtin/sec/model.ts +2 -0
- package/src/plugins/builtin/sectors/client.ts +18 -8
- package/src/plugins/builtin/sectors/index.tsx +30 -10
- package/src/plugins/builtin/series-inventory.ts +2 -0
- package/src/plugins/builtin/shared/cloud-resource.ts +60 -0
- package/src/plugins/builtin/shared/cloud-upgrade.ts +24 -1
- package/src/plugins/builtin/shared/forming-bars.ts +29 -0
- package/src/plugins/builtin/shared/fx-rate-freshness.ts +17 -0
- package/src/plugins/builtin/shared/series-detail-chart.tsx +4 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +5 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +2 -1
- package/src/plugins/builtin/short-volume/pane.tsx +2 -1
- package/src/plugins/builtin/social-mentions/index.tsx +1 -2
- package/src/plugins/builtin/social-mentions/pane.tsx +2 -1
- package/src/plugins/builtin/supply-chain/client.ts +22 -1
- package/src/plugins/builtin/supply-chain/graph-client.ts +22 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -2
- package/src/plugins/builtin/thirteenf/api.ts +116 -13
- package/src/plugins/builtin/thirteenf/data.ts +132 -30
- package/src/plugins/builtin/thirteenf/index.tsx +2 -4
- package/src/plugins/builtin/thirteenf/model.ts +2 -0
- package/src/plugins/builtin/thirteenf/pane.tsx +20 -11
- package/src/plugins/builtin/thirteenf/types.ts +12 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +17 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-history.ts +81 -11
- package/src/plugins/builtin/ticker-detail/headless.ts +11 -3
- package/src/plugins/builtin/ticker-detail/index.tsx +5 -10
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +41 -8
- package/src/plugins/builtin/time-sales/index.tsx +1 -2
- package/src/plugins/builtin/time-sales/pane.tsx +3 -1
- package/src/plugins/builtin/trace-bonds/headless.ts +11 -2
- package/src/plugins/builtin/trace-bonds/model.ts +44 -10
- package/src/plugins/builtin/trace-bonds/pane.tsx +12 -7
- package/src/plugins/builtin/treasury-auctions/pane.tsx +2 -2
- package/src/plugins/builtin/vol-surface/client.ts +18 -3
- package/src/plugins/builtin/vol-surface/index.tsx +1 -2
- package/src/plugins/builtin/volatility/index.tsx +1 -2
- package/src/plugins/builtin/world-indices/footer.ts +6 -1
- package/src/plugins/builtin/world-venue-map/client.ts +10 -1
- package/src/plugins/builtin/world-venue-map/index.ts +6 -2
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +48 -7
- package/src/plugins/builtin/world-venue-map/layers.ts +17 -0
- package/src/plugins/builtin/world-venue-map/local-layers.ts +141 -0
- package/src/plugins/builtin/world-venue-map/map-symbols.ts +18 -0
- package/src/plugins/builtin/world-venue-map/map.tsx +4 -2
- package/src/plugins/builtin/world-venue-map/scope.ts +63 -0
- package/src/plugins/builtin/yield-curve/curves.ts +16 -2
- package/src/plugins/builtin/yield-curve/headless.ts +3 -3
- package/src/plugins/bundle.ts +52 -2
- package/src/plugins/catalog-browser.ts +2 -2
- package/src/plugins/catalog-cli.ts +20 -0
- package/src/plugins/host-link.ts +13 -1
- package/src/plugins/installer.ts +15 -4
- package/src/plugins/loader.ts +43 -11
- package/src/plugins/peer-imports.ts +201 -0
- package/src/plugins/peer-retry.ts +26 -29
- package/src/plugins/plugin-process.ts +128 -0
- package/src/plugins/redirection-guard.ts +45 -0
- package/src/react/async-resource.ts +12 -0
- package/src/remote/controller.ts +3 -1
- package/src/remote/endpoint.ts +16 -3
- package/src/renderers/browser/app-services.ts +8 -1
- package/src/renderers/browser/cloud-transport.ts +6 -1
- package/src/renderers/browser/main.tsx +3 -2
- package/src/renderers/cloudflare/http-proxy.ts +7 -123
- package/src/renderers/cloudflare/worker.ts +24 -2
- package/src/renderers/dom/desktop/icons.tsx +2 -0
- package/src/renderers/dom/host/image-surface.tsx +46 -21
- package/src/renderers/dom/styles.css +39 -0
- package/src/renderers/dom/toast-host.tsx +2 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +7 -1
- package/src/renderers/electrobun/bun/desktop/initialization.ts +3 -2
- package/src/renderers/electrobun/bun/desktop/rpc-timing.ts +88 -0
- package/src/renderers/electrobun/bun/desktop/update.ts +20 -4
- package/src/renderers/electrobun/bun/desktop/view-ids.ts +8 -4
- package/src/renderers/electrobun/bun/external-plugins.ts +4 -0
- package/src/renderers/electrobun/bun/window/create.ts +4 -2
- package/src/renderers/electrobun/bun/window/native-timing.ts +48 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +82 -4
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +13 -5
- package/src/renderers/electrobun/view/desktop/window/snapshot.ts +3 -0
- package/src/renderers/electrobun/view/main.tsx +7 -2
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +1 -0
- package/src/renderers/opentui/browser-open.ts +10 -4
- package/src/renderers/opentui/image/surface.tsx +1 -1
- package/src/renderers/opentui/start.tsx +12 -6
- package/src/renderers/opentui/toast-host.tsx +2 -1
- package/src/series/registry.ts +18 -0
- package/src/series/standalone.ts +10 -1
- package/src/series/types.ts +7 -0
- package/src/series/validate.ts +11 -2
- package/src/shares/portable-layout.ts +99 -2
- package/src/sources/gloomberb-cloud/index.ts +28 -5
- package/src/sources/gloomberb-cloud/news.ts +24 -3
- package/src/sources/gloomberb-cloud/normalizers.ts +17 -2
- package/src/sources/provider-errors.ts +26 -3
- package/src/sources/provider-router/history.ts +5 -0
- package/src/sources/provider-router/index.ts +15 -2
- package/src/sources/provider-router/sources.ts +26 -1
- package/src/sync/core-contributors.ts +50 -4
- package/src/telemetry/attention-counts.ts +64 -6
- package/src/telemetry/attention-setting.ts +33 -0
- package/src/telemetry/crash-reports-node.ts +3 -1
- package/src/telemetry/stall-clocks.ts +93 -0
- package/src/telemetry/stall-reports-node.ts +12 -7
- package/src/telemetry/stall-reports.ts +34 -5
- package/src/test-support/preload.ts +9 -0
- package/src/tickers/company-name.ts +19 -0
- package/src/tickers/listing-fate.ts +14 -3
- package/src/tickers/saved-instrument.ts +17 -0
- package/src/tickers/search/home-listing.ts +13 -2
- package/src/tickers/search/index.ts +4 -1
- package/src/tickers/search/types.ts +6 -1
- package/src/time-series/bar-aggregation.ts +7 -1
- package/src/time-series/base-series.ts +3 -3
- package/src/time-series/chart-bounds.ts +1 -1
- package/src/time-series/chart-data.ts +5 -2
- package/src/time-series/chart-seed.ts +1 -1
- package/src/time-series/coin-session-close.ts +211 -0
- package/src/time-series/live-bars.ts +13 -2
- package/src/time-series/live-quotes.ts +1 -1
- package/src/time-series/official-close.ts +159 -0
- package/src/time-series/price-comparison.ts +55 -6
- package/src/time-series/resolve.ts +24 -3
- package/src/time-series/series-presentation.ts +1 -1
- package/src/time-series/studies/formula.ts +205 -0
- package/src/time-series/studies/indicators.ts +299 -0
- package/src/time-series/studies/leverage.ts +75 -0
- package/src/time-series/studies/pair.ts +138 -0
- package/src/time-series/studies/resolve.ts +333 -0
- package/src/time-series/studies/shared.ts +141 -0
- package/src/time-series/studies/units.ts +243 -0
- package/src/time-series/studies/vwap.ts +274 -0
- package/src/types/config.ts +35 -3
- package/src/types/data-provider.ts +23 -0
- package/src/types/financials.ts +22 -0
- package/src/types/headless.ts +42 -3
- package/src/types/plugin.ts +38 -3
- package/src/ui/host.tsx +11 -0
- package/src/ui/toast.tsx +26 -1
- package/src/utils/ascii-text.ts +140 -0
- package/src/utils/cli-output.ts +91 -18
- package/src/utils/concurrency.ts +24 -0
- package/src/utils/exchanges.ts +6 -0
- package/src/utils/external-url.ts +20 -7
- package/src/utils/futures-generic.ts +4 -4
- package/src/utils/http-proxy-upstream.ts +124 -0
- package/src/utils/main-thread-stall.ts +75 -3
- package/src/utils/perf-marks.ts +36 -2
- package/src/utils/private-files.ts +141 -0
- package/src/utils/public-address.ts +99 -0
- package/src/account/upgrade-personalization.ts +0 -57
- package/src/account/upgrade-tickers.ts +0 -124
- package/src/api-client/upgrade-experiment.ts +0 -91
- package/src/plugins/builtin/cloud/browser.tsx +0 -3
- package/src/renderers/electrobun/launcher/preload.ts +0 -13
- package/src/renderers/electrobun/launcher/windows-emulation.ts +0 -50
- package/src/time-series/studies.ts +0 -1628
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
import { isPredictionMarketExchange, isUsListingExchange, parsePublicTickerKey } from "../utils/exchanges";
|
|
2
|
+
|
|
3
|
+
/** US over-the-counter venues: OTC Markets' tiers (OTC, OTCM, OTCQX...), the Pink market (PINX) and the Expert Market (EXPM). */
|
|
4
|
+
const OTC_VENUE = /^(?:OTC|PINX|PINK|PNK|EXPM)/;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A story's tag for a listing: the bare symbol on a US venue (or over the
|
|
8
|
+
* counter) and for a coin, the symbol and its venue elsewhere. PIK on the JSE
|
|
9
|
+
* is Pick n Pay, and bare PIK opens Kidpik on NASDAQ.
|
|
10
|
+
*/
|
|
1
11
|
function newsDisplayTickerSymbol(value: string | null | undefined): string | null {
|
|
2
12
|
const normalized = value?.trim().toUpperCase();
|
|
3
13
|
if (!normalized) return null;
|
|
4
|
-
|
|
14
|
+
const listing = parsePublicTickerKey(normalized);
|
|
15
|
+
const venue = listing.exchange ?? "";
|
|
16
|
+
if (!listing.symbol) return null;
|
|
17
|
+
if (isPredictionMarketExchange(venue)) return normalized;
|
|
18
|
+
return !venue || isUsListingExchange(venue) || OTC_VENUE.test(venue) || venue === "CRYPTO"
|
|
19
|
+
? listing.symbol
|
|
20
|
+
: `${listing.symbol}:${venue}`;
|
|
5
21
|
}
|
|
6
22
|
|
|
7
23
|
export function collectNewsDisplayTickers(
|
|
@@ -16,14 +16,17 @@ function getRuntimePlatform(): NodeJS.Platform {
|
|
|
16
16
|
export interface DesktopNotificationCommand {
|
|
17
17
|
command: string;
|
|
18
18
|
args: string[];
|
|
19
|
+
/** Added to the environment of the process, for text a command line must not carry. */
|
|
20
|
+
env?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface DesktopNotificationRunOptions {
|
|
24
|
+
env?: Record<string, string>;
|
|
25
|
+
onError?: (error: NodeJS.ErrnoException) => void;
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
export interface DesktopNotificationRunner {
|
|
22
|
-
run(
|
|
23
|
-
command: string,
|
|
24
|
-
args: string[],
|
|
25
|
-
handlers?: { onError?: (error: NodeJS.ErrnoException) => void },
|
|
26
|
-
): void;
|
|
29
|
+
run(command: string, args: string[], options?: DesktopNotificationRunOptions): void;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
export interface DesktopNotificationSink {
|
|
@@ -46,8 +49,14 @@ function escapeAppleScriptString(value: string): string {
|
|
|
46
49
|
.replace(/"/g, "\\\"")}"`;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
const WINDOWS_NOTIFICATION_TITLE_ENV = "GLOOM_NOTIFICATION_TITLE";
|
|
53
|
+
const WINDOWS_NOTIFICATION_TEXT_ENV = "GLOOM_NOTIFICATION_TEXT";
|
|
54
|
+
/** The most of a title or a body handed to Windows; a balloon shows far less, and an environment value has a hard limit. */
|
|
55
|
+
const WINDOWS_NOTIFICATION_TEXT_LIMIT = 4_000;
|
|
56
|
+
|
|
57
|
+
/** NUL ends an environment value early, and spawning with one in it fails. */
|
|
58
|
+
function windowsEnvText(value: string): string {
|
|
59
|
+
return value.replaceAll("\0", "").slice(0, WINDOWS_NOTIFICATION_TEXT_LIMIT);
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
function mapLinuxUrgency(type: AppNotificationType | undefined): "low" | "normal" | "critical" {
|
|
@@ -105,6 +114,8 @@ export function buildDesktopNotificationCommand(
|
|
|
105
114
|
DEFAULT_NOTIFICATION_TITLE,
|
|
106
115
|
"--urgency",
|
|
107
116
|
mapLinuxUrgency(notification.type),
|
|
117
|
+
// Text that starts with `-` is the title or the body, not an option.
|
|
118
|
+
"--",
|
|
108
119
|
title,
|
|
109
120
|
...(linuxBody ? [linuxBody] : []),
|
|
110
121
|
],
|
|
@@ -112,14 +123,16 @@ export function buildDesktopNotificationCommand(
|
|
|
112
123
|
}
|
|
113
124
|
|
|
114
125
|
if (platform === "win32") {
|
|
115
|
-
|
|
126
|
+
// The script is the same for every notification. The title and the text
|
|
127
|
+
// reach it in the environment of the process, where PowerShell reads them
|
|
128
|
+
// as plain strings and never as code, whatever characters they hold.
|
|
116
129
|
const script = [
|
|
117
130
|
"Add-Type -AssemblyName System.Windows.Forms;",
|
|
118
131
|
"Add-Type -AssemblyName System.Drawing;",
|
|
119
132
|
"$notify = New-Object System.Windows.Forms.NotifyIcon;",
|
|
120
133
|
`$notify.Icon = [System.Drawing.SystemIcons]::${mapWindowsIcon(notification.type)};`,
|
|
121
|
-
`$notify.BalloonTipTitle = ${
|
|
122
|
-
`$notify.BalloonTipText = ${
|
|
134
|
+
`$notify.BalloonTipTitle = $env:${WINDOWS_NOTIFICATION_TITLE_ENV};`,
|
|
135
|
+
`$notify.BalloonTipText = $env:${WINDOWS_NOTIFICATION_TEXT_ENV};`,
|
|
123
136
|
"$notify.Visible = $true;",
|
|
124
137
|
"$notify.ShowBalloonTip(5000);",
|
|
125
138
|
"Start-Sleep -Seconds 6;",
|
|
@@ -128,6 +141,10 @@ export function buildDesktopNotificationCommand(
|
|
|
128
141
|
return {
|
|
129
142
|
command: "powershell.exe",
|
|
130
143
|
args: ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", script],
|
|
144
|
+
env: {
|
|
145
|
+
[WINDOWS_NOTIFICATION_TITLE_ENV]: windowsEnvText(title),
|
|
146
|
+
[WINDOWS_NOTIFICATION_TEXT_ENV]: windowsEnvText(buildWindowsBody(notification)),
|
|
147
|
+
},
|
|
131
148
|
};
|
|
132
149
|
}
|
|
133
150
|
|
|
@@ -137,19 +154,22 @@ export function buildDesktopNotificationCommand(
|
|
|
137
154
|
function defaultDesktopNotificationRunner(
|
|
138
155
|
command: string,
|
|
139
156
|
args: string[],
|
|
140
|
-
|
|
157
|
+
options?: DesktopNotificationRunOptions,
|
|
141
158
|
): void {
|
|
142
159
|
if (typeof Bun !== "undefined" && typeof Bun.spawn === "function") {
|
|
143
160
|
try {
|
|
144
|
-
const child = Bun.spawn([command, ...args], {
|
|
161
|
+
const child = Bun.spawn([command, ...args], {
|
|
162
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
163
|
+
...(options?.env ? { env: { ...process.env, ...options.env } } : {}),
|
|
164
|
+
});
|
|
145
165
|
child.unref();
|
|
146
166
|
} catch (error) {
|
|
147
|
-
|
|
167
|
+
options?.onError?.(error as NodeJS.ErrnoException);
|
|
148
168
|
}
|
|
149
169
|
return;
|
|
150
170
|
}
|
|
151
171
|
|
|
152
|
-
|
|
172
|
+
options?.onError?.(Object.assign(new Error("Desktop notifications require a native process host."), {
|
|
153
173
|
code: "ENOSYS",
|
|
154
174
|
}) as NodeJS.ErrnoException);
|
|
155
175
|
}
|
|
@@ -203,6 +223,7 @@ export function createDesktopNotifier(
|
|
|
203
223
|
if (desktopCommand && disabledCommand !== desktopCommand.command) {
|
|
204
224
|
let requestFailed = false;
|
|
205
225
|
runner.run(desktopCommand.command, desktopCommand.args, {
|
|
226
|
+
env: desktopCommand.env,
|
|
206
227
|
onError: (error) => {
|
|
207
228
|
requestFailed = true;
|
|
208
229
|
if (error.code === "ENOENT") {
|
|
@@ -157,7 +157,7 @@ export function PublicAnalyticsGroup({
|
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
* The desks chat shows beside your name, once What I Trade is on: pre-filled
|
|
160
|
-
* from your answer to "What do you trade?", coarse words only.
|
|
160
|
+
* from your answer to "What do you trade most?", coarse words only.
|
|
161
161
|
*/
|
|
162
162
|
export function DeskChoiceRow({
|
|
163
163
|
desks,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { PluginModule } from "../plugin-module";
|
|
2
|
-
import { AccountManagementPane } from "./pane";
|
|
3
2
|
|
|
4
3
|
export const accountManagementModule: PluginModule = {
|
|
5
4
|
panes: [{
|
|
@@ -7,8 +6,8 @@ export const accountManagementModule: PluginModule = {
|
|
|
7
6
|
name: "ACM",
|
|
8
7
|
icon: "A",
|
|
9
8
|
personalData: "account",
|
|
10
|
-
component: AccountManagementPane,
|
|
11
|
-
reportFreshness: { status: "not-a-feed", basis: "account data" },
|
|
9
|
+
get component(): typeof import("./pane").AccountManagementPane { const { AccountManagementPane } = require("./pane"); return AccountManagementPane; },
|
|
10
|
+
reportFreshness: { status: "not-a-feed", basis: "account data", local: true },
|
|
12
11
|
defaultPosition: "right",
|
|
13
12
|
defaultMode: "floating",
|
|
14
13
|
defaultFloatingSize: { width: 72, height: 36 },
|
|
@@ -44,7 +44,7 @@ export interface AccountDraft {
|
|
|
44
44
|
showLocalTime: boolean;
|
|
45
45
|
/** Chat shows what you trade: off until you turn it on. */
|
|
46
46
|
showDesks: boolean;
|
|
47
|
-
/** The desks to show, pre-filled from your answer to "What do you trade?". */
|
|
47
|
+
/** The desks to show, pre-filled from your answer to "What do you trade most?". */
|
|
48
48
|
desks: string[];
|
|
49
49
|
weeklyRoundupEnabled: boolean;
|
|
50
50
|
positionAlertsEnabled: boolean;
|
|
@@ -33,6 +33,7 @@ export const ALERT_ADD_FORMS: readonly AlertAddForm[] = [
|
|
|
33
33
|
{ name: "short interest", usage: "<symbol> short interest [increase|decrease] [<percent>%]" },
|
|
34
34
|
{ name: "analyst change", usage: "<symbol> analyst [upgrade|downgrade]" },
|
|
35
35
|
{ name: "hiring move", usage: "<symbol> hiring [accelerating|slowing]" },
|
|
36
|
+
{ name: "IPO", usage: "ipo <company or keyword>" },
|
|
36
37
|
{ name: "perpetual market", usage: "perps <market> <funding|oi|premium|closed-premium> <above|below> <percent>" },
|
|
37
38
|
{ name: "catalyst", usage: "catalyst [type <type> | agency <agency> | country <code>]" },
|
|
38
39
|
{ name: "catalyst", usage: "<symbol> catalyst" },
|
|
@@ -173,6 +174,17 @@ function perpsRule(words: readonly string[]): RuleAddRequest {
|
|
|
173
174
|
return { kind: "rule", event: "perps_threshold", symbol: null, listing: "any", values: { marketId, metric, direction, threshold } };
|
|
174
175
|
}
|
|
175
176
|
|
|
177
|
+
/**
|
|
178
|
+
* `ipo Stripe`, `ipo "Space Exploration"`: a company or keyword on the IPO calendar, followed until its deal
|
|
179
|
+
* is on the calendar, dated, priced and trading. Kept as typed, 2 to 80 characters, as the form takes it.
|
|
180
|
+
*/
|
|
181
|
+
function ipoRule(words: readonly string[]): RuleAddRequest {
|
|
182
|
+
const keyword = words.join(" ").trim().replace(/\s+/g, " ");
|
|
183
|
+
if (!keyword) throw new Error("Name the company or a keyword: gloom alerts add ipo Stripe.");
|
|
184
|
+
if (keyword.length < 2 || keyword.length > 80) throw new Error(`An IPO alert follows a company or keyword of 2 to 80 characters, not "${keyword}": gloom alerts add ipo Stripe.`);
|
|
185
|
+
return { kind: "rule", event: "ipo", symbol: null, listing: "any", values: { keyword } };
|
|
186
|
+
}
|
|
187
|
+
|
|
176
188
|
/** `catalyst`, `catalyst type clinical`, `catalyst agency FDA`, `catalyst country US`: the catalysts followed with no company. */
|
|
177
189
|
function catalystRule(words: readonly string[]): RuleAddRequest {
|
|
178
190
|
if (words.length === 0) return { kind: "rule", event: "catalyst-watched", symbol: null, listing: "any", values: {} };
|
|
@@ -192,7 +204,7 @@ function catalystRule(words: readonly string[]): RuleAddRequest {
|
|
|
192
204
|
* The forms of `alerts add` for the rest of what Add Event Alert offers:
|
|
193
205
|
* 52-week range, unusual volume, filings, insider trades, short interest,
|
|
194
206
|
* analyst changes and hiring on a symbol, perpetual markets, catalysts,
|
|
195
|
-
* Congress trades and 13F filings. Null for any other words; throws, naming
|
|
207
|
+
* IPOs, Congress trades and 13F filings. Null for any other words; throws, naming
|
|
196
208
|
* the form, when one of them is mistyped. A symbol that spells a form word
|
|
197
209
|
* (`PERPS above 10`) is still a price alert.
|
|
198
210
|
*/
|
|
@@ -202,6 +214,8 @@ export function parseRuleAddArgs(args: readonly string[]): RuleAddRequest | null
|
|
|
202
214
|
if (!CONDITION_WORDS.has(word(rest[0]))) {
|
|
203
215
|
if (lead === "perps" || lead === "perp") return perpsRule(rest);
|
|
204
216
|
if (lead === "catalyst" || lead === "catalysts") return catalystRule(rest);
|
|
217
|
+
// The IPO ETF keeps its other alerts written with its venue (IPO:NYSEARCA 52-week high).
|
|
218
|
+
if (lead === "ipo") return ipoRule(rest);
|
|
205
219
|
if (lead === "congress") {
|
|
206
220
|
const member = rest.join(" ").trim();
|
|
207
221
|
return { kind: "rule", event: member ? "congress-member" : "congress-watched", symbol: null, listing: "any", values: member ? { value: member } : {} };
|
|
@@ -17,6 +17,7 @@ import { usePluginAppActions, usePluginConfigState, usePluginState } from "../..
|
|
|
17
17
|
import {
|
|
18
18
|
CALENDAR_ALERTS_KEY,
|
|
19
19
|
EVENT_ALERTS_KEY,
|
|
20
|
+
IPO_ALERTS_KEY,
|
|
20
21
|
IV_LEVEL_ALERTS_KEY,
|
|
21
22
|
eventAlertStoreKey,
|
|
22
23
|
eventAlertTarget,
|
|
@@ -54,12 +55,13 @@ const columnsFor = (width: number, lastCheck: boolean, needsSignIn: boolean): Da
|
|
|
54
55
|
export function EventAlertsPane({ focused, width, height }: PaneProps) {
|
|
55
56
|
const [catalystStatus] = usePluginConfigState<string>(CATALYST_POLL_STATUS, "Catalyst alerts check every five minutes while the app is open");
|
|
56
57
|
const [json, setJson] = usePluginConfigState<string>(EVENT_ALERTS_KEY, "[]");
|
|
57
|
-
// IV levels
|
|
58
|
+
// IV levels, calendar events and IPOs are kept in their own lists, which released versions never read.
|
|
58
59
|
const [ivJson, setIvJson] = usePluginConfigState<string>(IV_LEVEL_ALERTS_KEY, "[]");
|
|
59
60
|
const [calendarJson, setCalendarJson] = usePluginConfigState<string>(CALENDAR_ALERTS_KEY, "[]");
|
|
61
|
+
const [ipoJson, setIpoJson] = usePluginConfigState<string>(IPO_ALERTS_KEY, "[]");
|
|
60
62
|
const { rules, error } = useMemo(
|
|
61
|
-
() => readEventAlertStores((key) => key === IV_LEVEL_ALERTS_KEY ? ivJson : key === CALENDAR_ALERTS_KEY ? calendarJson : json),
|
|
62
|
-
[json, ivJson, calendarJson],
|
|
63
|
+
() => readEventAlertStores((key) => key === IV_LEVEL_ALERTS_KEY ? ivJson : key === CALENDAR_ALERTS_KEY ? calendarJson : key === IPO_ALERTS_KEY ? ipoJson : json),
|
|
64
|
+
[json, ivJson, calendarJson, ipoJson],
|
|
63
65
|
);
|
|
64
66
|
// Their readings stay on this device.
|
|
65
67
|
const [savedChecks] = usePluginState<unknown>(IV_LEVEL_CHECKS_KEY, {});
|
|
@@ -70,9 +72,9 @@ export function EventAlertsPane({ focused, width, height }: PaneProps) {
|
|
|
70
72
|
const updateRules = useCallback(
|
|
71
73
|
(rule: EventAlertRule, update: (rules: EventAlertRule[]) => EventAlertRule[]) => {
|
|
72
74
|
const key = eventAlertStoreKey(rule);
|
|
73
|
-
(key === IV_LEVEL_ALERTS_KEY ? setIvJson : key === CALENDAR_ALERTS_KEY ? setCalendarJson : setJson)((current) => updateEventAlerts(current, update));
|
|
75
|
+
(key === IV_LEVEL_ALERTS_KEY ? setIvJson : key === CALENDAR_ALERTS_KEY ? setCalendarJson : key === IPO_ALERTS_KEY ? setIpoJson : setJson)((current) => updateEventAlerts(current, update));
|
|
74
76
|
},
|
|
75
|
-
[setJson, setIvJson, setCalendarJson],
|
|
77
|
+
[setJson, setIvJson, setCalendarJson, setIpoJson],
|
|
76
78
|
);
|
|
77
79
|
const [selected, setSelected] = useState(0);
|
|
78
80
|
const [sort, setSort] = useState<{ columnId: string; direction: SortDirection }>({ columnId: "created", direction: "desc" });
|
|
@@ -16,14 +16,22 @@ export const IV_LEVEL_ALERTS_KEY = "ivLevelAlerts";
|
|
|
16
16
|
* every version reads.
|
|
17
17
|
*/
|
|
18
18
|
export const CALENDAR_ALERTS_KEY = "calendarAlerts";
|
|
19
|
+
/**
|
|
20
|
+
* IPO rules, kept apart for the same reason. Gloom Cloud checks them, so it
|
|
21
|
+
* reads this list beside `eventAlerts`.
|
|
22
|
+
*/
|
|
23
|
+
export const IPO_ALERTS_KEY = "ipoAlerts";
|
|
19
24
|
export const MAX_EVENT_ALERTS = 40;
|
|
20
25
|
|
|
21
26
|
/** The config key a rule is kept under. */
|
|
22
27
|
export const eventAlertStoreKey = (rule: Pick<EventAlertRule, "kind">) =>
|
|
23
|
-
rule.kind === "iv_level" ? IV_LEVEL_ALERTS_KEY
|
|
28
|
+
rule.kind === "iv_level" ? IV_LEVEL_ALERTS_KEY
|
|
29
|
+
: rule.kind === "calendar_event" ? CALENDAR_ALERTS_KEY
|
|
30
|
+
: rule.kind === "ipo" ? IPO_ALERTS_KEY
|
|
31
|
+
: EVENT_ALERTS_KEY;
|
|
24
32
|
|
|
25
33
|
/** Every config key event alerts are kept under. */
|
|
26
|
-
export const EVENT_ALERT_STORE_KEYS = [EVENT_ALERTS_KEY, IV_LEVEL_ALERTS_KEY, CALENDAR_ALERTS_KEY] as const;
|
|
34
|
+
export const EVENT_ALERT_STORE_KEYS = [EVENT_ALERTS_KEY, IV_LEVEL_ALERTS_KEY, CALENDAR_ALERTS_KEY, IPO_ALERTS_KEY] as const;
|
|
27
35
|
type EventAlertStoreKey = (typeof EVENT_ALERT_STORE_KEYS)[number];
|
|
28
36
|
|
|
29
37
|
export interface EventAlertRule {
|
|
@@ -38,9 +38,8 @@ import {
|
|
|
38
38
|
parseAlertCommandValues,
|
|
39
39
|
parseAlertShortcutValues,
|
|
40
40
|
} from "./command";
|
|
41
|
-
import { POLL_INTERVAL_MS, POLL_SECONDS_KEY } from "./constants";
|
|
41
|
+
import { ALERTS_PLUGIN_ID, POLL_INTERVAL_MS, POLL_SECONDS_KEY } from "./constants";
|
|
42
42
|
import { alertHistoryLockNote, alertsHeadless } from "./headless";
|
|
43
|
-
import { AlertsPane } from "./pane";
|
|
44
43
|
import { alertsCliCommand } from "./cli";
|
|
45
44
|
import {
|
|
46
45
|
createQuoteErrorMessage,
|
|
@@ -81,7 +80,7 @@ function slashSpellsListing(symbol: string): boolean {
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
export const alertsPlugin: GloomPlugin = {
|
|
84
|
-
id:
|
|
83
|
+
id: ALERTS_PLUGIN_ID,
|
|
85
84
|
name: "Alerts",
|
|
86
85
|
version: "1.0.0",
|
|
87
86
|
description: "Price, valuation, daily technical and event alerts",
|
|
@@ -278,11 +277,12 @@ export const alertsPlugin: GloomPlugin = {
|
|
|
278
277
|
ctx.registerCommand({
|
|
279
278
|
id: "set-event-alert",
|
|
280
279
|
label: "Add Event Alert",
|
|
281
|
-
description: "Create an alert before earnings, CPI or FOMC, when earnings results are out, or for filings, news, IV levels, hiring and market moves",
|
|
280
|
+
description: "Create an alert before earnings, CPI or FOMC, when earnings results are out, or for filings, news, IPOs, IV levels, hiring and market moves",
|
|
282
281
|
keywords: [
|
|
283
282
|
"alert", "event", "congress", "13f", "fund", "member", "follow", "earnings", "cpi", "fomc", "days before",
|
|
284
283
|
"filing", "filings", "sec", "8-k", "news", "keyword", "analyst", "52-week", "unusual volume", "volume",
|
|
285
284
|
"short interest", "insider", "catalyst", "implied volatility", "iv spike", "iv level", "risk reversal", "skew", "options flow", "perps", "funding", "hiring", "jobs",
|
|
285
|
+
"ipo", "going public", "listing",
|
|
286
286
|
],
|
|
287
287
|
category: "data",
|
|
288
288
|
wizardLayout: "form",
|
|
@@ -463,7 +463,7 @@ export const alertsPlugin: GloomPlugin = {
|
|
|
463
463
|
reportLockNote: alertHistoryLockNote,
|
|
464
464
|
name: "Alerts",
|
|
465
465
|
icon: "A",
|
|
466
|
-
component: AlertsPane,
|
|
466
|
+
get component(): typeof import("./pane").AlertsPane { const { AlertsPane } = require("./pane"); return AlertsPane; },
|
|
467
467
|
defaultPosition: "right",
|
|
468
468
|
defaultMode: "floating",
|
|
469
469
|
defaultFloatingSize: { width: 82, height: 20 },
|
|
@@ -6,7 +6,7 @@ import type { EventAlertRule } from "./events";
|
|
|
6
6
|
export const MACRO_EVENT_NAMES: Record<MacroAlertEvent, string> = { cpi: "CPI release", fomc: "FOMC decision" };
|
|
7
7
|
/** CPI and FOMC and any other calendar release are one kind of alert to the reader, whichever list keeps the rule. */
|
|
8
8
|
export const RESEARCH_LABELS: Record<ResearchAlertKind, string> = {
|
|
9
|
-
perps_threshold: "Perpetual threshold", earnings_date: "Earnings date", macro_event: "Macro event", calendar_event: "Macro event", filing_type: "SEC filing", news_keyword: "News keyword", analyst_change: "Analyst change", fifty_two_week: "52-week range", unusual_volume: "Unusual volume", short_interest_change: "Short interest", insider_trade: "Insider trade", iv_spike: "IV spike", iv_level: "IV level", options_flow: "Options flow", hiring_move: "Hiring move",
|
|
9
|
+
perps_threshold: "Perpetual threshold", earnings_date: "Earnings date", macro_event: "Macro event", calendar_event: "Macro event", ipo: "IPO", filing_type: "SEC filing", news_keyword: "News keyword", analyst_change: "Analyst change", fifty_two_week: "52-week range", unusual_volume: "Unusual volume", short_interest_change: "Short interest", insider_trade: "Insider trade", iv_spike: "IV spike", iv_level: "IV level", options_flow: "Options flow", hiring_move: "Hiring move",
|
|
10
10
|
};
|
|
11
11
|
/** What an IV level rule follows, as the form, a list and a notification name it. */
|
|
12
12
|
export const IV_LEVEL_NAMES: Record<IvLevelMetric, string> = { atm: "30d ATM IV", rr: "30d 25D RR" };
|
|
@@ -46,6 +46,8 @@ export const researchWizardFields: Field[] = RESEARCH_FORM_KINDS.flatMap(kind =>
|
|
|
46
46
|
: kind === "macro_event" ? [{key:"event", label:"Release", type:"select", defaultValue:"cpi", options:MACRO_ALERT_EVENTS.map((value) => ({value, label:MACRO_EVENT_NAMES[value]}))}]
|
|
47
47
|
// HIRE covers listings worldwide; a non-US one is written with its venue.
|
|
48
48
|
: kind === "hiring_move" ? [{key:"symbol", label:"Symbol", type:"text", placeholder:"RIVN or ADYEN:AMS", required:true}]
|
|
49
|
+
// A deal on the IPO calendar has no listing to name yet: it is followed by its name.
|
|
50
|
+
: kind === "ipo" ? [{key:"keyword", label:"Company or keyword", type:"text", placeholder:"Stripe", required:true}]
|
|
49
51
|
: [{key:"symbol",label:kind === "news_keyword" ? "Symbol (optional)" : kind === "options_flow" ? "Symbol (blank: portfolio and watchlists)" : "Symbol",type:"text",placeholder:"AAPL", required:kind !== "news_keyword" && kind !== "options_flow"},
|
|
50
52
|
{key:"exchange",label:"US exchange",type:"select",defaultValue:"US",options:choices(["US","NASDAQ","NYSE","ARCA","AMEX","BATS","OTC"])}];
|
|
51
53
|
if (kind === "earnings_date") {
|
|
@@ -92,6 +94,7 @@ export function createResearchAlert(kind: string, values: Record<string,string>,
|
|
|
92
94
|
if (!value) throw new Error(kind === "options_flow"
|
|
93
95
|
? "Check the symbol and US exchange. The minimum premium is $50,000."
|
|
94
96
|
: kind === "hiring_move" ? "Check the symbol. Write a non-US listing with its exchange, as ADYEN:AMS."
|
|
97
|
+
: kind === "ipo" ? "Name a company or keyword of 2 to 80 characters, such as Stripe."
|
|
95
98
|
: kind === "iv_level"
|
|
96
99
|
? "Check the symbol and US exchange. An ATM IV level is 1 to 500 (%), a risk reversal -50 to 50 (vol pts)."
|
|
97
100
|
: kind === "iv_spike"
|
|
@@ -142,6 +145,7 @@ export function researchAlertDescription(rule: EventAlertRule): string {
|
|
|
142
145
|
case "news_keyword": return `${symbol} · ${config.keyword}`;
|
|
143
146
|
case "analyst_change": case "insider_trade": return `${symbol} · ${config.direction}`;
|
|
144
147
|
case "hiring_move": return `${symbol} · ${config.direction === "either" ? "accelerating or slowing" : config.direction}`;
|
|
148
|
+
case "ipo": return config.keyword ?? "";
|
|
145
149
|
case "fifty_two_week": return `${symbol} · 52w ${config.direction}`;
|
|
146
150
|
case "unusual_volume": return `${symbol} · ≥${config.threshold}× 20d`;
|
|
147
151
|
case "short_interest_change": return `${symbol} · ${config.direction} ≥${config.threshold}%`;
|
|
@@ -15,6 +15,7 @@ const RESEARCH_ALERT_KINDS = [
|
|
|
15
15
|
"options_flow",
|
|
16
16
|
"perps_threshold",
|
|
17
17
|
"hiring_move",
|
|
18
|
+
"ipo",
|
|
18
19
|
] as const
|
|
19
20
|
export type ResearchAlertKind = (typeof RESEARCH_ALERT_KINDS)[number]
|
|
20
21
|
export interface ResearchAlertConfig {
|
|
@@ -162,6 +163,8 @@ export function normalizeResearchRule(
|
|
|
162
163
|
: ""
|
|
163
164
|
if (!/^[A-Z0-9][A-Z0-9.:-]{0,31}$/.test(symbol)) return null
|
|
164
165
|
result.symbol = symbol
|
|
166
|
+
} else if (kind === "ipo") {
|
|
167
|
+
// A company or keyword looked for on the IPO calendar: no listing yet, so no symbol.
|
|
165
168
|
} else if (
|
|
166
169
|
(kind !== "news_keyword" && kind !== "options_flow") ||
|
|
167
170
|
input.symbol
|
|
@@ -253,6 +256,21 @@ export function normalizeResearchRule(
|
|
|
253
256
|
result.keyword = keyword
|
|
254
257
|
break
|
|
255
258
|
}
|
|
259
|
+
case "ipo": {
|
|
260
|
+
// Kept as typed, for the lists; Gloom Cloud matches it in any case.
|
|
261
|
+
const keyword =
|
|
262
|
+
typeof input.keyword === "string"
|
|
263
|
+
? input.keyword.trim().replace(/\s+/g, " ")
|
|
264
|
+
: ""
|
|
265
|
+
if (
|
|
266
|
+
keyword.length < 2 ||
|
|
267
|
+
keyword.length > 80 ||
|
|
268
|
+
/[\u0000-\u001f]/.test(keyword)
|
|
269
|
+
)
|
|
270
|
+
return null
|
|
271
|
+
result.keyword = keyword
|
|
272
|
+
break
|
|
273
|
+
}
|
|
256
274
|
case "analyst_change":
|
|
257
275
|
direction(["any", "upgrade", "downgrade"], "any")
|
|
258
276
|
break
|
|
@@ -36,7 +36,8 @@ const pane = (templateId: string, options?: PaneTemplateCreateOptions): AlertTar
|
|
|
36
36
|
* The one map from what an alert follows to what it opens, for every rule kind and every delivered alert:
|
|
37
37
|
* a perpetual opens PERP on its market; a dated event the pane its date comes from (ERN, CPI, WIRP, ECO); catalyst,
|
|
38
38
|
* Congress and 13F rules their calendar or list, on the company or fund they name; an IV level the symbol's
|
|
39
|
-
* OVDV, whose fits it reads; a hiring move HIRE on the company;
|
|
39
|
+
* OVDV, whose fits it reads; a hiring move HIRE on the company; an IPO the IPO calendar searched for its
|
|
40
|
+
* company or keyword; any other rule on a security
|
|
40
41
|
* that listing's DES. A rule on no security opens the pane it watches (SRCH for a news keyword, FLOW for flow
|
|
41
42
|
* on the user's lists, FIRST for breaking news). Null when there is nothing to open.
|
|
42
43
|
*/
|
|
@@ -58,6 +59,8 @@ export function alertTarget(subject: AlertSubject): AlertTarget | null {
|
|
|
58
59
|
case "breaking_news": if (!symbol) return pane("news-breaking-pane"); break;
|
|
59
60
|
// A hiring move opens HIRE on the company, where its Moves tab says why.
|
|
60
61
|
case "hiring_move": return symbol ? pane("hiring-pane", { symbol }) : null;
|
|
62
|
+
// An IPO opens the calendar searched for what the rule follows, its deal there whether it trades yet or not.
|
|
63
|
+
case "ipo": return pane("ipo-calendar-pane", subject.keyword ? { arg: subject.keyword } : undefined);
|
|
61
64
|
}
|
|
62
65
|
return symbol ? { kind: "description", symbol, ...(subject.exchange ? { exchange: subject.exchange } : {}) } : null;
|
|
63
66
|
}
|
|
@@ -6,7 +6,7 @@ export const attentionHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
6
6
|
options: [{ key: "tab", type: "enum", values: ATTENTION_TABS.map(({ value }) => ({ value })), defaultValue: "ranking", description: "Rankings, abnormal attention, groups, history or evidence." },
|
|
7
7
|
{ key: "window", type: "enum", values: WINDOWS.map(({ value }) => ({ value })), defaultValue: "now", description: "Latest completed publication hour, UTC day or trailing week." }],
|
|
8
8
|
discovery: { aliases: ["ATTN"], dataRequirements: ["Privacy-qualified published research counts"],
|
|
9
|
-
limitations: ["Pro dataset with three-row preview and latest history point.", "Suppressed hours are absent, never zero.", "
|
|
9
|
+
limitations: ["Pro dataset with three-row preview and latest history point.", "Suppressed hours are absent, never zero.", "Counts come from signed-in Gloom users and are not representative of all investors."] },
|
|
10
10
|
describe: "Gloom research attention (Pro)",
|
|
11
11
|
async load(args, ctx) {
|
|
12
12
|
const argument = Array.isArray(args.argument) ? args.argument.join(" ") : args.argument;
|
|
@@ -2,14 +2,12 @@ import type { PluginModule } from "../plugin-module";
|
|
|
2
2
|
import { attentionCache } from "./client";
|
|
3
3
|
import { attentionWindow } from "./model";
|
|
4
4
|
import { attentionHeadless } from "./headless";
|
|
5
|
-
import { TrendingPane } from "./trending";
|
|
6
|
-
import { AttentionPane } from "./pane";
|
|
7
5
|
import { ATTENTION_SERIES } from "./series";
|
|
8
6
|
import { ATTENTION_LISTED } from "./listing";
|
|
9
7
|
export const attentionModule: PluginModule = {
|
|
10
|
-
panes: [{ id: "attention", name: "Research Attention", icon: "A", component: AttentionPane, defaultPosition: "right", defaultMode: "floating",
|
|
8
|
+
panes: [{ id: "attention", name: "Research Attention", icon: "A", get component(): typeof import("./pane").AttentionPane { const { AttentionPane } = require("./pane"); return AttentionPane; }, defaultPosition: "right", defaultMode: "floating",
|
|
11
9
|
defaultFloatingSize: { width: 126, height: 32 }, tableExport: true, headless: attentionHeadless },
|
|
12
|
-
{ id: "attention-trending", reportFreshness: { status: "not-a-feed", basis: "hourly publication" }, name: "Gloom Trending", icon: "A", component: TrendingPane, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 58, height: 12 } }],
|
|
10
|
+
{ id: "attention-trending", reportFreshness: { status: "not-a-feed", basis: "hourly publication" }, name: "Gloom Trending", icon: "A", get component(): typeof import("./trending").TrendingPane { const { TrendingPane } = require("./trending"); return TrendingPane; }, defaultPosition: "right", defaultMode: "floating", defaultFloatingSize: { width: 58, height: 12 } }],
|
|
13
11
|
paneTemplates: [{ id: "attention-pane", paneId: "attention", label: "Research Attention", listed: ATTENTION_LISTED,
|
|
14
12
|
description: "Pro research attention: rankings, abnormal activity, sectors, countries and privacy-qualified hourly history.",
|
|
15
13
|
keywords: ["attention", "trending", "research", "activity"], shortcut: { prefix: "ATTN", argKind: "text", argPlaceholder: "TICKER", argOptional: true },
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* search, the plugin directory and chat suggestions, and its two screener
|
|
4
4
|
* fields (ATTN HRS, ATTN Z) in the EQS field and metric pickers.
|
|
5
5
|
*
|
|
6
|
-
* Research attention publishes an hour only once enough
|
|
6
|
+
* Research attention publishes an hour only once enough contributing users
|
|
7
7
|
* researched in it, and it has published nothing for weeks, so ATTN stays
|
|
8
8
|
* unlisted until it does. Typing ATTN still opens it, a screen that already
|
|
9
9
|
* uses its fields keeps them, and the Attention Counts setting and its
|
|
@@ -14,7 +14,7 @@ export const ATTENTION_SERIES: readonly SeriesDefinition[] = [{
|
|
|
14
14
|
frequency: "intraday",
|
|
15
15
|
group: "Alternative data",
|
|
16
16
|
tags: ["attention", "research", "trending", "researcher-hours"],
|
|
17
|
-
description: "Rounded researcher-hours
|
|
17
|
+
description: "Rounded researcher-hours Gloom users spent on the ticker in each published hour, as ATTN charts them; an hour below the privacy threshold is a gap. Needs Pro.",
|
|
18
18
|
input: "ticker",
|
|
19
19
|
load: async ({ ticker }) => {
|
|
20
20
|
const data = await fetchAttention("now", ticker!);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { PluginModule } from "../plugin-module";
|
|
2
2
|
import { awardDetailCache, awardsCache } from "./client";
|
|
3
3
|
import { awardsHeadless } from "./headless";
|
|
4
|
-
import { AwardsPane } from "./pane";
|
|
5
4
|
import { AWARD_SERIES } from "./series";
|
|
6
5
|
|
|
7
6
|
export const awardsModule: PluginModule = {
|
|
8
7
|
series: AWARD_SERIES,
|
|
9
8
|
setup(ctx) { awardsCache.attach(ctx.persistence); awardDetailCache.attach(ctx.persistence); },
|
|
10
9
|
dispose() { awardsCache.reset(); awardDetailCache.reset(); },
|
|
11
|
-
panes: [{ id: "awards", name: "Government Awards", icon: "A", component: AwardsPane, defaultPosition: "right", defaultMode: "floating",
|
|
10
|
+
panes: [{ id: "awards", name: "Government Awards", icon: "A", get component(): typeof import("./pane").AwardsPane { const { AwardsPane } = require("./pane"); return AwardsPane; }, defaultPosition: "right", defaultMode: "floating",
|
|
12
11
|
defaultFloatingSize: { width: 132, height: 34 }, tickerFollower: true, instruments: ["equity"], tableExport: true, headless: awardsHeadless,
|
|
13
12
|
quickSettings: [{ type: "toggle", key: "awardAlerts", icon: "zap", label: "New awards above 1% of annual revenue" }],
|
|
14
13
|
settings: { title: "Government awards", fields: [{ type: "toggle", key: "awardAlerts", label: "New awards above 1% of annual revenue", description: "Notify while this pane is visible. Starts with the next refresh; historical backfills are excluded." }] } }],
|
|
@@ -62,6 +62,7 @@ export function toBacktestBars(
|
|
|
62
62
|
low: isFiniteNumber(point.low) && point.low > 0 ? point.low : null,
|
|
63
63
|
close: point.close,
|
|
64
64
|
...(point.partial === true ? { partial: true as const } : {}),
|
|
65
|
+
...(point.unsettled === true ? { unsettled: true as const } : {}),
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
const bars = [...byDate.values()].sort((a, b) => a.date.localeCompare(b.date));
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { PluginModule } from "../plugin-module";
|
|
2
2
|
import { createTickerSurfacePaneTemplate } from "../shared/ticker-surface";
|
|
3
3
|
import { backtestHeadless } from "./headless";
|
|
4
|
-
import { BacktestPane } from "./pane";
|
|
5
4
|
import { BACKTEST_PRESETS, LOOKBACK_OPTIONS } from "./presets";
|
|
6
5
|
import { BACKTEST_FRESHNESS } from "./report";
|
|
7
6
|
|
|
8
7
|
export const backtestModule: PluginModule = {
|
|
9
8
|
panes: [{
|
|
10
|
-
id: "backtest", name: "Backtest", icon: "B", component: BacktestPane,
|
|
9
|
+
id: "backtest", name: "Backtest", icon: "B", get component(): typeof import("./pane").BacktestPane { const { BacktestPane } = require("./pane"); return BacktestPane; },
|
|
11
10
|
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 120, height: 34 },
|
|
12
11
|
tableExport: true,
|
|
13
12
|
// A capture is dated as `fn BT` dates the run, by its last session, never by the ticker's live quote.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ema, rsi, sma, type IndexedValue } from "../../../time-series/studies";
|
|
1
|
+
import { ema, rsi, sma, type IndexedValue } from "../../../time-series/studies/indicators";
|
|
2
2
|
|
|
3
3
|
/** One daily bar as the rules see it. Open is optional; fills fall back to the close. */
|
|
4
4
|
export interface BacktestBar {
|
|
@@ -9,6 +9,8 @@ export interface BacktestBar {
|
|
|
9
9
|
close: number;
|
|
10
10
|
/** The bar's day had not ended when it was served: its close is the latest price. */
|
|
11
11
|
partial?: true;
|
|
12
|
+
/** A future's session that closed before its settlement was in: its close is the last trade. */
|
|
13
|
+
unsettled?: true;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export type Operand =
|
|
@@ -4,6 +4,7 @@ import type { BacktestHistory } from "./client";
|
|
|
4
4
|
import { runBacktest, type BacktestOptions, type BacktestResult } from "./engine";
|
|
5
5
|
import { delistingLabel } from "../../../market-data/quotes/delisting";
|
|
6
6
|
import type { BacktestBar, Rule } from "./rules";
|
|
7
|
+
import { formingBarsState, isFormingBar } from "../shared/forming-bars";
|
|
7
8
|
|
|
8
9
|
/** Which served sessions a run tests. */
|
|
9
10
|
export interface BacktestWindowOptions {
|
|
@@ -62,17 +63,17 @@ export function backtestWindow(
|
|
|
62
63
|
if (history.undatedSkipped > 0) {
|
|
63
64
|
warnings.push(`${history.undatedSkipped} price ${history.undatedSkipped === 1 ? "point" : "points"} without a date ${history.undatedSkipped === 1 ? "was" : "were"} left out.`);
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
const
|
|
66
|
+
// A future's session that has not settled moves too: its close becomes the settlement.
|
|
67
|
+
const forming = inWindow.filter(isFormingBar);
|
|
68
|
+
const bars = forming.length === 0 || options.includePartial ? inWindow : inWindow.filter((bar) => !isFormingBar(bar));
|
|
67
69
|
const through = bars.at(-1)?.date;
|
|
68
70
|
if (forming.length > 0) {
|
|
69
|
-
const dates = listDates(forming.map((bar) => bar.date))
|
|
71
|
+
const dates = `${listDates(forming.map((bar) => bar.date))} ${formingBarsState(forming)}`;
|
|
70
72
|
warnings.push(options.includePartial
|
|
71
|
-
? `${dates}
|
|
72
|
-
: `${dates} ${
|
|
73
|
-
+ `${through ? `: the test runs through ${through}, the last complete session` : ""}.`);
|
|
73
|
+
? `${dates} and kept: the last close is ${forming.every((bar) => bar.partial) ? "the latest price" : "not final"}, so the results move until the session ends.`
|
|
74
|
+
: `${dates} and left out${through ? `: the test runs through ${through}, the last complete session` : ""}.`);
|
|
74
75
|
}
|
|
75
|
-
const newestComplete = history.bars.findLast((bar) => !bar
|
|
76
|
+
const newestComplete = history.bars.findLast((bar) => !isFormingBar(bar))?.date;
|
|
76
77
|
const delisting = history.delisting;
|
|
77
78
|
if (delisting) {
|
|
78
79
|
const listing = `${history.symbol ? `${parsePublicTickerKey(history.symbol).symbol}: ` : ""}${delistingLabel(delisting)}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, type Ref } from "react";
|
|
2
|
-
import { Box, ScrollBox, Text, TextAttributes, type BoxRenderable, type ScrollBoxRenderable } from "../../../ui";
|
|
2
|
+
import { Box, ScrollBox, Text, TextAttributes, useNativeRenderer, useUiCapabilities, type BoxRenderable, type ScrollBoxRenderable } from "../../../ui";
|
|
3
3
|
import { Button, FieldLabel, NumberField, SectionHeading, SegmentedControl, TextField, useFieldRing } from "../../../components";
|
|
4
4
|
import { afterLayout, revealInScrollBox } from "../../../components/ui/reveal-in-scroll-box";
|
|
5
5
|
import {
|
|
@@ -294,10 +294,23 @@ export function BrokerDetailContent({
|
|
|
294
294
|
// Enter saves from any field, so what stopped the save can be below the
|
|
295
295
|
// fold; bring it and the buttons into view.
|
|
296
296
|
const actionsRef = useRef<BoxRenderable | null>(null);
|
|
297
|
+
const desktop = useUiCapabilities().nativePaneChrome === true;
|
|
298
|
+
const nativeRenderer = useNativeRenderer();
|
|
297
299
|
useEffect(() => {
|
|
298
300
|
if (!editError) return;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
+
const reveal = () => revealInScrollBox(scrollRef.current, actionsRef.current);
|
|
302
|
+
if (desktop) return afterLayout(reveal);
|
|
303
|
+
// The terminal lays the error line out only when it draws a frame, which
|
|
304
|
+
// can come after a 0 ms timer: measured before it, the buttons are one row
|
|
305
|
+
// short and the error pushes Save back below the fold.
|
|
306
|
+
const onFrame = () => {
|
|
307
|
+
nativeRenderer.off("frame", onFrame);
|
|
308
|
+
reveal();
|
|
309
|
+
};
|
|
310
|
+
nativeRenderer.on("frame", onFrame);
|
|
311
|
+
nativeRenderer.requestRender();
|
|
312
|
+
return () => nativeRenderer.off("frame", onFrame);
|
|
313
|
+
}, [desktop, editError, nativeRenderer]);
|
|
301
314
|
|
|
302
315
|
if (!row) return <Box flexGrow={1} />;
|
|
303
316
|
|
|
@@ -365,7 +365,7 @@ export const brokerManagerModule: PluginModule = {
|
|
|
365
365
|
personalData: "account",
|
|
366
366
|
icon: "B",
|
|
367
367
|
component: BrokersPane,
|
|
368
|
-
reportFreshness: { status: "not-a-feed", basis: "broker connections" },
|
|
368
|
+
reportFreshness: { status: "not-a-feed", basis: "broker connections", local: true },
|
|
369
369
|
defaultPosition: "right",
|
|
370
370
|
defaultMode: "floating",
|
|
371
371
|
defaultFloatingSize: { width: 92, height: 24 },
|