@vninvestcharts/widget 0.0.0-stage → 0.2.0
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/LICENSE +201 -0
- package/NOTICE.md +83 -0
- package/README.md +851 -3
- package/dist/AlertsModal-WKEUDTUZ.js +2 -0
- package/dist/ConnectedTradingPanel-KWJMIKTN.css +2 -0
- package/dist/ConnectedTradingPanel-XDKMOQY5.js +2 -0
- package/dist/PineEditorPanel-AUXB4FD3.js +2 -0
- package/dist/PineEditorPanel-V6YN2OTU.css +2 -0
- package/dist/RightSidebarDockHost-6FPZ6EKV.css +2 -0
- package/dist/RightSidebarDockHost-OBFXKSIY.js +2 -0
- package/dist/StrategyTesterPanel-6IUTS2P4.js +2 -0
- package/dist/StrategyTesterPanel-LEWEUMXP.css +2 -0
- package/dist/VolumeProfileWorker-UREKVPUE.js +189 -0
- package/dist/adapters/index.cjs +2532 -0
- package/dist/adapters/index.d.mts +673 -0
- package/dist/adapters/index.d.ts +673 -0
- package/dist/adapters/index.js +2521 -0
- package/dist/adapters/index.umd.js +2535 -0
- package/dist/chunk-5T6DGB3V.js +2 -0
- package/dist/chunk-66JBEGR3.js +4 -0
- package/dist/chunk-6D7DVBIK.js +2 -0
- package/dist/chunk-76E7CKUD.js +2 -0
- package/dist/chunk-AKWVXRQ6.js +2 -0
- package/dist/chunk-FHHSTO6Z.js +2 -0
- package/dist/chunk-HPL723JA.js +2 -0
- package/dist/chunk-NVGTF73S.js +2 -0
- package/dist/chunk-PNIB4OM3.js +2 -0
- package/dist/chunk-UKJ5AKQX.js +595 -0
- package/dist/chunk-UYJTX3SD.js +2 -0
- package/dist/combined.css +3068 -0
- package/dist/css-modules-manifest.json +297 -0
- package/dist/dist-Y6PZ2RN3.js +12 -0
- package/dist/drawing/index.cjs +53 -0
- package/dist/drawing/index.d.mts +2 -0
- package/dist/drawing/index.d.ts +2 -0
- package/dist/drawing/index.js +2 -0
- package/dist/drawing/index.umd.js +54 -0
- package/dist/dts/drawing-shim.d.ts +3 -0
- package/dist/dts/index.d.ts +31 -0
- package/dist/dts/lib/Chart.d.ts +31 -0
- package/dist/dts/lib/ChartContext.d.ts +10 -0
- package/dist/dts/lib/EventCapture.d.ts +3 -0
- package/dist/dts/lib/GenericChartComponent.d.ts +5 -0
- package/dist/dts/lib/GenericComponent.d.ts +124 -0
- package/dist/dts/lib/StockChartContext.d.ts +53 -0
- package/dist/dts/lib/adapters/BaseAdapter.d.ts +25 -0
- package/dist/dts/lib/adapters/BinanceAdapter.d.ts +51 -0
- package/dist/dts/lib/adapters/CSVAdapter.d.ts +17 -0
- package/dist/dts/lib/adapters/ContinuousContractAdapter.d.ts +63 -0
- package/dist/dts/lib/adapters/ContinuousContractTypes.d.ts +154 -0
- package/dist/dts/lib/adapters/DBAdapter.d.ts +16 -0
- package/dist/dts/lib/adapters/DataAdapter.d.ts +136 -0
- package/dist/dts/lib/adapters/DjangoVnstockAdapter.d.ts +15 -0
- package/dist/dts/lib/adapters/LocalCacheAdapter.d.ts +18 -0
- package/dist/dts/lib/adapters/MockAdapter.d.ts +22 -0
- package/dist/dts/lib/adapters/RESTAdapter.d.ts +16 -0
- package/dist/dts/lib/adapters/StockDataAdapter.d.ts +1 -0
- package/dist/dts/lib/adapters/UDFDataAdapter.d.ts +29 -0
- package/dist/dts/lib/adapters/VNStocksAdapter.d.ts +8 -0
- package/dist/dts/lib/adapters/WSAdapter.d.ts +30 -0
- package/dist/dts/lib/adapters/gapFixture.d.ts +71 -0
- package/dist/dts/lib/adapters/index.d.ts +15 -0
- package/dist/dts/lib/adapters/rollAlgorithms.d.ts +68 -0
- package/dist/dts/lib/advisory/AdvisoryPanel.d.ts +5 -0
- package/dist/dts/lib/alerts/AlertEvaluator.d.ts +5 -0
- package/dist/dts/lib/alerts/AlertManager.d.ts +123 -0
- package/dist/dts/lib/alerts/types.d.ts +58 -0
- package/dist/dts/lib/cache/cacheDebug.d.ts +3 -0
- package/dist/dts/lib/calendars/ExchangeCalendar.d.ts +23 -0
- package/dist/dts/lib/calendars/calendarRegistry.d.ts +10 -0
- package/dist/dts/lib/calendars/index.d.ts +3 -0
- package/dist/dts/lib/core/ChartPane.d.ts +8 -0
- package/dist/dts/lib/core/ChartSplitter.d.ts +70 -0
- package/dist/dts/lib/core/ChartTerminal.d.ts +12 -0
- package/dist/dts/lib/core/ErrorBoundary.d.ts +17 -0
- package/dist/dts/lib/core/IndicatorLegend.d.ts +47 -0
- package/dist/dts/lib/core/PaneHeader.d.ts +24 -0
- package/dist/dts/lib/core/PaneLabel.d.ts +8 -0
- package/dist/dts/lib/core/PaneSplitter.d.ts +9 -0
- package/dist/dts/lib/core/SeriesPicker.d.ts +10 -0
- package/dist/dts/lib/core/calculators/alignBarsByDate.d.ts +38 -0
- package/dist/dts/lib/core/calculators/buildIndicatorComputationPlan.d.ts +16 -0
- package/dist/dts/lib/core/calculators/calcCVDApprox.d.ts +6 -0
- package/dist/dts/lib/core/calculators/calcStrengthElder.d.ts +7 -0
- package/dist/dts/lib/core/calculators/calcWhaleApprox.d.ts +6 -0
- package/dist/dts/lib/core/calculators/computationHelpers.d.ts +12 -0
- package/dist/dts/lib/core/calculators/computeIndicatorComputationResult.d.ts +3 -0
- package/dist/dts/lib/core/calculators/computeMarketStructure.d.ts +8 -0
- package/dist/dts/lib/core/calculators/computeMomentum.d.ts +22 -0
- package/dist/dts/lib/core/calculators/computeMovingAverage.d.ts +15 -0
- package/dist/dts/lib/core/calculators/computeProfile.d.ts +9 -0
- package/dist/dts/lib/core/calculators/computeTrend.d.ts +10 -0
- package/dist/dts/lib/core/calculators/computeVolatility.d.ts +14 -0
- package/dist/dts/lib/core/calculators/computeVolumeFlow.d.ts +19 -0
- package/dist/dts/lib/core/calculators/enrichData.d.ts +7 -0
- package/dist/dts/lib/core/calculators/enrichDataWithCanonicalStore.d.ts +33 -0
- package/dist/dts/lib/core/calculators/exoticChartData.d.ts +140 -0
- package/dist/dts/lib/core/calculators/fixtures/mockData.d.ts +2 -0
- package/dist/dts/lib/core/calculators/indicatorComputation.d.ts +27 -0
- package/dist/dts/lib/core/calculators/indicatorComputationTypes.d.ts +249 -0
- package/dist/dts/lib/core/calculators/materializeIndicatorValues.d.ts +3 -0
- package/dist/dts/lib/core/calculators/normalizePrices.d.ts +36 -0
- package/dist/dts/lib/core/calculators/resolveCalculationOrder.d.ts +17 -0
- package/dist/dts/lib/core/calculators/types.d.ts +269 -0
- package/dist/dts/lib/core/canvas/ChartRenderContext.d.ts +14 -0
- package/dist/dts/lib/core/canvas/OverlayCanvas.d.ts +19 -0
- package/dist/dts/lib/core/context/ChartSyncContext.d.ts +21 -0
- package/dist/dts/lib/core/context/DataContext.d.ts +15 -0
- package/dist/dts/lib/core/context/PaneManagerContext.d.ts +10 -0
- package/dist/dts/lib/core/hooks/paneSizingHelpers.d.ts +13 -0
- package/dist/dts/lib/core/hooks/useCanvasResize.d.ts +8 -0
- package/dist/dts/lib/core/hooks/useChartTheme.d.ts +12 -0
- package/dist/dts/lib/core/hooks/useDynamicPanes.d.ts +155 -0
- package/dist/dts/lib/core/hooks/useIndicatorSets.d.ts +20 -0
- package/dist/dts/lib/core/hooks/usePaneManager.d.ts +39 -0
- package/dist/dts/lib/core/hooks/usePaneSizes.d.ts +52 -0
- package/dist/dts/lib/core/index.d.ts +41 -0
- package/dist/dts/lib/core/paneScaleSlotDomains.d.ts +3 -0
- package/dist/dts/lib/core/registry/SeriesRegistry.d.ts +22 -0
- package/dist/dts/lib/core/registry/filterPanesBySeriesTier.d.ts +43 -0
- package/dist/dts/lib/core/registry/marketStructure.d.ts +7 -0
- package/dist/dts/lib/core/registry/momentum.d.ts +20 -0
- package/dist/dts/lib/core/registry/movingAverage.d.ts +14 -0
- package/dist/dts/lib/core/registry/priceChartTypes.d.ts +16 -0
- package/dist/dts/lib/core/registry/profile.d.ts +8 -0
- package/dist/dts/lib/core/registry/registerAll.d.ts +1 -0
- package/dist/dts/lib/core/registry/registerPhaseOne.d.ts +3 -0
- package/dist/dts/lib/core/registry/registryCore.d.ts +77 -0
- package/dist/dts/lib/core/registry/trend.d.ts +11 -0
- package/dist/dts/lib/core/registry/volatility.d.ts +11 -0
- package/dist/dts/lib/core/registry/volumeFlow.d.ts +20 -0
- package/dist/dts/lib/core/replay/BarReplayController.d.ts +62 -0
- package/dist/dts/lib/core/replay/ReplayEventBus.d.ts +68 -0
- package/dist/dts/lib/core/replay/ReplayFillSimulator.d.ts +33 -0
- package/dist/dts/lib/core/replay/ReplayOrderBook.d.ts +24 -0
- package/dist/dts/lib/core/replay/ReplayPositionManager.d.ts +30 -0
- package/dist/dts/lib/core/replay/ReplaySessionAnalytics.d.ts +31 -0
- package/dist/dts/lib/core/replay/createReplayTradeMarkerPrimitives.d.ts +7 -0
- package/dist/dts/lib/core/replay/pnlUtils.d.ts +2 -0
- package/dist/dts/lib/core/replay/replayBrokerAdapters.d.ts +51 -0
- package/dist/dts/lib/core/replay/replayTradingTypes.d.ts +61 -0
- package/dist/dts/lib/core/scales/computeScales.d.ts +8 -0
- package/dist/dts/lib/core/seriesValueResolver.d.ts +27 -0
- package/dist/dts/lib/core/sets/builtins.d.ts +2 -0
- package/dist/dts/lib/core/sets/indicatorSetCodec.d.ts +15 -0
- package/dist/dts/lib/core/trading/AnalyticsEngine.d.ts +56 -0
- package/dist/dts/lib/core/trading/BrokerAPI.d.ts +40 -0
- package/dist/dts/lib/core/trading/ExecutionSimulator.d.ts +53 -0
- package/dist/dts/lib/core/trading/FillSettlement.d.ts +38 -0
- package/dist/dts/lib/core/trading/MarketDataPort.d.ts +41 -0
- package/dist/dts/lib/core/trading/MarketRules.d.ts +58 -0
- package/dist/dts/lib/core/trading/OrderManagementSystem.d.ts +57 -0
- package/dist/dts/lib/core/trading/PositionManager.d.ts +79 -0
- package/dist/dts/lib/core/trading/RiskEngine.d.ts +40 -0
- package/dist/dts/lib/core/trading/SettlementCalendar.d.ts +10 -0
- package/dist/dts/lib/core/trading/VirtualBrokerEngine.d.ts +92 -0
- package/dist/dts/lib/core/trading/orderMargin.d.ts +3 -0
- package/dist/dts/lib/core/trading/storage/InMemoryStorageAdapter.d.ts +10 -0
- package/dist/dts/lib/core/trading/storage/TradingStorage.d.ts +34 -0
- package/dist/dts/lib/core/trading/types.d.ts +99 -0
- package/dist/dts/lib/core/types/chart.d.ts +21 -0
- package/dist/dts/lib/core/types/indicator-catalog.d.ts +38 -0
- package/dist/dts/lib/core/types/indicator-set.d.ts +19 -0
- package/dist/dts/lib/core/types/pane-descriptor.d.ts +46 -0
- package/dist/dts/lib/core/types/seriesComponents.d.ts +15 -0
- package/dist/dts/lib/credentials/credentialStore.d.ts +93 -0
- package/dist/dts/lib/helper/SaveChartAsImage.d.ts +90 -0
- package/dist/dts/lib/indicator/defaultOptionsForAppearance.d.ts +105 -0
- package/dist/dts/lib/indicators/builtin/MTFWrapper.d.ts +3 -0
- package/dist/dts/lib/indicators/builtin/VolumeProfileWorker.d.ts +19 -0
- package/dist/dts/lib/indicators/builtin/ac.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/alligator.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/anchoredVwap.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ao.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/bbi.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/bias.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/bollinger.d.ts +9 -0
- package/dist/dts/lib/indicators/builtin/brar.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cci.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/chaikinOscillator.d.ts +14 -0
- package/dist/dts/lib/indicators/builtin/chaikinVol.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/ci.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cmf.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cr.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cvd.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/deltaProfile.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/dema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/dma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/dmi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/donchian.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/emv.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/footprint.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/fractals.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/gator.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/hma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/hv.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/ichimoku.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/kdj.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/keltner.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ma.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/maRibbon.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/macd.d.ts +9 -0
- package/dist/dts/lib/indicators/builtin/marketProfile.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/mfi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/mtm.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/obv.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/pivotHighLow.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/pivotStandard.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/psy.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/pvt.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/roc.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/rsi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/sar.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/sma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/smfi.d.ts +8 -0
- package/dist/dts/lib/indicators/builtin/stdDev.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/strengthRelative.d.ts +7 -0
- package/dist/dts/lib/indicators/builtin/supertrend.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/tema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/trix.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volOsc.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volume.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volumeProfile.d.ts +8 -0
- package/dist/dts/lib/indicators/builtin/vr.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/vwap.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/vwma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/wma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/wr.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/wyckoffWave.d.ts +15 -0
- package/dist/dts/lib/indicators/index.d.ts +63 -0
- package/dist/dts/lib/indicators/indicatorValueShapes.d.ts +15 -0
- package/dist/dts/lib/indicators/outputKeys.d.ts +50 -0
- package/dist/dts/lib/indicators/overlays/CVDIndicator.d.ts +26 -0
- package/dist/dts/lib/indicators/overlays/DarkFlowBadge.d.ts +19 -0
- package/dist/dts/lib/indicators/overlays/ExternalCVDOverlay.d.ts +15 -0
- package/dist/dts/lib/indicators/overlays/WhaleBubbleOverlay.d.ts +14 -0
- package/dist/dts/lib/indicators/overlays/WhaleMarketBubbleOverlay.d.ts +27 -0
- package/dist/dts/lib/indicators/overlays/whaleDetector.d.ts +66 -0
- package/dist/dts/lib/indicators/registry.d.ts +6 -0
- package/dist/dts/lib/indicators/types.d.ts +5 -0
- package/dist/dts/lib/indicators/utils.d.ts +259 -0
- package/dist/dts/lib/pinescript/PineCompiler.d.ts +34 -0
- package/dist/dts/lib/pinescript/ast.d.ts +73 -0
- package/dist/dts/lib/pinescript/compile.d.ts +40 -0
- package/dist/dts/lib/pinescript/grammar.d.ts +12 -0
- package/dist/dts/lib/pinescript/pine.worker.d.ts +1 -0
- package/dist/dts/lib/pinescript/pineBlocks.d.ts +54 -0
- package/dist/dts/lib/pinescript/pineBuiltins.d.ts +47 -0
- package/dist/dts/lib/pinescript/pineEnv.d.ts +46 -0
- package/dist/dts/lib/pinescript/pineMath.d.ts +13 -0
- package/dist/dts/lib/pinescript/pineParse.d.ts +25 -0
- package/dist/dts/lib/pinescript/pineStrings.d.ts +50 -0
- package/dist/dts/lib/pinescript/runtime.d.ts +5 -0
- package/dist/dts/lib/pinescript/scriptRegistry.d.ts +40 -0
- package/dist/dts/lib/pinescript/series-value.d.ts +64 -0
- package/dist/dts/lib/pinescript/vnscript-completion.d.ts +1 -0
- package/dist/dts/lib/pinescript/vnscript-grammar.d.ts +19 -0
- package/dist/dts/lib/scale/discontinuousTimeScaleProvider.d.ts +3 -0
- package/dist/dts/lib/scale/financeDiscontinuousScale.d.ts +15 -0
- package/dist/dts/lib/scale/index.d.ts +1 -0
- package/dist/dts/lib/scale/levels.d.ts +12 -0
- package/dist/dts/lib/series/AlternatingFillAreaSeries.d.ts +13 -0
- package/dist/dts/lib/series/AreaOnlySeries.d.ts +10 -0
- package/dist/dts/lib/series/AreaSeries.d.ts +30 -0
- package/dist/dts/lib/series/BarSeries.d.ts +40 -0
- package/dist/dts/lib/series/BollingerSeries.d.ts +11 -0
- package/dist/dts/lib/series/CandlestickSeries.d.ts +56 -0
- package/dist/dts/lib/series/CircleMarker.d.ts +28 -0
- package/dist/dts/lib/series/ElderRaySeries.d.ts +14 -0
- package/dist/dts/lib/series/FootprintSeries.d.ts +21 -0
- package/dist/dts/lib/series/GroupedBarSeries.d.ts +9 -0
- package/dist/dts/lib/series/HTFOverlaySeries.d.ts +32 -0
- package/dist/dts/lib/series/HistogramSeries.d.ts +51 -0
- package/dist/dts/lib/series/KagiSeries.d.ts +9 -0
- package/dist/dts/lib/series/LineBreakSeries.d.ts +28 -0
- package/dist/dts/lib/series/LineSeries.d.ts +54 -0
- package/dist/dts/lib/series/MACDSeries.d.ts +28 -0
- package/dist/dts/lib/series/MarketProfileSeries.d.ts +18 -0
- package/dist/dts/lib/series/OHLCSeries.d.ts +9 -0
- package/dist/dts/lib/series/OverlayBarSeries.d.ts +9 -0
- package/dist/dts/lib/series/PointAndFigureSeries.d.ts +45 -0
- package/dist/dts/lib/series/RSISeries.d.ts +38 -0
- package/dist/dts/lib/series/RenkoSeries.d.ts +9 -0
- package/dist/dts/lib/series/SARSeries.d.ts +10 -0
- package/dist/dts/lib/series/SVGComponent.d.ts +5 -0
- package/dist/dts/lib/series/ScatterSeries.d.ts +9 -0
- package/dist/dts/lib/series/SquareMarker.d.ts +28 -0
- package/dist/dts/lib/series/StackedBarSeries.d.ts +19 -0
- package/dist/dts/lib/series/StochasticSeries.d.ts +9 -0
- package/dist/dts/lib/series/StraightLine.d.ts +18 -0
- package/dist/dts/lib/series/TriangleMarker.d.ts +30 -0
- package/dist/dts/lib/series/VolumeProfileSeries.d.ts +9 -0
- package/dist/dts/lib/series/index.d.ts +28 -0
- package/dist/dts/lib/strategy/BrokerSimulator.d.ts +11 -0
- package/dist/dts/lib/strategy/types.d.ts +35 -0
- package/dist/dts/lib/tape/TapePanel.d.ts +5 -0
- package/dist/dts/lib/types/adapter.d.ts +1 -0
- package/dist/dts/lib/types/index.d.ts +5 -0
- package/dist/dts/lib/types/indicator.d.ts +11 -0
- package/dist/dts/lib/types/ohlcv.d.ts +1 -0
- package/dist/dts/lib/types/pane.d.ts +23 -0
- package/dist/dts/lib/types/runtime.d.ts +11 -0
- package/dist/dts/lib/types/vninvest.d.ts +320 -0
- package/dist/dts/lib/types.d.ts +45 -0
- package/dist/dts/lib/utils/ChartDataUtil.d.ts +26 -0
- package/dist/dts/lib/utils/PureComponent.d.ts +5 -0
- package/dist/dts/lib/utils/accumulatingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/axisPriceFormat.d.ts +6 -0
- package/dist/dts/lib/utils/barWidth.d.ts +14 -0
- package/dist/dts/lib/utils/identity.d.ts +1 -0
- package/dist/dts/lib/utils/index.d.ts +70 -0
- package/dist/dts/lib/utils/logger.d.ts +28 -0
- package/dist/dts/lib/utils/mappedSlidingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/merge.d.ts +6 -0
- package/dist/dts/lib/utils/noop.d.ts +1 -0
- package/dist/dts/lib/utils/rebind.d.ts +1 -0
- package/dist/dts/lib/utils/shallowEqual.d.ts +1 -0
- package/dist/dts/lib/utils/slidingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/storage.d.ts +32 -0
- package/dist/dts/lib/utils/strokeDasharray.d.ts +3 -0
- package/dist/dts/lib/utils/timezoneFormatter.d.ts +14 -0
- package/dist/dts/lib/utils/zipper.d.ts +4 -0
- package/dist/dts/public-api.d.ts +31 -0
- package/dist/dts/widget/BackfillWorkerFlags.d.ts +12 -0
- package/dist/dts/widget/CanaryRollbackHelper.d.ts +95 -0
- package/dist/dts/widget/CanaryRolloutConfig.d.ts +100 -0
- package/dist/dts/widget/DrawingPriceLabelsOverlay.d.ts +20 -0
- package/dist/dts/widget/ForkDrawingsOverlay.d.ts +16 -0
- package/dist/dts/widget/MeasurementOverlay.d.ts +24 -0
- package/dist/dts/widget/VNInvestCharts.d.ts +5 -0
- package/dist/dts/widget/VNInvestChartsProps.d.ts +302 -0
- package/dist/dts/widget/VNInvestMultiCharts.d.ts +8 -0
- package/dist/dts/widget/VNInvestMultiCharts.types.d.ts +130 -0
- package/dist/dts/widget/WidgetEmptyState.d.ts +11 -0
- package/dist/dts/widget/WidgetErrorBoundary.d.ts +26 -0
- package/dist/dts/widget/adapters/ContinuousFuturesStockDataAdapter.d.ts +18 -0
- package/dist/dts/widget/adapters/DataProviderAdapterWrapper.d.ts +14 -0
- package/dist/dts/widget/adapters/MultiSourceDataAdapter.d.ts +24 -0
- package/dist/dts/widget/adapters/VNInvestClient.d.ts +161 -0
- package/dist/dts/widget/adapters/VNInvestDataAdapter.d.ts +77 -0
- package/dist/dts/widget/adapters/VNInvestWebSocketClient.d.ts +79 -0
- package/dist/dts/widget/adapters/barsPagingPolicy.d.ts +18 -0
- package/dist/dts/widget/adapters/corporateEvents.d.ts +13 -0
- package/dist/dts/widget/adapters/index.d.ts +20 -0
- package/dist/dts/widget/adapters/nativeShapes.d.ts +32 -0
- package/dist/dts/widget/adapters/watchlistRealtimeSync.d.ts +16 -0
- package/dist/dts/widget/alerts/DrawingAlertsHost.d.ts +18 -0
- package/dist/dts/widget/alerts/useDrawingAlerts.d.ts +37 -0
- package/dist/dts/widget/canaryBarFiltering.d.ts +35 -0
- package/dist/dts/widget/capabilities/CapabilityResolver.d.ts +71 -0
- package/dist/dts/widget/capabilities/capabilityProbe.d.ts +28 -0
- package/dist/dts/widget/capabilities/useTierGatedFeatures.d.ts +48 -0
- package/dist/dts/widget/components/BottomPanelHost.d.ts +80 -0
- package/dist/dts/widget/components/BottomPanelSplitter.d.ts +15 -0
- package/dist/dts/widget/components/CapabilityGate.d.ts +65 -0
- package/dist/dts/widget/components/ChartDiagOverlay.d.ts +31 -0
- package/dist/dts/widget/components/ConfirmDialog.d.ts +12 -0
- package/dist/dts/widget/components/DowngradeBanner.d.ts +9 -0
- package/dist/dts/widget/components/ForkPaneSeparators.d.ts +11 -0
- package/dist/dts/widget/components/ForkPaneTooltips.d.ts +23 -0
- package/dist/dts/widget/components/ForkXAxisOverlay.d.ts +11 -0
- package/dist/dts/widget/components/ForkYAxisCrosshairLabels.d.ts +9 -0
- package/dist/dts/widget/components/LayoutDesigner.d.ts +26 -0
- package/dist/dts/widget/components/PremiumFeatureGate.d.ts +10 -0
- package/dist/dts/widget/components/ShortcutHelpModal.d.ts +44 -0
- package/dist/dts/widget/components/SystemMenu.d.ts +66 -0
- package/dist/dts/widget/components/Toast.d.ts +20 -0
- package/dist/dts/widget/components/canvas/BarCountdownBadge.d.ts +8 -0
- package/dist/dts/widget/components/canvas/ChartA11ySummary.d.ts +40 -0
- package/dist/dts/widget/components/canvas/ChartStatusLine.d.ts +39 -0
- package/dist/dts/widget/components/canvas/PricePaneHeader.d.ts +24 -0
- package/dist/dts/widget/components/canvas/PriceScaleMenu.d.ts +27 -0
- package/dist/dts/widget/components/canvas/TimeAxisScrollbar.d.ts +18 -0
- package/dist/dts/widget/components/common/Icons.d.ts +67 -0
- package/dist/dts/widget/components/dock/DataWindow.d.ts +7 -0
- package/dist/dts/widget/components/dock/DockUpgradeNudge.d.ts +10 -0
- package/dist/dts/widget/components/dock/RightSidebarDockHost.d.ts +57 -0
- package/dist/dts/widget/components/dock/WatchlistPanel.d.ts +7 -0
- package/dist/dts/widget/components/dock/WorkspaceRightDockSlot.d.ts +46 -0
- package/dist/dts/widget/components/dock/dockAccess.d.ts +20 -0
- package/dist/dts/widget/components/dock/drawingDockContentBuilders.d.ts +29 -0
- package/dist/dts/widget/components/drawing/DrawingDock.d.ts +47 -0
- package/dist/dts/widget/components/drawing/DrawingInspector.d.ts +94 -0
- package/dist/dts/widget/components/drawing/DrawingListPanel.d.ts +62 -0
- package/dist/dts/widget/components/drawing/DrawingSemanticPointLegend.d.ts +14 -0
- package/dist/dts/widget/components/drawing/FloatingDrawingInspector.d.ts +18 -0
- package/dist/dts/widget/components/drawing/IconPickerPanel.d.ts +5 -0
- package/dist/dts/widget/components/drawing/InlineTextEditor.d.ts +20 -0
- package/dist/dts/widget/components/drawing/PatternScanPanel.d.ts +27 -0
- package/dist/dts/widget/components/drawing/TemplateManagerPanel.d.ts +18 -0
- package/dist/dts/widget/components/events/CorporateEventsOverlay.d.ts +23 -0
- package/dist/dts/widget/components/events/EventMarkerIcon.d.ts +6 -0
- package/dist/dts/widget/components/footer/ChartFooter.d.ts +26 -0
- package/dist/dts/widget/components/footer/MultiChartsFooter.d.ts +37 -0
- package/dist/dts/widget/components/footer/TimeframeFooter.d.ts +25 -0
- package/dist/dts/widget/components/footer/useBarCountdown.d.ts +5 -0
- package/dist/dts/widget/components/header/OHLCHeader.d.ts +72 -0
- package/dist/dts/widget/components/layout/DrawingConflictNotice.d.ts +4 -0
- package/dist/dts/widget/components/layout/GridContainer.d.ts +70 -0
- package/dist/dts/widget/components/layout/GridSlotErrorBoundary.d.ts +17 -0
- package/dist/dts/widget/components/layout/Splitter.d.ts +23 -0
- package/dist/dts/widget/components/layout/gridSplitterMath.d.ts +40 -0
- package/dist/dts/widget/components/layout/useGridSplitterDrag.d.ts +18 -0
- package/dist/dts/widget/components/mobile/MobileChartCarousel.d.ts +11 -0
- package/dist/dts/widget/components/mobile/MobileToolbar.d.ts +29 -0
- package/dist/dts/widget/components/overlays/AdvisoryPanel.d.ts +25 -0
- package/dist/dts/widget/components/overlays/TapePanel.d.ts +25 -0
- package/dist/dts/widget/components/overlays/WhalePanel.d.ts +5 -0
- package/dist/dts/widget/components/panels/AdvisoryPanel.d.ts +25 -0
- package/dist/dts/widget/components/panels/PineEditorPanel.d.ts +18 -0
- package/dist/dts/widget/components/panels/StrategyTesterPanel.d.ts +7 -0
- package/dist/dts/widget/components/panels/TapePanel.d.ts +17 -0
- package/dist/dts/widget/components/panels/index.d.ts +8 -0
- package/dist/dts/widget/components/replay/FloatingReplayToolbar.d.ts +24 -0
- package/dist/dts/widget/components/replay/ReplayCutOverlay.d.ts +8 -0
- package/dist/dts/widget/components/search/SymbolCompareModal.d.ts +24 -0
- package/dist/dts/widget/components/search/SymbolSearchModal.d.ts +12 -0
- package/dist/dts/widget/components/search/VNSymbolSearch.d.ts +83 -0
- package/dist/dts/widget/components/settings/AlertsModal.d.ts +74 -0
- package/dist/dts/widget/components/settings/SettingsContext.d.ts +58 -0
- package/dist/dts/widget/components/settings/SettingsModal.d.ts +78 -0
- package/dist/dts/widget/components/settings/SettingsRangeSlider.d.ts +17 -0
- package/dist/dts/widget/components/settings/SnapshotPreviewModal.d.ts +16 -0
- package/dist/dts/widget/components/settings/WorkspaceSettingsContext.d.ts +27 -0
- package/dist/dts/widget/components/settings/helpers/seriesFormatters.d.ts +11 -0
- package/dist/dts/widget/components/settings/model/appearancePayload.d.ts +31 -0
- package/dist/dts/widget/components/settings/model/chartSettingsSchema.d.ts +100 -0
- package/dist/dts/widget/components/settings/model/defaultSettings.d.ts +5 -0
- package/dist/dts/widget/components/settings/model/indicatorShare.d.ts +29 -0
- package/dist/dts/widget/components/settings/storageKeys.d.ts +29 -0
- package/dist/dts/widget/components/settings/tabs/AppearanceSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/IndicatorParamsForm.d.ts +12 -0
- package/dist/dts/widget/components/settings/tabs/IndicatorsSettingsTab.d.ts +34 -0
- package/dist/dts/widget/components/settings/tabs/LicensingSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/PanesLayoutSettingsTab.d.ts +11 -0
- package/dist/dts/widget/components/settings/tabs/ResetSettingsTab.d.ts +8 -0
- package/dist/dts/widget/components/settings/tabs/ScalesSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/StatusLineSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/SymbolSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/ThemePaletteSettingsTab.d.ts +9 -0
- package/dist/dts/widget/components/settings/tabs/TradingEventsSettingsTab.d.ts +8 -0
- package/dist/dts/widget/components/toolbar/DrawingToolIcon.d.ts +10 -0
- package/dist/dts/widget/components/toolbar/DrawingToolbar.d.ts +33 -0
- package/dist/dts/widget/components/toolbar/FloatingChartBar.d.ts +20 -0
- package/dist/dts/widget/components/toolbar/FloatingFavoritesBar.d.ts +18 -0
- package/dist/dts/widget/components/toolbar/MultiChartTopbar.d.ts +47 -0
- package/dist/dts/widget/components/toolbar/UnifiedDrawingToolbar.d.ts +28 -0
- package/dist/dts/widget/components/trading/PaperTradePanel.d.ts +41 -0
- package/dist/dts/widget/components/workspace/WorkspaceToolbar.d.ts +25 -0
- package/dist/dts/widget/config/toolGroups.d.ts +11 -0
- package/dist/dts/widget/config/toolShortcuts.d.ts +27 -0
- package/dist/dts/widget/constants/comparison.d.ts +1 -0
- package/dist/dts/widget/constants/symbolSearch.d.ts +14 -0
- package/dist/dts/widget/constants/vn30.d.ts +7 -0
- package/dist/dts/widget/context/DataProviderContext.d.ts +7 -0
- package/dist/dts/widget/context/HoverEmitter.d.ts +50 -0
- package/dist/dts/widget/context/SyncContextShare.d.ts +11 -0
- package/dist/dts/widget/context/VNInvestChartsConfigContext.d.ts +24 -0
- package/dist/dts/widget/context/VNInvestChartsContext.d.ts +70 -0
- package/dist/dts/widget/context/VNInvestChartsStateContext.d.ts +50 -0
- package/dist/dts/widget/context/WidgetI18nContext.d.ts +25 -0
- package/dist/dts/widget/context/WorkspaceLiveTradingContext.d.ts +30 -0
- package/dist/dts/widget/context/WorkspacePaperVisibilityContext.d.ts +23 -0
- package/dist/dts/widget/context/WorkspaceReplayTradingContext.d.ts +36 -0
- package/dist/dts/widget/contexts/SaaSFeatureContext.d.ts +23 -0
- package/dist/dts/widget/data/DataEnvelope.d.ts +100 -0
- package/dist/dts/widget/drawingPriceLabelInputs.d.ts +3 -0
- package/dist/dts/widget/export/chartCsv.d.ts +59 -0
- package/dist/dts/widget/forkAnchorReconciliation.d.ts +6 -0
- package/dist/dts/widget/forkInteractionHelpers.d.ts +69 -0
- package/dist/dts/widget/grid/DeviceProfiles.d.ts +49 -0
- package/dist/dts/widget/grid/GridChartRegistry.d.ts +9 -0
- package/dist/dts/widget/grid/MemoryBudgetManager.d.ts +63 -0
- package/dist/dts/widget/grid/PerformanceMonitor.d.ts +70 -0
- package/dist/dts/widget/grid/customPresets.d.ts +42 -0
- package/dist/dts/widget/grid/presets.d.ts +18 -0
- package/dist/dts/widget/grid/types.d.ts +39 -0
- package/dist/dts/widget/history/BackfillDedupContext.d.ts +63 -0
- package/dist/dts/widget/history/RequestCoordinator.d.ts +59 -0
- package/dist/dts/widget/history/SharedBarStoreContext.d.ts +22 -0
- package/dist/dts/widget/history/cache/IndexedDBCacheMatrix.d.ts +16 -0
- package/dist/dts/widget/history/cache/LocalCacheMatrix.d.ts +86 -0
- package/dist/dts/widget/history/cache/index.d.ts +3 -0
- package/dist/dts/widget/history/chunkStore.d.ts +77 -0
- package/dist/dts/widget/history/externalBarsNormalization.d.ts +9 -0
- package/dist/dts/widget/history/externalBarsNormalization.worker.d.ts +1 -0
- package/dist/dts/widget/history/externalBarsNormalizationAsync.d.ts +25 -0
- package/dist/dts/widget/history/historyDataUtils.d.ts +82 -0
- package/dist/dts/widget/history/historyWindowPlanner.d.ts +89 -0
- package/dist/dts/widget/history/inflightController.d.ts +15 -0
- package/dist/dts/widget/history/requestCoalescing.d.ts +10 -0
- package/dist/dts/widget/history/sessionGuards.d.ts +3 -0
- package/dist/dts/widget/history/singleWriterLane.d.ts +4 -0
- package/dist/dts/widget/history/useExternalBarsNormalization.d.ts +5 -0
- package/dist/dts/widget/hooks/ShortcutManager.d.ts +65 -0
- package/dist/dts/widget/hooks/overlays/PaneHeaderWrapper.d.ts +11 -0
- package/dist/dts/widget/hooks/overlays/overlayHelpers.d.ts +60 -0
- package/dist/dts/widget/hooks/overlays/useDrawingDockNode.d.ts +15 -0
- package/dist/dts/widget/hooks/overlays/useLegendChrome.d.ts +36 -0
- package/dist/dts/widget/hooks/overlays/useMultiSelectActions.d.ts +22 -0
- package/dist/dts/widget/hooks/overlays/useSidebarResize.d.ts +13 -0
- package/dist/dts/widget/hooks/resolveEntitlement.d.ts +73 -0
- package/dist/dts/widget/hooks/useBottomPanelBehavior.d.ts +38 -0
- package/dist/dts/widget/hooks/useBottomPanelHeight.d.ts +39 -0
- package/dist/dts/widget/hooks/useCanvasTheme.d.ts +24 -0
- package/dist/dts/widget/hooks/useChartImperativeHandle.d.ts +57 -0
- package/dist/dts/widget/hooks/useClockAdapter.d.ts +11 -0
- package/dist/dts/widget/hooks/useComparisonState.d.ts +29 -0
- package/dist/dts/widget/hooks/useDialogFocus.d.ts +25 -0
- package/dist/dts/widget/hooks/useDrawingToolShortcuts.d.ts +16 -0
- package/dist/dts/widget/hooks/useFeatureGate.d.ts +28 -0
- package/dist/dts/widget/hooks/useFloatingChartBar.d.ts +33 -0
- package/dist/dts/widget/hooks/useForkRuntime.d.ts +155 -0
- package/dist/dts/widget/hooks/useIndicatorsShareApplier.d.ts +1 -0
- package/dist/dts/widget/hooks/useIntersectionObserver.d.ts +49 -0
- package/dist/dts/widget/hooks/useKeyboardAdapter.d.ts +9 -0
- package/dist/dts/widget/hooks/useLayoutHistory.d.ts +8 -0
- package/dist/dts/widget/hooks/useLicenseDiagnostics.d.ts +15 -0
- package/dist/dts/widget/hooks/useMultiChartReplaySync.d.ts +31 -0
- package/dist/dts/widget/hooks/useMultiWorkspacePersistence.d.ts +49 -0
- package/dist/dts/widget/hooks/usePaperTradeConfig.d.ts +27 -0
- package/dist/dts/widget/hooks/usePaperTradeInteraction.d.ts +27 -0
- package/dist/dts/widget/hooks/usePatTierAuthentication.d.ts +42 -0
- package/dist/dts/widget/hooks/usePineScriptRestore.d.ts +23 -0
- package/dist/dts/widget/hooks/usePortalAdapter.d.ts +8 -0
- package/dist/dts/widget/hooks/useRecentSymbols.d.ts +3 -0
- package/dist/dts/widget/hooks/useReplayState.d.ts +28 -0
- package/dist/dts/widget/hooks/useReplayTrading.d.ts +26 -0
- package/dist/dts/widget/hooks/useResizeAdapter.d.ts +13 -0
- package/dist/dts/widget/hooks/useScaleOverlays.d.ts +62 -0
- package/dist/dts/widget/hooks/useScriptPersistence.d.ts +72 -0
- package/dist/dts/widget/hooks/useSymbolSearch.d.ts +30 -0
- package/dist/dts/widget/hooks/useViewportBreakpoint.d.ts +15 -0
- package/dist/dts/widget/hooks/useWidgetCoordinateBridge.d.ts +70 -0
- package/dist/dts/widget/hooks/useWidgetData.d.ts +138 -0
- package/dist/dts/widget/hooks/useWidgetDataBackfill.d.ts +67 -0
- package/dist/dts/widget/hooks/useWidgetDataEnrichment.d.ts +32 -0
- package/dist/dts/widget/hooks/useWidgetDrawings.d.ts +38 -0
- package/dist/dts/widget/hooks/useWidgetForkInteraction.d.ts +68 -0
- package/dist/dts/widget/hooks/useWidgetInteractionActions.d.ts +36 -0
- package/dist/dts/widget/hooks/useWidgetOverlays.d.ts +190 -0
- package/dist/dts/widget/hooks/useWidgetRuntime.d.ts +20 -0
- package/dist/dts/widget/hooks/useWidgetSettings.d.ts +244 -0
- package/dist/dts/widget/hooks/useWidgetWorkspaceIO.d.ts +24 -0
- package/dist/dts/widget/hooks/useWorkspaceDockPanels.d.ts +11 -0
- package/dist/dts/widget/hooks/useWorkspaceLiveTrading.d.ts +28 -0
- package/dist/dts/widget/hooks/useWorkspaceReplayTrading.d.ts +22 -0
- package/dist/dts/widget/i18n/a11y.messages.en.d.ts +8 -0
- package/dist/dts/widget/i18n/a11y.messages.vi.d.ts +3 -0
- package/dist/dts/widget/i18n/capability.messages.en.d.ts +7 -0
- package/dist/dts/widget/i18n/capability.messages.vi.d.ts +3 -0
- package/dist/dts/widget/i18n/dock.messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/dock.messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/messages.licensing.d.ts +48 -0
- package/dist/dts/widget/i18n/messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/trading.messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/trading.messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/types.d.ts +3 -0
- package/dist/dts/widget/iframe/builtInAdapters.d.ts +63 -0
- package/dist/dts/widget/iframe/host-entry.d.ts +11 -0
- package/dist/dts/widget/iframe/hostSDK.d.ts +151 -0
- package/dist/dts/widget/iframe/iframeBridge.d.ts +165 -0
- package/dist/dts/widget/iframe/iframeEntry.d.ts +52 -0
- package/dist/dts/widget/iframe/iframeFrame.d.ts +15 -0
- package/dist/dts/widget/iframe/iframeQuotes.d.ts +20 -0
- package/dist/dts/widget/iframe/messageProtocol.d.ts +545 -0
- package/dist/dts/widget/iframe/quoteHub.d.ts +20 -0
- package/dist/dts/widget/iframe/useVNInvestChartsHost.d.ts +8 -0
- package/dist/dts/widget/iife-entry.d.ts +61 -0
- package/dist/dts/widget/iifeWidgetInstance.d.ts +60 -0
- package/dist/dts/widget/index.d.ts +56 -0
- package/dist/dts/widget/multiChartDefaults.d.ts +18 -0
- package/dist/dts/widget/paneInteractionUtils.d.ts +25 -0
- package/dist/dts/widget/patterns/autoPatternScan.d.ts +77 -0
- package/dist/dts/widget/patterns/patternDrawingFactory.d.ts +87 -0
- package/dist/dts/widget/plugin/ProPluginRegistry.d.ts +40 -0
- package/dist/dts/widget/runtime/ChartScaleAdapter.d.ts +73 -0
- package/dist/dts/widget/runtime/ChartSerializer.d.ts +12 -0
- package/dist/dts/widget/runtime/ForkRuntimeAdapter.d.ts +19 -0
- package/dist/dts/widget/runtime/IRuntimeEngine.d.ts +40 -0
- package/dist/dts/widget/runtime/WorkspaceSerializer.d.ts +31 -0
- package/dist/dts/widget/runtimePolicy.d.ts +36 -0
- package/dist/dts/widget/styles/injectStyles.d.ts +9 -0
- package/dist/dts/widget/theme/ThemeConfig.d.ts +21 -0
- package/dist/dts/widget/theme/applyTheme.d.ts +3 -0
- package/dist/dts/widget/trading/chart/DraggableOrderHandles.d.ts +15 -0
- package/dist/dts/widget/trading/chart/InteractivePositionOverlay.d.ts +19 -0
- package/dist/dts/widget/trading/chart/PendingOrderOverlay.d.ts +11 -0
- package/dist/dts/widget/trading/chart/QuickTradingHeader.d.ts +20 -0
- package/dist/dts/widget/trading/chart/TradingChartSurface.d.ts +8 -0
- package/dist/dts/widget/trading/chart/TradingOverlaysHost.d.ts +28 -0
- package/dist/dts/widget/trading/chart/priceTicks.d.ts +1 -0
- package/dist/dts/widget/trading/chart/useFloatingDrag.d.ts +40 -0
- package/dist/dts/widget/trading/chart/useTradingHotkeys.d.ts +21 -0
- package/dist/dts/widget/trading/config/paperRuntimeConfig.d.ts +53 -0
- package/dist/dts/widget/trading/context/PaperPanelRegistry.d.ts +45 -0
- package/dist/dts/widget/trading/context/TradingContext.d.ts +80 -0
- package/dist/dts/widget/trading/context/WorkspaceTradingSync.d.ts +24 -0
- package/dist/dts/widget/trading/hooks/usePaperRuntimeConfig.d.ts +36 -0
- package/dist/dts/widget/trading/index.d.ts +5 -0
- package/dist/dts/widget/trading/panel/AccountSummaryTab.d.ts +7 -0
- package/dist/dts/widget/trading/panel/ActiveChartPaperPanel.d.ts +26 -0
- package/dist/dts/widget/trading/panel/ConnectedTradingPanel.d.ts +3 -0
- package/dist/dts/widget/trading/panel/HistoryTab.d.ts +5 -0
- package/dist/dts/widget/trading/panel/MarketFallbackBanner.d.ts +4 -0
- package/dist/dts/widget/trading/panel/OrdersTab.d.ts +8 -0
- package/dist/dts/widget/trading/panel/PaperCapitalDialog.d.ts +8 -0
- package/dist/dts/widget/trading/panel/PaperSettingsModal.d.ts +17 -0
- package/dist/dts/widget/trading/panel/PositionsTab.d.ts +15 -0
- package/dist/dts/widget/trading/panel/TradeHistoryTab.d.ts +5 -0
- package/dist/dts/widget/trading/panel/TradingBottomPanel.d.ts +36 -0
- package/dist/dts/widget/trading/panel/TradingLogTab.d.ts +8 -0
- package/dist/dts/widget/trading/panel/TradingPanelHeader.d.ts +17 -0
- package/dist/dts/widget/trading/panel/csvExport.d.ts +18 -0
- package/dist/dts/widget/trading/ticket/ConnectedTradingDockPanel.d.ts +5 -0
- package/dist/dts/widget/trading/ticket/OrderTicketForm.d.ts +31 -0
- package/dist/dts/widget/trading/ticket/OrderTicketModal.d.ts +29 -0
- package/dist/dts/widget/trading/ticket/RegistryTradingDockPanel.d.ts +9 -0
- package/dist/dts/widget/trading/ticket/RiskCalculatorView.d.ts +9 -0
- package/dist/dts/widget/trading/ticket/TradingDockPanel.d.ts +36 -0
- package/dist/dts/widget/trading/ticket/orderTicketModel.d.ts +49 -0
- package/dist/dts/widget/trading/visibility/paperVisibility.d.ts +38 -0
- package/dist/dts/widget/types/dataProvider.d.ts +8 -0
- package/dist/dts/widget/types/fullChartHandle.d.ts +25 -0
- package/dist/dts/widget/types/saas.d.ts +83 -0
- package/dist/dts/widget/types/symbolSearch.d.ts +9 -0
- package/dist/dts/widget/types/watchlist.d.ts +26 -0
- package/dist/dts/widget/utils/axisHit.d.ts +16 -0
- package/dist/dts/widget/utils/chartRange.d.ts +12 -0
- package/dist/dts/widget/utils/chartTypeOptions.d.ts +38 -0
- package/dist/dts/widget/utils/clickOutside.d.ts +1 -0
- package/dist/dts/widget/utils/coordinateBridge.d.ts +31 -0
- package/dist/dts/widget/utils/crosshairSync.d.ts +50 -0
- package/dist/dts/widget/utils/drawingSync.d.ts +198 -0
- package/dist/dts/widget/utils/enrichedHash.d.ts +15 -0
- package/dist/dts/widget/utils/headerSync.d.ts +12 -0
- package/dist/dts/widget/utils/numberFormat.d.ts +13 -0
- package/dist/dts/widget/utils/paperTradeAdapters.d.ts +11 -0
- package/dist/dts/widget/utils/pineSeriesData.d.ts +71 -0
- package/dist/dts/widget/utils/rangeSync.d.ts +29 -0
- package/dist/dts/widget/utils/telemetry.d.ts +19 -0
- package/dist/dts/widget/utils/widgetEquality.d.ts +57 -0
- package/dist/dts/widget/utils/widgetErrors.d.ts +29 -0
- package/dist/dts/widget/utils/widgetHelpers.d.ts +395 -0
- package/dist/dts/widget/utils/xAxisTickFormatter.d.ts +33 -0
- package/dist/dts/widget/visibleRangeBridge.d.ts +28 -0
- package/dist/dts/widget/visibleRangeDiagnostics.d.ts +10 -0
- package/dist/dts/widget/visibleRangePolicies.d.ts +6 -0
- package/dist/dts/widget/workspace/WorkspaceManager.d.ts +23 -0
- package/dist/dts/widget/workspace/WorkspaceStore.d.ts +85 -0
- package/dist/dts/widget/workspace/types.d.ts +21 -0
- package/dist/externalBarsNormalization.worker.js +108 -0
- package/dist/iframe/index.html +63 -0
- package/dist/iframe/injected.css +6456 -0
- package/dist/iframe/vninvestchart.iframe.css +2 -0
- package/dist/iframe/vninvestchart.iframe.js +945 -0
- package/dist/iframe-host/host-entry.cjs +687 -0
- package/dist/iframe-host/host-entry.d.mts +818 -0
- package/dist/iframe-host/host-entry.d.ts +818 -0
- package/dist/iframe-host/host-entry.js +680 -0
- package/dist/index.cjs +7253 -0
- package/dist/index.css +3390 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +6461 -0
- package/dist/injected.css +6456 -0
- package/dist/rollAlgorithms-2P2ZKKHO.js +2 -0
- package/dist/types/runtime.cjs +8 -0
- package/dist/types/runtime.d.mts +92 -0
- package/dist/types/runtime.d.ts +92 -0
- package/dist/types/runtime.js +5 -0
- package/dist/types/runtime.umd.js +14 -0
- package/dist/vninvestchart.iife.css +2 -0
- package/dist/vninvestchart.iife.js +945 -0
- package/package.json +225 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReplayOHLCBar } from "../replay/replayTradingTypes";
|
|
2
|
+
export interface MarketQuote {
|
|
3
|
+
symbol: string;
|
|
4
|
+
lastPrice: number;
|
|
5
|
+
bidPrice: number;
|
|
6
|
+
askPrice: number;
|
|
7
|
+
spread: number;
|
|
8
|
+
spreadBps: number;
|
|
9
|
+
/** Luôn true với nguồn OHLC (không có sổ lệnh tick L1 thật). */
|
|
10
|
+
isSyntheticSpread: boolean;
|
|
11
|
+
timestamp: number;
|
|
12
|
+
}
|
|
13
|
+
export interface SyntheticSpreadConfig {
|
|
14
|
+
/** Spread mặc định theo bps của last khi không có tick provider. Default 10. */
|
|
15
|
+
spreadBps?: number;
|
|
16
|
+
/** Nếu có: spread = đúng 1 tick, bid/ask làm tròn theo tick. */
|
|
17
|
+
tickSizeProvider?: (symbol: string, price: number) => number;
|
|
18
|
+
}
|
|
19
|
+
export type QuoteCallback = (quote: MarketQuote) => void;
|
|
20
|
+
export interface IMarketDataPort {
|
|
21
|
+
getLatestQuote(symbol: string): MarketQuote | undefined;
|
|
22
|
+
feedBar(symbol: string, bar: ReplayOHLCBar): void;
|
|
23
|
+
subscribeQuote(symbol: string, callback: QuoteCallback): () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Tính synthetic quote từ last price. Quy tắc xác định (deterministic):
|
|
27
|
+
* - last không hợp lệ (<= 0 / NaN): spread = 0, bid = ask = last.
|
|
28
|
+
* - có tickSizeProvider: spread = đúng 1 tick, bid/ask làm tròn theo tick.
|
|
29
|
+
* - ngược lại: spread = last * spreadBps / 10000, bid/ask giữ nguyên.
|
|
30
|
+
*/
|
|
31
|
+
export declare function computeSyntheticQuote(symbol: string, lastPrice: number, timestamp: number, config?: SyntheticSpreadConfig): MarketQuote;
|
|
32
|
+
export declare class MarketDataPort implements IMarketDataPort {
|
|
33
|
+
private readonly config;
|
|
34
|
+
private readonly latest;
|
|
35
|
+
private readonly subscribers;
|
|
36
|
+
constructor(config?: SyntheticSpreadConfig);
|
|
37
|
+
getLatestQuote(symbol: string): MarketQuote | undefined;
|
|
38
|
+
feedBar(symbol: string, bar: ReplayOHLCBar): void;
|
|
39
|
+
subscribeQuote(symbol: string, callback: QuoteCallback): () => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function createMarketDataPort(config?: SyntheticSpreadConfig): IMarketDataPort;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { OrderRejectCode, OrderValidationInput } from "./types";
|
|
2
|
+
export type MarketProfileType = "VN_SPOT" | "VN_DERIVATIVES" | "GLOBAL_MARGIN";
|
|
3
|
+
/**
|
|
4
|
+
* P1.2c: true cho HOSE/HNX/UPCOM + phái sinh VN (có phiên đấu giá, lô chẵn,
|
|
5
|
+
* biên độ trần/sàn). Crypto/global không có khái niệm này.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isVnProfile(profile: MarketProfileType): boolean;
|
|
8
|
+
export type ExchangeType = "HOSE" | "HNX" | "UPCOM" | "GLOBAL";
|
|
9
|
+
/** Vốn paper mặc định — đủ mua thoải mái, khỏi nạp liên tục (BTC ~81k mua được 1 + dư). */
|
|
10
|
+
export declare const DEFAULT_PAPER_BALANCE_USD = 100000;
|
|
11
|
+
export declare const DEFAULT_PAPER_BALANCE_VND = 1000000000;
|
|
12
|
+
/** Vốn tối đa cho phép nhập ở dialog nạp vốn (chống typo thừa số 0). */
|
|
13
|
+
export declare const MAX_PAPER_BALANCE = 1000000000000;
|
|
14
|
+
export interface MarketRules {
|
|
15
|
+
profile: MarketProfileType;
|
|
16
|
+
baseCurrency: string;
|
|
17
|
+
lotSize: number;
|
|
18
|
+
contractMultiplier?: number;
|
|
19
|
+
allowShortSelling: boolean;
|
|
20
|
+
settlementDays: number;
|
|
21
|
+
maxLeverage: number;
|
|
22
|
+
initialMarginRate?: number;
|
|
23
|
+
brokerBufferMultiplier?: number;
|
|
24
|
+
maxOrderQuantity?: number;
|
|
25
|
+
maxPositionQuantity?: number;
|
|
26
|
+
getTickSize(price: number, exchange?: ExchangeType): number;
|
|
27
|
+
getPriceBand(referencePrice: number, exchange?: ExchangeType): {
|
|
28
|
+
ceilingPrice: number;
|
|
29
|
+
floorPrice: number;
|
|
30
|
+
};
|
|
31
|
+
validateOrder(order: OrderValidationInput): {
|
|
32
|
+
valid: boolean;
|
|
33
|
+
reason?: string;
|
|
34
|
+
code?: OrderRejectCode;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare const VN_SPOT_RULES: MarketRules;
|
|
38
|
+
export declare const CRYPTO_SPOT_RULES: MarketRules;
|
|
39
|
+
/**
|
|
40
|
+
* Phân loại thị trường theo mã: VN30F* -> phái sinh; mã crypto (kết thúc bằng
|
|
41
|
+
* USDT, USDC, USD, BTC, ETH, hoặc chứa "/" hay ":") -> crypto spot; còn lại VN cơ sở.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveMarketProfile(symbol: string): MarketRules;
|
|
44
|
+
/**
|
|
45
|
+
* S4: true when a symbol falls back to VN_SPOT without looking like a VN
|
|
46
|
+
* ticker (exactly 3 A-Z letters). UI shows a fallback banner (override via
|
|
47
|
+
* settings) instead of silently applying lot-100/T+2.
|
|
48
|
+
*/
|
|
49
|
+
export declare function isUnclassifiedMarketSymbol(symbol: string): boolean;
|
|
50
|
+
export declare const VN_DERIVATIVES_RULES: MarketRules;
|
|
51
|
+
/**
|
|
52
|
+
* Task 11: replay-scoped VN rules — VN_SPOT nhưng settlementDays = 0.
|
|
53
|
+
* Lý do: replay mô phỏng chiến thuật, không mô phỏng thanh toán T+2;
|
|
54
|
+
* nếu giữ T+2, TP khớp nến kế tiếp bị throw (available 0), regression nặng
|
|
55
|
+
* so với legacy (đóng ngay). Derivatives T+0 sẵn nên không cần override.
|
|
56
|
+
*/
|
|
57
|
+
export declare const REPLAY_SPOT_RULES: MarketRules;
|
|
58
|
+
export declare const GLOBAL_MARGIN_RULES: MarketRules;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { OrderSide, OrderType, TradingOrder, OrderValidationInput } from "./types";
|
|
2
|
+
import type { ReplayOHLCBar } from "../replay/replayTradingTypes";
|
|
3
|
+
/**
|
|
4
|
+
* P1.2c: nhóm market-like VN (đơn giản hóa có chủ ý, engine full-or-nothing
|
|
5
|
+
* không depth/phiên đấu giá nên MP/MTL/ATO ≡ market, ATC ≡ close — đã khóa test).
|
|
6
|
+
*/
|
|
7
|
+
export declare function isMarketLikeOrderType(type: OrderType): boolean;
|
|
8
|
+
export interface OrderManagementSystemOptions {
|
|
9
|
+
tickSizeProvider?: (symbol: string) => number;
|
|
10
|
+
}
|
|
11
|
+
export interface OrderFill {
|
|
12
|
+
orderId: string;
|
|
13
|
+
symbol: string;
|
|
14
|
+
side: OrderSide;
|
|
15
|
+
fillPrice: number;
|
|
16
|
+
filledQuantity: number;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
}
|
|
19
|
+
export type PlaceOrderRequest = OrderValidationInput & {
|
|
20
|
+
clientOrderId?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare class OrderManagementSystem {
|
|
23
|
+
private readonly tickSizeProvider;
|
|
24
|
+
private readonly orders;
|
|
25
|
+
private readonly trailingPeak;
|
|
26
|
+
private seq;
|
|
27
|
+
constructor(options?: OrderManagementSystemOptions);
|
|
28
|
+
listOrders(): TradingOrder[];
|
|
29
|
+
getOrder(orderId: string): TradingOrder | undefined;
|
|
30
|
+
getTrailingPeaks(): Record<string, number>;
|
|
31
|
+
cancelOrder(orderId: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Sửa giá lệnh working (drag SL/TP — Task 08). Đổi quantity phải
|
|
34
|
+
* cancel + đặt lại (giữ nguyên id cho đường vẽ trên chart).
|
|
35
|
+
*/
|
|
36
|
+
modifyOrder(orderId: string, patch: {
|
|
37
|
+
price?: number;
|
|
38
|
+
stopPrice?: number;
|
|
39
|
+
}): TradingOrder;
|
|
40
|
+
clear(): void;
|
|
41
|
+
/** Hydrate từ storage (Task 06). trailingPeaks persist kèm để SL đã ratchet không tụt sau refresh. */
|
|
42
|
+
restoreState(orders: TradingOrder[], trailingPeaks?: Record<string, number>): void;
|
|
43
|
+
placeOrder(request: PlaceOrderRequest): TradingOrder;
|
|
44
|
+
/**
|
|
45
|
+
* P1.2b: khóa ngày UTC (yyyy-mm-dd) của nến — deterministic, không phụ thuộc
|
|
46
|
+
* timezone runtime. Phiên VN (02:00–08:00 UTC) không bao giờ cắt nửa đêm UTC
|
|
47
|
+
* nên so sánh UTC đúng cho cả HOSE/HNX/UPCOM lẫn crypto 24/7 (ngày UTC).
|
|
48
|
+
*/
|
|
49
|
+
static utcDayKey(date: Date | number): string;
|
|
50
|
+
processBar(symbol: string, bar: ReplayOHLCBar, now?: number): OrderFill[];
|
|
51
|
+
private tickDelta;
|
|
52
|
+
private ratchetTrailing;
|
|
53
|
+
private resolveFill;
|
|
54
|
+
private fillOrder;
|
|
55
|
+
private spawnBracketChildren;
|
|
56
|
+
private addChild;
|
|
57
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ExitReason, PositionSide, TradingPosition } from "./types";
|
|
2
|
+
export interface PositionManagerOptions {
|
|
3
|
+
hedgingMode?: boolean;
|
|
4
|
+
/** Hệ số nhân hợp đồng (phái sinh VN30: 100000). Default 1 cho spot. */
|
|
5
|
+
contractMultiplier?: number;
|
|
6
|
+
/** S5: phương pháp giá vốn cho vị thế MỞ MỚI ("average" mặc định). */
|
|
7
|
+
costBasisMethod?: CostBasisMethod;
|
|
8
|
+
}
|
|
9
|
+
export type CostBasisMethod = "average" | "fifo";
|
|
10
|
+
/** S5: một lô mua/bán của vị thế FIFO (timestamp immutable để audit). */
|
|
11
|
+
export interface PositionLot {
|
|
12
|
+
lotId: string;
|
|
13
|
+
quantity: number;
|
|
14
|
+
price: number;
|
|
15
|
+
timestamp: number;
|
|
16
|
+
}
|
|
17
|
+
export interface OpenPositionRequest {
|
|
18
|
+
symbol: string;
|
|
19
|
+
side: PositionSide;
|
|
20
|
+
quantity: number;
|
|
21
|
+
price: number;
|
|
22
|
+
timestamp: number;
|
|
23
|
+
settlementDate?: number;
|
|
24
|
+
/** S5: commission + tax already charged for this fill. Carried to the close. */
|
|
25
|
+
entryFees?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ClosePositionResult {
|
|
28
|
+
closedQuantity: number;
|
|
29
|
+
realizedPnl: number;
|
|
30
|
+
/**
|
|
31
|
+
* S5: fees charged when this position was OPENED, attributed to the close.
|
|
32
|
+
*
|
|
33
|
+
* `realizedPnl` is the price difference only. The fee for the ENTRY leg was
|
|
34
|
+
* already taken out of cash when the position opened, so a consumer that reports
|
|
35
|
+
* "net P&L for this round trip" has to subtract it too - otherwise the entry fee
|
|
36
|
+
* is missing from the trade record while still being missing from the cash total,
|
|
37
|
+
* and the two never reconcile. That gap was exactly 12,850 on a 100-share FPT
|
|
38
|
+
* round trip, which is what the netPnl invariant test caught.
|
|
39
|
+
*/
|
|
40
|
+
entryFees: number;
|
|
41
|
+
remaining: TradingPosition | null;
|
|
42
|
+
}
|
|
43
|
+
export declare class PositionManager {
|
|
44
|
+
private readonly hedgingMode;
|
|
45
|
+
private readonly multiplier;
|
|
46
|
+
private costBasisMethod;
|
|
47
|
+
private readonly positions;
|
|
48
|
+
/**
|
|
49
|
+
* S5: sidecar FIFO lots keyed by position id (không đụng TradingPosition
|
|
50
|
+
* type → storage tương thích; vị thế mở trước khi bật fifo giữ average).
|
|
51
|
+
*/
|
|
52
|
+
private readonly lots;
|
|
53
|
+
private seq;
|
|
54
|
+
private lotSeq;
|
|
55
|
+
constructor(options?: PositionManagerOptions);
|
|
56
|
+
/** S2/S5: đổi method — chỉ áp dụng vị thế MỞ MỚI (prospective, §10 Q2). */
|
|
57
|
+
setCostBasisMethod(method: CostBasisMethod): void;
|
|
58
|
+
clear(): void;
|
|
59
|
+
/**
|
|
60
|
+
* S5: khớp đóng `quantity` vào các lô cũ nhất, trả realized + cập nhật
|
|
61
|
+
* entryPrice = bình quân gia quyền các lô còn lại (giữ updateMarkPrice
|
|
62
|
+
* và mọi công thức hiển thị nguyên vẹn ở cả 2 mode).
|
|
63
|
+
*/
|
|
64
|
+
private matchCloseLots;
|
|
65
|
+
private trackLot;
|
|
66
|
+
/** Hydrate từ storage (Task 06). */
|
|
67
|
+
restoreState(positions: TradingPosition[]): void;
|
|
68
|
+
listPositions(): TradingPosition[];
|
|
69
|
+
getPositionById(positionId: string): TradingPosition | undefined;
|
|
70
|
+
getPosition(symbol: string): TradingPosition | undefined;
|
|
71
|
+
openPosition(request: OpenPositionRequest): TradingPosition;
|
|
72
|
+
private offsetOpposite;
|
|
73
|
+
private createPosition;
|
|
74
|
+
closePosition(positionId: string, quantity: number, exitPrice: number, timestamp: number, _reason?: ExitReason, options?: {
|
|
75
|
+
enforceAvailable?: boolean;
|
|
76
|
+
}): ClosePositionResult;
|
|
77
|
+
updateMarkPrice(symbol: string, price: number, timestamp: number): void;
|
|
78
|
+
applySettlement(now: number): void;
|
|
79
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BrokerAccount, OrderRejectCode, OrderValidationInput, TradingPosition } from "./types";
|
|
2
|
+
import type { MarketRules } from "./MarketRules";
|
|
3
|
+
export interface MarginRequirement {
|
|
4
|
+
vsdMargin: number;
|
|
5
|
+
totalRequiredMargin: number;
|
|
6
|
+
}
|
|
7
|
+
export interface RiskValidationResult {
|
|
8
|
+
valid: boolean;
|
|
9
|
+
rejectCode?: OrderRejectCode;
|
|
10
|
+
reason?: string;
|
|
11
|
+
requiredMargin?: number;
|
|
12
|
+
availableBuyingPower?: number;
|
|
13
|
+
}
|
|
14
|
+
export type AccountRiskStatus = "safe" | "warning" | "call_margin" | "liquidation";
|
|
15
|
+
export interface AccountRiskAssessment {
|
|
16
|
+
status: AccountRiskStatus;
|
|
17
|
+
marginLevelPercent: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class RiskEngine {
|
|
20
|
+
/**
|
|
21
|
+
* Ký quỹ cho một lệnh/vị thế. Spot = tiền mặt đủ giá trị (vsd = 0);
|
|
22
|
+
* derivatives/margin tách vsdMargin và totalRequiredMargin (F-01).
|
|
23
|
+
*/
|
|
24
|
+
calculateOrderMargin(order: {
|
|
25
|
+
quantity: number;
|
|
26
|
+
}, rules: MarketRules, price: number): MarginRequirement;
|
|
27
|
+
validateOrderRisk(order: OrderValidationInput, account: BrokerAccount, rules: MarketRules, markPrice?: number, currentPosition?: TradingPosition): RiskValidationResult;
|
|
28
|
+
/**
|
|
29
|
+
* Ký quỹ TĂNG THÊM của lệnh (Trap 2): lệnh đóng/giảm vị thế được miễn
|
|
30
|
+
* (giải phóng ký quỹ thay vì chiếm thêm); đảo chiều chỉ tính phần dôi.
|
|
31
|
+
*/
|
|
32
|
+
private additionalMargin;
|
|
33
|
+
recalculateAccount(account: BrokerAccount, positions: TradingPosition[], rules: MarketRules, markPrices: Record<string, number>): BrokerAccount;
|
|
34
|
+
evaluateAccountRisk(account: BrokerAccount): AccountRiskAssessment;
|
|
35
|
+
/**
|
|
36
|
+
* Giá thanh lý ước tính: balance + (liq-entry)*dir*qty*mult = 50% * marginUsed.
|
|
37
|
+
* Spot (không đòn bẩy) trả +Infinity — không bao giờ thanh lý.
|
|
38
|
+
*/
|
|
39
|
+
calculateLiquidationPrice(position: TradingPosition, account: BrokerAccount, rules: MarketRules): number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class SettlementCalendar {
|
|
2
|
+
private static holidaysVN;
|
|
3
|
+
static configure(holidaysVN: string[]): void;
|
|
4
|
+
static isTradingDay(date: Date): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Timestamp chứng khoán về khả dụng. T+0 trả ngay; T+N cộng N ngày giao dịch
|
|
7
|
+
* rồi chốt 13:00 ngày cuối (giờ địa phương, tránh lệch TZ của toISOString).
|
|
8
|
+
*/
|
|
9
|
+
static calculateSettlementTimestamp(tradeTimestamp: number, settlementDays?: number): number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { AsyncStorageAdapter } from "@vninvestcharts/engine-react";
|
|
2
|
+
import type { BrokerAccount, ExecutionTicket, OrderValidationInput, TradingOrder, TradingPosition } from "./types";
|
|
3
|
+
import type { ClosePositionOptions, IBrokerAPI, PlaceOrderOptions, TradingEventCallback, TradingEventKey } from "./BrokerAPI";
|
|
4
|
+
import type { MarketRules } from "./MarketRules";
|
|
5
|
+
import type { ReplayOHLCBar } from "../replay/replayTradingTypes";
|
|
6
|
+
import type { IMarketDataPort } from "./MarketDataPort";
|
|
7
|
+
import { type ExecutionSimulatorOptions } from "./ExecutionSimulator";
|
|
8
|
+
import { type TradingAnalytics } from "./AnalyticsEngine";
|
|
9
|
+
export interface VirtualBrokerOptions {
|
|
10
|
+
rules: MarketRules;
|
|
11
|
+
marketDataPort?: IMarketDataPort;
|
|
12
|
+
storageAdapter?: AsyncStorageAdapter;
|
|
13
|
+
storageNamespace?: string;
|
|
14
|
+
initialBalance?: number;
|
|
15
|
+
simulatorOptions?: ExecutionSimulatorOptions;
|
|
16
|
+
hedgingMode?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* P1.1 (D-01 live-fill, verdict-scoped): khi true, lệnh market khớp ngay
|
|
19
|
+
* tại mark price hiện tại qua synthetic tick-bar (tái dùng toàn bộ pipeline
|
|
20
|
+
* onBar: matching/settlement/analytics/events — 0 logic khớp mới, 0 đụng OMS).
|
|
21
|
+
* CHỈ bật cho live paper broker. Default false: backtest/replay/standalone
|
|
22
|
+
* giữ quy ước fill-open-nến-kế chống lookahead (OMS test khóa).
|
|
23
|
+
*/
|
|
24
|
+
fillMarketOnPlace?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface BrokerRuntimePatch {
|
|
27
|
+
/** Merged rules copy (never a shared frozen constant — see applyRuntimeConfig). */
|
|
28
|
+
rules?: MarketRules;
|
|
29
|
+
simulatorOptions?: ExecutionSimulatorOptions;
|
|
30
|
+
}
|
|
31
|
+
export interface BrokerRuntimeSummary {
|
|
32
|
+
appliedAt: number;
|
|
33
|
+
profile: string;
|
|
34
|
+
simulator: Required<ExecutionSimulatorOptions>;
|
|
35
|
+
}
|
|
36
|
+
export declare class VirtualBrokerEngine implements IBrokerAPI {
|
|
37
|
+
private rules;
|
|
38
|
+
private readonly fillMarketOnPlace;
|
|
39
|
+
private readonly port?;
|
|
40
|
+
private readonly oms;
|
|
41
|
+
private readonly pms;
|
|
42
|
+
private readonly risk;
|
|
43
|
+
private readonly sim;
|
|
44
|
+
private readonly settlement;
|
|
45
|
+
private readonly analytics;
|
|
46
|
+
private readonly bus;
|
|
47
|
+
private readonly storage;
|
|
48
|
+
private account;
|
|
49
|
+
private history;
|
|
50
|
+
private readonly lastClose;
|
|
51
|
+
private rejSeq;
|
|
52
|
+
constructor(options: VirtualBrokerOptions);
|
|
53
|
+
private static freshAccount;
|
|
54
|
+
getAccount(): BrokerAccount;
|
|
55
|
+
getPositions(): TradingPosition[];
|
|
56
|
+
/** Task 11: lookup trực tiếp cho rewired hooks (markers/panel join). */
|
|
57
|
+
getPositionById(positionId: string): TradingPosition | undefined;
|
|
58
|
+
getOrders(): TradingOrder[];
|
|
59
|
+
getHistory(): ExecutionTicket[];
|
|
60
|
+
getAnalytics(): TradingAnalytics;
|
|
61
|
+
on<K extends TradingEventKey>(event: K, callback: TradingEventCallback<K>): () => void;
|
|
62
|
+
private markPrice;
|
|
63
|
+
private books;
|
|
64
|
+
placeOrder(input: OrderValidationInput, options?: PlaceOrderOptions): TradingOrder;
|
|
65
|
+
cancelOrder(orderId: string): boolean;
|
|
66
|
+
modifyOrder(orderId: string, patch: {
|
|
67
|
+
price?: number;
|
|
68
|
+
stopPrice?: number;
|
|
69
|
+
quantity?: number;
|
|
70
|
+
}): TradingOrder;
|
|
71
|
+
closePosition(positionId: string, options?: ClosePositionOptions): boolean;
|
|
72
|
+
closeAllPositions(reason?: string, symbol?: string): number;
|
|
73
|
+
private rejected;
|
|
74
|
+
onBar(symbol: string, bar: ReplayOHLCBar, now?: number): void;
|
|
75
|
+
private exitReasonOf;
|
|
76
|
+
updateMarkPrice(symbol: string, price: number): void;
|
|
77
|
+
resetAccount(initialBalance?: number): void;
|
|
78
|
+
/**
|
|
79
|
+
* S2: apply runtime config without recreating the broker. Positions,
|
|
80
|
+
* orders, WS subscriptions and booked history survive; only NEW fills use
|
|
81
|
+
* the updated pricing/rules (prospective-only, §10 Q2). The rules object
|
|
82
|
+
* must be a private merged copy — never a shared frozen constant.
|
|
83
|
+
*/
|
|
84
|
+
applyRuntimeConfig(patch: BrokerRuntimePatch): BrokerRuntimeSummary;
|
|
85
|
+
flush(): Promise<void>;
|
|
86
|
+
hydrate(): Promise<boolean>;
|
|
87
|
+
private hydrated;
|
|
88
|
+
private syncAccount;
|
|
89
|
+
private persist;
|
|
90
|
+
private afterMutation;
|
|
91
|
+
private emitAll;
|
|
92
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { MarketRules } from "./MarketRules";
|
|
2
|
+
import type { TradingOrder, TradingPosition } from "./types";
|
|
3
|
+
export declare function workingOrdersMargin(orders: TradingOrder[], positions: TradingPosition[], rules: MarketRules, markPrices: Record<string, number>): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AsyncStorageAdapter } from "@vninvestcharts/engine-react";
|
|
2
|
+
export declare class InMemoryStorageAdapter implements AsyncStorageAdapter {
|
|
3
|
+
private readonly store;
|
|
4
|
+
getItem(key: string): Promise<string | null>;
|
|
5
|
+
setItem(key: string, value: string): Promise<void>;
|
|
6
|
+
removeItem(key: string): Promise<void>;
|
|
7
|
+
clear(): Promise<void>;
|
|
8
|
+
getAllKeys(): Promise<string[]>;
|
|
9
|
+
getSize(): Promise<number>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AsyncStorageAdapter } from "@vninvestcharts/engine-react";
|
|
2
|
+
import type { ClosedTradeRecord, EquityPoint } from "../AnalyticsEngine";
|
|
3
|
+
import type { BrokerAccount, ExecutionTicket, TradingOrder, TradingPosition } from "../types";
|
|
4
|
+
export declare const TRADING_STORAGE_VERSION = 2;
|
|
5
|
+
export interface SerializedTradingState {
|
|
6
|
+
version: number;
|
|
7
|
+
savedAt: number;
|
|
8
|
+
account: BrokerAccount;
|
|
9
|
+
orders: TradingOrder[];
|
|
10
|
+
positions: TradingPosition[];
|
|
11
|
+
trailingPeaks: Record<string, number>;
|
|
12
|
+
history: ExecutionTicket[];
|
|
13
|
+
closedTrades: ClosedTradeRecord[];
|
|
14
|
+
equityCurve: EquityPoint[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* S6: version-2 state. `config` carries the user runtime config snapshot
|
|
18
|
+
* (fee/tax/slippage/leverage/method/display, see PaperRuntimeConfig —
|
|
19
|
+
* Record-typed here to keep lib/ independent of widget/ imports).
|
|
20
|
+
* `isChartOverride` marks per-chart override ledgers (Tier 3).
|
|
21
|
+
*/
|
|
22
|
+
export interface TradingStateV2 extends SerializedTradingState {
|
|
23
|
+
version: 2;
|
|
24
|
+
config?: Record<string, unknown>;
|
|
25
|
+
isChartOverride?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class TradingStorage {
|
|
28
|
+
private readonly adapter;
|
|
29
|
+
private readonly storageKey;
|
|
30
|
+
constructor(adapter: AsyncStorageAdapter, storageKey?: string);
|
|
31
|
+
saveState(state: SerializedTradingState): Promise<void>;
|
|
32
|
+
loadState(): Promise<TradingStateV2 | null>;
|
|
33
|
+
clearState(): Promise<void>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export type OrderSide = "buy" | "sell";
|
|
2
|
+
export type OrderType = "market" | "limit" | "stop" | "stop_limit" | "trailing_stop"
|
|
3
|
+
/** P1.2c VN: ATO/ATC (khớp giá mở/đóng phiên), MP/MTL (market khớp ngay). */
|
|
4
|
+
| "ato" | "atc" | "mp" | "mtl"
|
|
5
|
+
/** PLO (Post Limit Order) — khớp lệnh dư chuyển LO phiên sau (đơn giản hóa: LO). */
|
|
6
|
+
| "plo";
|
|
7
|
+
export type OrderStatus = "pending" | "working" | "filled" | "partially_filled" | "cancelled" | "rejected" | "expired";
|
|
8
|
+
export type TimeInForce = "GTC" | "DAY" | "IOC" | "FOK";
|
|
9
|
+
export type PositionSide = "long" | "short";
|
|
10
|
+
export type ExitReason = "tp" | "sl" | "trailing_stop" | "manual" | "liquidation" | "session_end";
|
|
11
|
+
export type OrderRejectCode = "UNSUPPORTED_TIF" | "UNSUPPORTED_ORDER_TYPE" | "INSUFFICIENT_BUYING_POWER" | "INVALID_QUANTITY" | "INVALID_PRICE" | "SHORT_NOT_ALLOWED" | "PRICE_OUT_OF_BAND";
|
|
12
|
+
export interface BracketOrderSpec {
|
|
13
|
+
takeProfitPrice?: number;
|
|
14
|
+
stopLossPrice?: number;
|
|
15
|
+
trailingStopDeltaTicks?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface TradingOrder {
|
|
18
|
+
id: string;
|
|
19
|
+
clientOrderId: string;
|
|
20
|
+
symbol: string;
|
|
21
|
+
side: OrderSide;
|
|
22
|
+
type: OrderType;
|
|
23
|
+
status: OrderStatus;
|
|
24
|
+
quantity: number;
|
|
25
|
+
filledQuantity: number;
|
|
26
|
+
price?: number;
|
|
27
|
+
stopPrice?: number;
|
|
28
|
+
bracket?: BracketOrderSpec;
|
|
29
|
+
timeInForce: TimeInForce;
|
|
30
|
+
/**
|
|
31
|
+
* P1.2b: ngày UTC (yyyy-mm-dd) của nến đầu tiên xử lý lệnh DAY — lười gán
|
|
32
|
+
* tại processBar đầu tiên để deterministic trong test và đúng phiên
|
|
33
|
+
* VN (phiên không bao giờ cắt nửa đêm UTC). null = chưa gặp nến nào.
|
|
34
|
+
*/
|
|
35
|
+
dayKey?: string | null;
|
|
36
|
+
parentOrderId?: string;
|
|
37
|
+
rejectCode?: OrderRejectCode;
|
|
38
|
+
createdAt: number;
|
|
39
|
+
updatedAt: number;
|
|
40
|
+
}
|
|
41
|
+
export interface TradingPosition {
|
|
42
|
+
id: string;
|
|
43
|
+
symbol: string;
|
|
44
|
+
side: PositionSide;
|
|
45
|
+
quantity: number;
|
|
46
|
+
availableQuantity: number;
|
|
47
|
+
entryPrice: number;
|
|
48
|
+
currentPrice: number;
|
|
49
|
+
unrealizedPnl: number;
|
|
50
|
+
realizedPnl: number;
|
|
51
|
+
/**
|
|
52
|
+
* S5: commission + tax charged when this position was opened.
|
|
53
|
+
*
|
|
54
|
+
* Those fees left cash at entry time, so they belong to the round trip that closes
|
|
55
|
+
* here. Without them a "net P&L" per trade is short by the entry fee while the cash
|
|
56
|
+
* total has already paid it - the two never reconcile. Pro-rated on a partial close.
|
|
57
|
+
*/
|
|
58
|
+
entryFees?: number;
|
|
59
|
+
settlementDate?: number;
|
|
60
|
+
liquidationPrice?: number;
|
|
61
|
+
createdAt: number;
|
|
62
|
+
updatedAt: number;
|
|
63
|
+
}
|
|
64
|
+
export interface ExecutionTicket {
|
|
65
|
+
orderId: string;
|
|
66
|
+
symbol: string;
|
|
67
|
+
side: OrderSide;
|
|
68
|
+
fillPrice: number;
|
|
69
|
+
fillQuantity: number;
|
|
70
|
+
commission: number;
|
|
71
|
+
tax: number;
|
|
72
|
+
pnl: number;
|
|
73
|
+
exitReason?: ExitReason;
|
|
74
|
+
timestamp: number;
|
|
75
|
+
ambiguousIntrabarFill?: boolean;
|
|
76
|
+
tieBreakReason?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface BrokerAccount {
|
|
79
|
+
accountId: string;
|
|
80
|
+
balance: number;
|
|
81
|
+
equity: number;
|
|
82
|
+
marginUsed: number;
|
|
83
|
+
freeMargin: number;
|
|
84
|
+
buyingPower: number;
|
|
85
|
+
currency: string;
|
|
86
|
+
pnl: number;
|
|
87
|
+
pnlPercent: number;
|
|
88
|
+
}
|
|
89
|
+
export interface OrderValidationInput {
|
|
90
|
+
symbol: string;
|
|
91
|
+
side: OrderSide;
|
|
92
|
+
type: OrderType;
|
|
93
|
+
quantity: number;
|
|
94
|
+
price?: number;
|
|
95
|
+
stopPrice?: number;
|
|
96
|
+
bracket?: BracketOrderSpec;
|
|
97
|
+
timeInForce?: TimeInForce;
|
|
98
|
+
isClosingPosition?: boolean;
|
|
99
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface VisibleRange {
|
|
2
|
+
startIndex: number;
|
|
3
|
+
endIndex: number;
|
|
4
|
+
startDate: Date | number;
|
|
5
|
+
endDate: Date | number;
|
|
6
|
+
timeRange: {
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
};
|
|
10
|
+
barCount: number;
|
|
11
|
+
relativePosition?: {
|
|
12
|
+
startRatio: number;
|
|
13
|
+
spanRatio: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type VisibleRangeSource = "pan" | "zoom" | "programmatic";
|
|
17
|
+
export interface ChartHandle {
|
|
18
|
+
scrollToIndex(index: number, align?: "left" | "center" | "right"): void;
|
|
19
|
+
zoomToRange(startIndex: number, endIndex: number): void;
|
|
20
|
+
scrollToDate(date: Date, align?: "left" | "center" | "right"): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type IndicatorCategory = "trend" | "momentum" | "volatility" | "orderflow" | "strength" | "volume";
|
|
2
|
+
export type RepaintPolicy = "no-repaint" | "repaint-on-close" | "repaint-always";
|
|
3
|
+
export type PanePolicy = "overlay" | "separate" | "either";
|
|
4
|
+
export type ScalePolicy = "percent" | "price" | "normalized" | "volume";
|
|
5
|
+
export interface SeriesSettingField {
|
|
6
|
+
key: string;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
type: "number" | "text" | "color" | "select";
|
|
9
|
+
defaultValue: number | string;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
step?: number;
|
|
13
|
+
options?: {
|
|
14
|
+
value: string;
|
|
15
|
+
labelKey: string;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export interface IndicatorCatalogEntry {
|
|
19
|
+
id: string;
|
|
20
|
+
displayName?: {
|
|
21
|
+
vi: string;
|
|
22
|
+
en: string;
|
|
23
|
+
};
|
|
24
|
+
description?: {
|
|
25
|
+
vi: string;
|
|
26
|
+
en: string;
|
|
27
|
+
};
|
|
28
|
+
category?: IndicatorCategory;
|
|
29
|
+
tags?: string[];
|
|
30
|
+
inputSchema?: readonly SeriesSettingField[];
|
|
31
|
+
outputSchema?: {
|
|
32
|
+
type: "scalar" | "band" | "histogram" | "macd" | "stochastic";
|
|
33
|
+
fields?: readonly string[];
|
|
34
|
+
};
|
|
35
|
+
panePolicy?: PanePolicy;
|
|
36
|
+
scalePolicy?: ScalePolicy;
|
|
37
|
+
repaintPolicy?: RepaintPolicy;
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PaneDescriptor } from "./pane-descriptor";
|
|
2
|
+
export interface IndicatorSet {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
createdAt: number;
|
|
6
|
+
updatedAt: number;
|
|
7
|
+
panes: readonly PaneDescriptor[];
|
|
8
|
+
isBuiltin?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface IndicatorSetsStorage {
|
|
11
|
+
version: 1;
|
|
12
|
+
sets: readonly IndicatorSet[];
|
|
13
|
+
}
|
|
14
|
+
export interface IndicatorSetStorageLike {
|
|
15
|
+
getItem: (key: string) => string | null;
|
|
16
|
+
setItem: (key: string, value: string) => void;
|
|
17
|
+
removeItem: (key: string) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const INDICATOR_SETS_STORAGE_KEY = "vnsc:indicator-sets-v1";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type SeriesTypeId = "Candlestick" | "HollowCandle" | "OHLC" | "HeikinAshi" | "Line" | "Area" | "Volume" | "Histogram" | "Baseline" | "Renko" | "Kagi" | "PointAndFigure" | "LineBreak" | "EMA" | "BollingerBand" | "RSI" | "MACD" | "CVDApprox" | "CVDRealtime" | "StrengthElder" | "StrengthRelative" | "Whale" | "MA" | "BBI" | "SAR" | "OBV" | "WR" | "VR" | "KDJ" | "CCI" | "DMI" | "BIAS" | "BRAR" | "MTM" | "EMV" | "AO" | "ROC" | "TRIX" | "DMA" | "PVT" | "PSY" | "CR" | "WMA" | "VWMA" | "HMA" | "DEMA" | "TEMA" | "MARibbon" | "Ichimoku" | "Supertrend" | "Keltner" | "Donchian" | "ChaikinVol" | "StdDev" | "HV" | "CI" | "CMF" | "ChaikinOscillator" | "MFI" | "VolOsc" | "VWAP" | "AnchoredVWAP" | "Alligator" | "Fractals" | "Gator" | "AC" | "PivotStandard" | "PivotHighLow" | "MarketProfile" | "VolumeProfile" | "Footprint" | "DeltaProfile" | "SMFI" | "WyckoffWave" | (string & {});
|
|
2
|
+
export type YAxisSide = "left" | "right";
|
|
3
|
+
/**
|
|
4
|
+
* Canonicalize legacy series-type aliases to their canonical SeriesTypeId.
|
|
5
|
+
* Currently only "BollingerBands" (plural, exposed historically via the
|
|
6
|
+
* SeriesRegistry demo alias + settings composer) → "BollingerBand".
|
|
7
|
+
* Central SSOT so compute/resolve/render/label paths cannot diverge again.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeSeriesTypeId(type: SeriesTypeId): SeriesTypeId;
|
|
10
|
+
export interface SeriesConfig {
|
|
11
|
+
id?: string;
|
|
12
|
+
type: SeriesTypeId;
|
|
13
|
+
params?: Record<string, unknown>;
|
|
14
|
+
yAxis: YAxisSide;
|
|
15
|
+
/** Optional explicit scale-slot id for native-style grouping. */
|
|
16
|
+
scaleSlotId?: string;
|
|
17
|
+
overlay?: boolean;
|
|
18
|
+
color?: string;
|
|
19
|
+
lineWidth?: number;
|
|
20
|
+
lineStyle?: "solid" | "dashed" | "dotted";
|
|
21
|
+
/** Per-component color overrides for multi-line indicators (MACD, BB, KDJ, …) */
|
|
22
|
+
subColors?: Record<string, string>;
|
|
23
|
+
visible?: boolean;
|
|
24
|
+
sourceType?: "price" | "indicator";
|
|
25
|
+
sourceId?: string;
|
|
26
|
+
sourceKey?: string;
|
|
27
|
+
overlaySymbolId?: string;
|
|
28
|
+
normalizeToBaseline?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type TooltipMode = "ohlc" | "value" | "none";
|
|
31
|
+
export interface PaneDescriptor {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
pinned: boolean;
|
|
35
|
+
visible: boolean;
|
|
36
|
+
heightRatio: number;
|
|
37
|
+
series: SeriesConfig[];
|
|
38
|
+
splitScale: boolean;
|
|
39
|
+
tooltip: TooltipMode;
|
|
40
|
+
/** Optional per-pane minimum height (px). Fallback to getPaneMinHeight() */
|
|
41
|
+
minHeight?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const PANE_LAYOUT_STORAGE_KEY = "rsc-pane-layout-v2";
|
|
44
|
+
export declare const PANE_MAX_VISIBLE = 5;
|
|
45
|
+
export declare const DEFAULT_PANES: PaneDescriptor[];
|
|
46
|
+
export declare function isDefaultPaneId(id: string): boolean;
|