@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,62 @@
|
|
|
1
|
+
export type ReplaySpeed = 0.5 | 1 | 2 | 5 | 10 | "max";
|
|
2
|
+
/** SSOT: user-facing replay speeds (excluding internal "max") */
|
|
3
|
+
export declare const REPLAY_SPEEDS: readonly Exclude<ReplaySpeed, "max">[];
|
|
4
|
+
export interface ReplayBarLike {
|
|
5
|
+
date: Date | number;
|
|
6
|
+
}
|
|
7
|
+
export interface BarReplayState<T extends ReplayBarLike> {
|
|
8
|
+
allData: readonly T[];
|
|
9
|
+
currentIndex: number;
|
|
10
|
+
speed: ReplaySpeed;
|
|
11
|
+
isPlaying: boolean;
|
|
12
|
+
visibleData: readonly T[];
|
|
13
|
+
currentBar?: T;
|
|
14
|
+
progress: number;
|
|
15
|
+
canStepBack: boolean;
|
|
16
|
+
canStepForward: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface BarReplayControllerOptions<T extends ReplayBarLike> {
|
|
19
|
+
allData: readonly T[];
|
|
20
|
+
startIndex?: number;
|
|
21
|
+
speed?: ReplaySpeed;
|
|
22
|
+
baseIntervalMs?: number;
|
|
23
|
+
maxIntervalMs?: number;
|
|
24
|
+
}
|
|
25
|
+
type ReplayListener<T extends ReplayBarLike> = (state: BarReplayState<T>) => void;
|
|
26
|
+
export declare class BarReplayController<T extends ReplayBarLike> {
|
|
27
|
+
private allData;
|
|
28
|
+
private currentIndex;
|
|
29
|
+
private speed;
|
|
30
|
+
private baseIntervalMs;
|
|
31
|
+
private maxIntervalMs;
|
|
32
|
+
private isPlaying;
|
|
33
|
+
private timer;
|
|
34
|
+
private readonly listeners;
|
|
35
|
+
constructor(options: BarReplayControllerOptions<T>);
|
|
36
|
+
getState(): BarReplayState<T>;
|
|
37
|
+
getVisibleData(): readonly T[];
|
|
38
|
+
getCurrentBar(): T | undefined;
|
|
39
|
+
isPlayingNow(): boolean;
|
|
40
|
+
getCurrentIndex(): number;
|
|
41
|
+
getSpeed(): ReplaySpeed;
|
|
42
|
+
setData(allData: readonly T[], startIndex?: number): void;
|
|
43
|
+
setSpeed(speed: ReplaySpeed): void;
|
|
44
|
+
play(): void;
|
|
45
|
+
pause(): void;
|
|
46
|
+
toggle(): void;
|
|
47
|
+
stepForward(): void;
|
|
48
|
+
stepBack(): void;
|
|
49
|
+
jumpToIndex(barIndex: number): void;
|
|
50
|
+
jumpToLatest(): void;
|
|
51
|
+
jumpToDate(date: Date | number): void;
|
|
52
|
+
rewind(): void;
|
|
53
|
+
dispose(): void;
|
|
54
|
+
subscribe(listener: ReplayListener<T>): () => void;
|
|
55
|
+
private tick;
|
|
56
|
+
private finish;
|
|
57
|
+
private scheduleTimer;
|
|
58
|
+
private restartTimer;
|
|
59
|
+
private clearTimer;
|
|
60
|
+
private emit;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReplayEventBus — cross-instance replay synchronization via CustomEvent.
|
|
3
|
+
*
|
|
4
|
+
* Protocol (active types only):
|
|
5
|
+
* - MASTER_ANNOUNCE: chart announces itself as master
|
|
6
|
+
* - REPLAY_SEEK: master seeked to a specific barIndex+timestamp
|
|
7
|
+
* - REPLAY_START: master started playing from a bar (slaves catch up at once)
|
|
8
|
+
* - REPLAY_TOGGLE: replay was toggled on/off
|
|
9
|
+
* - REPLAY_END: replay session ended or sync toggled off
|
|
10
|
+
*
|
|
11
|
+
* Channel namespace: "vninvestcharts-widget-replay-"
|
|
12
|
+
* Transport: window CustomEvent
|
|
13
|
+
*/
|
|
14
|
+
export declare const REPLAY_EVENT_NS: "vninvestcharts-widget-replay";
|
|
15
|
+
export type ReplayEventType = "MASTER_ANNOUNCE" | "REPLAY_SEEK" | "REPLAY_START" | "REPLAY_TOGGLE" | "REPLAY_END";
|
|
16
|
+
export interface ReplayEventBase {
|
|
17
|
+
type: ReplayEventType;
|
|
18
|
+
chartId: string;
|
|
19
|
+
timestamp: number;
|
|
20
|
+
/** F-S2: Alt+click forceBroadcast — slave handler treats this as authoritative master regardless of election. */
|
|
21
|
+
forceBroadcast?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface MasterAnnounceEvent extends ReplayEventBase {
|
|
24
|
+
type: "MASTER_ANNOUNCE";
|
|
25
|
+
tf: string;
|
|
26
|
+
barIndex: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ReplaySeekEvent extends ReplayEventBase {
|
|
29
|
+
type: "REPLAY_SEEK";
|
|
30
|
+
barIndex: number;
|
|
31
|
+
currentBarDate: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* R1-c: master started playing — slaves catch up immediately (cursor +
|
|
35
|
+
* camera) instead of waiting for the first tick. Fire-and-forget.
|
|
36
|
+
*/
|
|
37
|
+
export interface ReplayStartEvent extends ReplayEventBase {
|
|
38
|
+
type: "REPLAY_START";
|
|
39
|
+
startTimestamp: number;
|
|
40
|
+
}
|
|
41
|
+
export interface ReplayToggleEvent extends ReplayEventBase {
|
|
42
|
+
type: "REPLAY_TOGGLE";
|
|
43
|
+
playing: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface ReplayEndEvent extends ReplayEventBase {
|
|
46
|
+
type: "REPLAY_END";
|
|
47
|
+
}
|
|
48
|
+
export type ReplayBusEvent = MasterAnnounceEvent | ReplaySeekEvent | ReplayStartEvent | ReplayToggleEvent | ReplayEndEvent;
|
|
49
|
+
export type ReplayEventHandler = (event: ReplayBusEvent) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Parse timeframe string to minutes for master election (lower = more granular = master).
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseReplayTimeframeToMinutes(tf: string): number;
|
|
54
|
+
/**
|
|
55
|
+
* Subscribe to a specific replay event type on the window.
|
|
56
|
+
* Returns an unsubscribe function.
|
|
57
|
+
*/
|
|
58
|
+
export declare function onReplayEvent(type: ReplayEventType, handler: ReplayEventHandler, instanceId?: string): () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Emit a replay event on the window.
|
|
61
|
+
* The event payload is serialized as CustomEvent.detail.
|
|
62
|
+
*/
|
|
63
|
+
export declare function emitReplayEvent(event: ReplayBusEvent, instanceId?: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Subscribe to ALL replay event types on the window.
|
|
66
|
+
* Returns an unsubscribe function.
|
|
67
|
+
*/
|
|
68
|
+
export declare function onAnyReplayEvent(handler: ReplayEventHandler, instanceId?: string): () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FillResult, ReplayOHLCBar, ReplayOrder } from "./replayTradingTypes";
|
|
2
|
+
export interface ReplayFillSimulatorOptions {
|
|
3
|
+
useOHLC?: boolean;
|
|
4
|
+
/** H2 v2: use spread-aware fills (buy at high/ask, sell at low/bid) instead of single price + bps.
|
|
5
|
+
* Default true for realistic fills. When false, uses legacy behavior (close price + slippageBps). */
|
|
6
|
+
useSpreadFill?: boolean;
|
|
7
|
+
/** H2: simple slippage (bps). buy = +, sell = -. Applied as buffer on top of spread fill.
|
|
8
|
+
* Default 0 (no extra slippage). When useSpreadFill=true, this is added to high/low. */
|
|
9
|
+
slippageBps?: number;
|
|
10
|
+
/** F-03: when true, triggered limit/stop orders fill at next bar's open instead of trigger bar.
|
|
11
|
+
* Default false (retail convention: fill at trigger price/high/low). */
|
|
12
|
+
fillOnNextBar?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class ReplayFillSimulator {
|
|
15
|
+
private useOHLC;
|
|
16
|
+
private slippageBps;
|
|
17
|
+
readonly fillOnNextBar: boolean;
|
|
18
|
+
constructor(options?: ReplayFillSimulatorOptions);
|
|
19
|
+
simulateFill(order: ReplayOrder, bar: ReplayOHLCBar, now: number): FillResult;
|
|
20
|
+
private fillMarket;
|
|
21
|
+
private fillLimit;
|
|
22
|
+
private fillStop;
|
|
23
|
+
private resolveMarketPrice;
|
|
24
|
+
/** F-03: check if order would trigger on this bar (without filling). Used by fillOnNextBar mode. */
|
|
25
|
+
checkTrigger(order: ReplayOrder, bar: ReplayOHLCBar): boolean;
|
|
26
|
+
/** F-03: fill triggered order at next bar's open (± slippage). Fallback to close if open unavailable. */
|
|
27
|
+
resolveFillFromNextBar(order: ReplayOrder, nextBar: ReplayOHLCBar, now: number): FillResult;
|
|
28
|
+
/** F-01: apply configured slippage to a base price adverse to the given side. buy = +, sell = -. */
|
|
29
|
+
applySlippage(side: "buy" | "sell", base: number): number;
|
|
30
|
+
private filled;
|
|
31
|
+
private pending;
|
|
32
|
+
private reject;
|
|
33
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FillResult, ReplayOHLCBar, ReplayOrder } from "./replayTradingTypes";
|
|
2
|
+
import { ReplayFillSimulator } from "./ReplayFillSimulator";
|
|
3
|
+
import { ReplayPositionManager } from "./ReplayPositionManager";
|
|
4
|
+
export declare class ReplayOrderBook {
|
|
5
|
+
private orders;
|
|
6
|
+
private filledOrders;
|
|
7
|
+
private cancelledOrders;
|
|
8
|
+
private pendingTriggers;
|
|
9
|
+
private fillSimulator;
|
|
10
|
+
private positionManager;
|
|
11
|
+
private realisticSlTpFill;
|
|
12
|
+
private nextOrderId;
|
|
13
|
+
constructor(fillSimulator?: ReplayFillSimulator, positionManager?: ReplayPositionManager, realisticSlTpFill?: boolean);
|
|
14
|
+
addOrder(order: Omit<ReplayOrder, "id">): ReplayOrder;
|
|
15
|
+
cancelOrder(orderId: string): boolean;
|
|
16
|
+
processBar(bar: ReplayOHLCBar, barIndex: number, now: number): FillResult[];
|
|
17
|
+
private resolveRealisticSlTpFill;
|
|
18
|
+
private handleNewPositionOrder;
|
|
19
|
+
private handleReduceOnlyOrder;
|
|
20
|
+
getOpenOrders(): ReplayOrder[];
|
|
21
|
+
getFilledOrders(): ReplayOrder[];
|
|
22
|
+
getPositionManager(): ReplayPositionManager;
|
|
23
|
+
reset(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReplayExecutedTrade, ReplayPosition } from "./replayTradingTypes";
|
|
2
|
+
export interface TriggeredSLTP {
|
|
3
|
+
positionId: string;
|
|
4
|
+
reason: "tp" | "sl";
|
|
5
|
+
fillPrice: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class ReplayPositionManager {
|
|
8
|
+
private positions;
|
|
9
|
+
private closedTrades;
|
|
10
|
+
private nextId;
|
|
11
|
+
openPosition(side: "long" | "short", quantity: number, price: number, barIndex: number, timestamp: number, stopLoss?: number, takeProfit?: number, symbol?: string, feeRate?: number): ReplayPosition;
|
|
12
|
+
closePosition(positionId: string, exitPrice: number, barIndex: number, exitReason: "tp" | "sl" | "manual" | "session-end", timestamp?: number): ReplayExecutedTrade | null;
|
|
13
|
+
updateCurrentPrice(bar: {
|
|
14
|
+
high: number;
|
|
15
|
+
low: number;
|
|
16
|
+
close: number;
|
|
17
|
+
}): void;
|
|
18
|
+
checkStopLossTakeProfit(bar: {
|
|
19
|
+
high: number;
|
|
20
|
+
low: number;
|
|
21
|
+
}): TriggeredSLTP[];
|
|
22
|
+
closeAllPositions(barIndex: number, reason: "tp" | "sl" | "manual" | "session-end", timestamp?: number): ReplayExecutedTrade[];
|
|
23
|
+
getPositions(): ReplayPosition[];
|
|
24
|
+
getPosition(id: string): ReplayPosition | undefined;
|
|
25
|
+
getClosedTrades(): ReplayExecutedTrade[];
|
|
26
|
+
getTotalPnl(): number;
|
|
27
|
+
setStopLoss(positionId: string, price: number): boolean;
|
|
28
|
+
setTakeProfit(positionId: string, price: number): boolean;
|
|
29
|
+
reset(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ReplayExecutedTrade } from "./replayTradingTypes";
|
|
2
|
+
export interface EquityPoint {
|
|
3
|
+
barIndex: number;
|
|
4
|
+
equity: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ReplayAnalyticsStats {
|
|
7
|
+
totalTrades: number;
|
|
8
|
+
winningTrades: number;
|
|
9
|
+
losingTrades: number;
|
|
10
|
+
winRate: number;
|
|
11
|
+
grossProfit: number;
|
|
12
|
+
grossLoss: number;
|
|
13
|
+
profitFactor: number;
|
|
14
|
+
netProfit: number;
|
|
15
|
+
maxDrawdown: number;
|
|
16
|
+
maxDrawdownPercent: number;
|
|
17
|
+
sharpeRatio: number;
|
|
18
|
+
avgWin: number;
|
|
19
|
+
avgLoss: number;
|
|
20
|
+
expectancy: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class ReplaySessionAnalytics {
|
|
23
|
+
private equityCurve;
|
|
24
|
+
private initialEquity;
|
|
25
|
+
private periodsPerYear;
|
|
26
|
+
constructor(periodsPerYear?: number);
|
|
27
|
+
reset(initialEquity?: number): void;
|
|
28
|
+
recordEquity(barIndex: number, totalPnl: number): void;
|
|
29
|
+
private computeDrawdown;
|
|
30
|
+
getStats(externalTrades?: readonly ReplayExecutedTrade[]): ReplayAnalyticsStats;
|
|
31
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EngineOverlayDrawingPrimitiveInput, PaneRuntimeSnapshot, VisibleRange as EngineVisibleRange } from "@vninvestcharts/engine-core";
|
|
2
|
+
import type { ReplayExecutedTrade, ReplayPosition } from "./replayTradingTypes";
|
|
3
|
+
export interface TradeMarkerInput {
|
|
4
|
+
positions: readonly ReplayPosition[];
|
|
5
|
+
closedTrades: readonly ReplayExecutedTrade[];
|
|
6
|
+
}
|
|
7
|
+
export declare function createReplayTradeMarkerInputs(input: TradeMarkerInput, paneSnapshot: PaneRuntimeSnapshot, visibleRange: EngineVisibleRange, scaleSlotId: string): EngineOverlayDrawingPrimitiveInput[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type MarketRules } from "../trading/MarketRules";
|
|
2
|
+
import type { ExecutionTicket, OrderValidationInput, PositionSide, TradingPosition } from "../trading/types";
|
|
3
|
+
import type { ReplayExecutedTrade, ReplayOHLCBar, ReplayOrder, ReplayPosition } from "./replayTradingTypes";
|
|
4
|
+
/**
|
|
5
|
+
* Replay mô phỏng chiến thuật, không mô phỏng thanh toán T+2: nếu giữ
|
|
6
|
+
* settlementDays = 2, TP khớp nến kế tiếp bị throw (available 0) — regression
|
|
7
|
+
* nặng so với legacy (đóng ngay). Override có chủ đích, khóa bằng test.
|
|
8
|
+
*/
|
|
9
|
+
export declare const REPLAY_SPOT_RULES: MarketRules;
|
|
10
|
+
export interface ReplayEntryInfo {
|
|
11
|
+
entryPrice: number;
|
|
12
|
+
entryTimestamp: number;
|
|
13
|
+
entryBarIndex: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function mapPositionToReplay(position: TradingPosition, opts: {
|
|
16
|
+
mark: number;
|
|
17
|
+
contractMultiplier?: number;
|
|
18
|
+
stopLoss?: number;
|
|
19
|
+
takeProfit?: number;
|
|
20
|
+
entryBarIndex?: number;
|
|
21
|
+
}): ReplayPosition;
|
|
22
|
+
export declare function mapTicketToReplayTrade(ticket: ExecutionTicket, entry: ReplayEntryInfo & {
|
|
23
|
+
positionSide: PositionSide;
|
|
24
|
+
}, exitBarIndex: number): ReplayExecutedTrade;
|
|
25
|
+
export interface PreBatchPosition {
|
|
26
|
+
id: string;
|
|
27
|
+
symbol: string;
|
|
28
|
+
side: "long" | "short";
|
|
29
|
+
quantity: number;
|
|
30
|
+
}
|
|
31
|
+
export interface CloseLegMatch {
|
|
32
|
+
closeQuantity: number;
|
|
33
|
+
entry: ReplayEntryInfo & {
|
|
34
|
+
positionSide: "long" | "short";
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Một fill chỉ sinh journal khi nó ĐÓNG (toàn phần/bộ phận) vị thế đối ứng
|
|
39
|
+
* tồn tại trước batch. Fill mở vị thế -> null (legacy journal chỉ ghi closes).
|
|
40
|
+
* Reversal: close leg tách theo min(fillQty, preQty), phần dôi mở mới không ghi journal.
|
|
41
|
+
*/
|
|
42
|
+
export declare function matchCloseLeg(ticket: {
|
|
43
|
+
symbol: string;
|
|
44
|
+
side: "buy" | "sell";
|
|
45
|
+
fillQuantity: number;
|
|
46
|
+
fillPrice: number;
|
|
47
|
+
timestamp: number;
|
|
48
|
+
}, preBatch: PreBatchPosition[] | null, ledger: Map<string, ReplayEntryInfo>, fallbackBarIndex: number): CloseLegMatch | null;
|
|
49
|
+
/** ReplayOrder legacy -> broker input. reduceOnly/clamp do hook xử lý (cần net position). */
|
|
50
|
+
export declare function mapReplayOrderToBrokerInput(order: Omit<ReplayOrder, "id" | "timestamp">): OrderValidationInput;
|
|
51
|
+
export declare function replayBarTimestamp(bar: ReplayOHLCBar, fallback: number): number;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface ReplayOrder {
|
|
2
|
+
id: string;
|
|
3
|
+
type: "market" | "limit" | "stop";
|
|
4
|
+
side: "buy" | "sell";
|
|
5
|
+
quantity: number;
|
|
6
|
+
price?: number;
|
|
7
|
+
stopPrice?: number;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
reduceOnly?: boolean;
|
|
10
|
+
symbol?: string;
|
|
11
|
+
feeRate?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FillResult {
|
|
14
|
+
filled: boolean;
|
|
15
|
+
fillPrice: number;
|
|
16
|
+
fillQuantity: number;
|
|
17
|
+
fillTimestamp: number;
|
|
18
|
+
partial: boolean;
|
|
19
|
+
remainingQuantity: number;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ReplayPosition {
|
|
23
|
+
id: string;
|
|
24
|
+
side: "long" | "short";
|
|
25
|
+
entryPrice: number;
|
|
26
|
+
quantity: number;
|
|
27
|
+
currentPrice: number;
|
|
28
|
+
unrealizedPnl: number;
|
|
29
|
+
realizedPnl: number;
|
|
30
|
+
stopLoss?: number;
|
|
31
|
+
takeProfit?: number;
|
|
32
|
+
entryTimestamp: number;
|
|
33
|
+
entryBarIndex: number;
|
|
34
|
+
symbol?: string;
|
|
35
|
+
feeRate?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ReplayExecutedTrade {
|
|
38
|
+
id: string;
|
|
39
|
+
orderId: string;
|
|
40
|
+
symbol: string;
|
|
41
|
+
side: "buy" | "sell";
|
|
42
|
+
type: "market" | "limit" | "stop";
|
|
43
|
+
entryPrice: number;
|
|
44
|
+
exitPrice: number;
|
|
45
|
+
quantity: number;
|
|
46
|
+
pnl: number;
|
|
47
|
+
pnlPercent: number;
|
|
48
|
+
entryTimestamp: number;
|
|
49
|
+
exitTimestamp: number;
|
|
50
|
+
entryBarIndex: number;
|
|
51
|
+
exitBarIndex: number;
|
|
52
|
+
barsHeld: number;
|
|
53
|
+
exitReason: "tp" | "sl" | "manual" | "session-end";
|
|
54
|
+
}
|
|
55
|
+
export interface ReplayOHLCBar {
|
|
56
|
+
open: number;
|
|
57
|
+
high: number;
|
|
58
|
+
low: number;
|
|
59
|
+
close: number;
|
|
60
|
+
date: Date | number;
|
|
61
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ScaleLinear } from "d3-scale";
|
|
2
|
+
import type { OHLCVBar } from "../../types/ohlcv";
|
|
3
|
+
import type { PaneConfig } from "../../types/pane";
|
|
4
|
+
export interface PaneScales {
|
|
5
|
+
leftScale: ScaleLinear<number, number>;
|
|
6
|
+
rightScale?: ScaleLinear<number, number>;
|
|
7
|
+
}
|
|
8
|
+
export declare function computeScales(pane: PaneConfig, data: readonly OHLCVBar[], canvasHeight: number): PaneScales;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { EnrichedDatum, IndicatorBandValue, IndicatorBrarValue, IndicatorCrValue, IndicatorDmaValue, IndicatorDmiValue, IndicatorEmvValue, IndicatorDatumValue, IndicatorKdjValue, IndicatorMacdValue, IndicatorMtmValue, IndicatorPsyValue, IndicatorTrixValue, IndicatorWhaleValue, IndicatorStrengthElderValue, IndicatorIchimokuValue, IndicatorSupertrendValue, IndicatorMARibbonValue, IndicatorAlligatorValue, IndicatorFractalValue, IndicatorGatorValue, IndicatorPivotValue, IndicatorVwapValue, IndicatorAcValue, MarketProfileData, VolumeProfileData, FootprintBar, IndicatorDeltaProfileValue, IndicatorWyckoffValue } from "./calculators/types";
|
|
2
|
+
import type { SeriesConfig } from "./types/pane-descriptor";
|
|
3
|
+
/**
|
|
4
|
+
* The Pine series-type prefix, and the only place that parses it.
|
|
5
|
+
*
|
|
6
|
+
* A Pine script produces a series whose type id is generated at runtime, so it is absent from
|
|
7
|
+
* every closed lookup table in this file. Both the producer (PineEditorPanel) and the consumer
|
|
8
|
+
* (buildIndicatorBaseKey) must agree on the format; when they disagreed, the series resolved to
|
|
9
|
+
* no key and vanished. One exported pair, one format, no second spelling.
|
|
10
|
+
*
|
|
11
|
+
* `scriptId` is the persisted script id (base36 + timestamp), which never contains a dot — that
|
|
12
|
+
* matters, because the engine treats a type containing "." as a derived sub-series.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PINE_SERIES_TYPE_PREFIX = "pine_";
|
|
15
|
+
/**
|
|
16
|
+
* Idempotent on purpose: `useScriptPersistence.generateId()` already emits ids beginning with
|
|
17
|
+
* `pine_`, so the script id and the series type are the same string in practice. Making this
|
|
18
|
+
* idempotent means a caller can pass either form without producing `pine_pine_...`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function pineSeriesTypeFor(scriptId: string): string;
|
|
21
|
+
/** Returns the script id, or null when the type is not a Pine series type. */
|
|
22
|
+
export declare function pineScriptIdFromSeriesType(type: string): string | null;
|
|
23
|
+
export declare function buildIndicatorSeriesKey(series: SeriesConfig): string | undefined;
|
|
24
|
+
export declare function resolveSeriesDatumValue(datum: EnrichedDatum, series: SeriesConfig): IndicatorDatumValue | undefined;
|
|
25
|
+
export declare function resolveSeriesValue(datum: EnrichedDatum, series: SeriesConfig): number | undefined;
|
|
26
|
+
export declare function resolveSeriesStructuredValue(datum: EnrichedDatum, series: SeriesConfig): number | IndicatorBandValue | IndicatorMacdValue | IndicatorWhaleValue | IndicatorKdjValue | IndicatorDmiValue | IndicatorBrarValue | IndicatorMtmValue | IndicatorEmvValue | IndicatorTrixValue | IndicatorDmaValue | IndicatorPsyValue | IndicatorCrValue | IndicatorStrengthElderValue | IndicatorIchimokuValue | IndicatorSupertrendValue | IndicatorMARibbonValue | IndicatorAlligatorValue | IndicatorFractalValue | IndicatorGatorValue | IndicatorPivotValue | IndicatorVwapValue | IndicatorAcValue | MarketProfileData | VolumeProfileData | FootprintBar | import("./calculators/types").DeltaProfileData | IndicatorDeltaProfileValue | IndicatorWyckoffValue | undefined;
|
|
27
|
+
export declare function resolveSeriesValueAccessors(series: SeriesConfig): Array<(datum: EnrichedDatum) => number | undefined>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PaneDescriptor, SeriesTypeId } from "../types/pane-descriptor";
|
|
2
|
+
import type { IndicatorSet, IndicatorSetStorageLike } from "../types/indicator-set";
|
|
3
|
+
export declare function cloneIndicatorSet(set: IndicatorSet): IndicatorSet;
|
|
4
|
+
export declare function createIndicatorSet(name: string, panes: readonly PaneDescriptor[], now?: number): IndicatorSet;
|
|
5
|
+
export interface IndicatorSetValidationOptions {
|
|
6
|
+
allowedSeriesTypes?: readonly SeriesTypeId[];
|
|
7
|
+
preserveBuiltin?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function sanitizeIndicatorSet(candidate: unknown, options?: IndicatorSetValidationOptions): IndicatorSet | null;
|
|
10
|
+
export declare function sanitizeIndicatorSetsStorage(candidate: unknown, options?: IndicatorSetValidationOptions): IndicatorSet[] | null;
|
|
11
|
+
export declare function loadIndicatorSets(storage?: IndicatorSetStorageLike, options?: IndicatorSetValidationOptions): IndicatorSet[];
|
|
12
|
+
export declare function saveIndicatorSets(storage: IndicatorSetStorageLike | undefined, sets: readonly IndicatorSet[]): void;
|
|
13
|
+
export declare function indicatorSetToPaneLayout(set: IndicatorSet): PaneDescriptor[];
|
|
14
|
+
export declare function buildIndicatorSetFileName(name: string, createdAt: number): string;
|
|
15
|
+
export declare function stringifyIndicatorSet(set: IndicatorSet): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ExitReason, PositionSide } from "./types";
|
|
2
|
+
export interface ClosedTradeRecord {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
realizedPnl: number;
|
|
5
|
+
commission: number;
|
|
6
|
+
tax: number;
|
|
7
|
+
/** TVP-A3: chi tiết vị thế đóng cho tab Trade History (additive, optional). */
|
|
8
|
+
symbol?: string;
|
|
9
|
+
side?: PositionSide;
|
|
10
|
+
quantity?: number;
|
|
11
|
+
entryPrice?: number;
|
|
12
|
+
exitPrice?: number;
|
|
13
|
+
exitReason?: ExitReason;
|
|
14
|
+
}
|
|
15
|
+
export interface EquityPoint {
|
|
16
|
+
timestamp: number;
|
|
17
|
+
equity: number;
|
|
18
|
+
}
|
|
19
|
+
export interface TradingAnalytics {
|
|
20
|
+
totalTrades: number;
|
|
21
|
+
winningTrades: number;
|
|
22
|
+
losingTrades: number;
|
|
23
|
+
winRate: number;
|
|
24
|
+
grossProfit: number;
|
|
25
|
+
grossLoss: number;
|
|
26
|
+
netProfit: number;
|
|
27
|
+
/** 0 khi chưa có trade; = grossProfit khi chưa từng lỗ (tránh Infinity). */
|
|
28
|
+
profitFactor: number;
|
|
29
|
+
maxDrawdown: number;
|
|
30
|
+
maxDrawdownPercent: number;
|
|
31
|
+
equityCurve: EquityPoint[];
|
|
32
|
+
/** TVP-A3: trades đã đóng (có entry/exit khi settleFill điền đủ) cho tab Trade History. */
|
|
33
|
+
closedTrades: ClosedTradeRecord[];
|
|
34
|
+
/** TVP-A4: Sharpe annualized, port exact từ legacy (sample variance, prev !== 0). */
|
|
35
|
+
sharpeRatio: number;
|
|
36
|
+
}
|
|
37
|
+
export declare class AnalyticsEngine {
|
|
38
|
+
private trades;
|
|
39
|
+
private curve;
|
|
40
|
+
recordClosedTrade(trade: ClosedTradeRecord): void;
|
|
41
|
+
recordEquityPoint(timestamp: number, equity: number): void;
|
|
42
|
+
getClosedTrades(): ClosedTradeRecord[];
|
|
43
|
+
getEquityCurve(): EquityPoint[];
|
|
44
|
+
restoreClosedTrades(trades: ClosedTradeRecord[]): void;
|
|
45
|
+
restoreEquityCurve(curve: EquityPoint[]): void;
|
|
46
|
+
clear(): void;
|
|
47
|
+
getAnalytics(): TradingAnalytics;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* TVP-A4: port EXACT công thức legacy (ReplaySessionAnalytics):
|
|
51
|
+
* sample variance (n-1), skip prev === 0, annualized √252.
|
|
52
|
+
* Giữ `!== 0` như legacy (parity) thay vì E ≤ 0 nghiêm ngặt — chia cho số âm
|
|
53
|
+
* hữu hạn không sinh NaN/Infinity nên an toàn; mọi đường NaN/Infinity
|
|
54
|
+
* (length<3, stdDev 0) đều đã khóa về 0.
|
|
55
|
+
*/
|
|
56
|
+
export declare function computeSharpeRatio(curve: EquityPoint[], periodsPerYear?: number): number;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BrokerAccount, ExecutionTicket, OrderValidationInput, TradingOrder, TradingPosition } from "./types";
|
|
2
|
+
export interface TradingEventMap {
|
|
3
|
+
positionChange: TradingPosition[];
|
|
4
|
+
orderChange: TradingOrder[];
|
|
5
|
+
accountChange: BrokerAccount;
|
|
6
|
+
fill: ExecutionTicket;
|
|
7
|
+
}
|
|
8
|
+
export type TradingEventKey = keyof TradingEventMap;
|
|
9
|
+
export type TradingEventCallback<K extends TradingEventKey> = (payload: TradingEventMap[K]) => void;
|
|
10
|
+
export declare class TradingEventBus {
|
|
11
|
+
private readonly listeners;
|
|
12
|
+
on<K extends TradingEventKey>(event: K, callback: TradingEventCallback<K>): () => void;
|
|
13
|
+
emit<K extends TradingEventKey>(event: K, payload: TradingEventMap[K]): void;
|
|
14
|
+
}
|
|
15
|
+
export interface ClosePositionOptions {
|
|
16
|
+
quantity?: number;
|
|
17
|
+
reason?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PlaceOrderOptions {
|
|
20
|
+
/** Bỏ qua rules/availability/risk — chỉ dùng cho replay-compat (legacy accept-everything). */
|
|
21
|
+
skipValidation?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface IBrokerAPI {
|
|
24
|
+
getAccount(): BrokerAccount;
|
|
25
|
+
getPositions(): TradingPosition[];
|
|
26
|
+
getOrders(): TradingOrder[];
|
|
27
|
+
placeOrder(request: OrderValidationInput & {
|
|
28
|
+
clientOrderId?: string;
|
|
29
|
+
}, options?: PlaceOrderOptions): TradingOrder;
|
|
30
|
+
cancelOrder(orderId: string): boolean;
|
|
31
|
+
modifyOrder(orderId: string, patch: {
|
|
32
|
+
price?: number;
|
|
33
|
+
stopPrice?: number;
|
|
34
|
+
quantity?: number;
|
|
35
|
+
}): TradingOrder;
|
|
36
|
+
closePosition(positionId: string, options?: ClosePositionOptions): boolean;
|
|
37
|
+
closeAllPositions(reason?: string, symbol?: string): number;
|
|
38
|
+
resetAccount(initialBalance: number): void;
|
|
39
|
+
on<K extends TradingEventKey>(event: K, callback: TradingEventCallback<K>): () => void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ExecutionTicket, ExitReason, OrderSide, PositionSide, TradingOrder } from "./types";
|
|
2
|
+
import type { MarketRules } from "./MarketRules";
|
|
3
|
+
export interface ExecutionSimulatorOptions {
|
|
4
|
+
slippageTicks?: number;
|
|
5
|
+
brokerFeeRate?: number;
|
|
6
|
+
commissionPerContract?: number;
|
|
7
|
+
taxRate?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PositionBasis {
|
|
10
|
+
entryPrice: number;
|
|
11
|
+
side: PositionSide;
|
|
12
|
+
}
|
|
13
|
+
export interface ExecuteFillRequest {
|
|
14
|
+
order: TradingOrder;
|
|
15
|
+
basePrice: number;
|
|
16
|
+
quantity: number;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
positionBasis?: PositionBasis;
|
|
19
|
+
exitReason?: ExitReason;
|
|
20
|
+
ambiguousIntrabarFill?: boolean;
|
|
21
|
+
tieBreakReason?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface OrderCostEstimate {
|
|
24
|
+
estimatedCost: number;
|
|
25
|
+
commission: number;
|
|
26
|
+
estimatedTax: number;
|
|
27
|
+
totalOutflow: number;
|
|
28
|
+
}
|
|
29
|
+
export declare class ExecutionSimulator {
|
|
30
|
+
private slippageTicks;
|
|
31
|
+
private brokerFeeRate;
|
|
32
|
+
private commissionPerContract;
|
|
33
|
+
private taxRate;
|
|
34
|
+
constructor(options?: ExecutionSimulatorOptions);
|
|
35
|
+
/**
|
|
36
|
+
* S2: live-update pricing knobs without recreating the broker (positions,
|
|
37
|
+
* orders and WS subscriptions survive). Prospective-only: booked fills keep
|
|
38
|
+
* old values. Returns the effective options for UI logging.
|
|
39
|
+
*/
|
|
40
|
+
updateOptions(patch: ExecutionSimulatorOptions): Required<ExecutionSimulatorOptions>;
|
|
41
|
+
executeFill(request: ExecuteFillRequest, rules: MarketRules): ExecutionTicket;
|
|
42
|
+
applySlippage(basePrice: number, side: OrderSide, rules: MarketRules): number;
|
|
43
|
+
calculateCommission(price: number, quantity: number, rules: MarketRules): number;
|
|
44
|
+
calculateTax(price: number, quantity: number, rules: MarketRules, side: OrderSide): number;
|
|
45
|
+
checkIntrabarAmbiguity(tpPrice: number, slPrice: number, bar: {
|
|
46
|
+
high: number;
|
|
47
|
+
low: number;
|
|
48
|
+
}, side: PositionSide): boolean;
|
|
49
|
+
estimateOrderCost(order: {
|
|
50
|
+
side: OrderSide;
|
|
51
|
+
quantity: number;
|
|
52
|
+
}, price: number, rules: MarketRules): OrderCostEstimate;
|
|
53
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BrokerAccount, ExecutionTicket, ExitReason, OrderSide } from "./types";
|
|
2
|
+
import type { MarketRules } from "./MarketRules";
|
|
3
|
+
import type { OrderManagementSystem } from "./OrderManagementSystem";
|
|
4
|
+
import type { PositionManager } from "./PositionManager";
|
|
5
|
+
import type { ExecutionSimulator } from "./ExecutionSimulator";
|
|
6
|
+
import type { AnalyticsEngine } from "./AnalyticsEngine";
|
|
7
|
+
export interface SettlementBooks {
|
|
8
|
+
account: BrokerAccount;
|
|
9
|
+
history: ExecutionTicket[];
|
|
10
|
+
analytics: AnalyticsEngine;
|
|
11
|
+
}
|
|
12
|
+
export interface SettleFillArgs {
|
|
13
|
+
symbol: string;
|
|
14
|
+
side: OrderSide;
|
|
15
|
+
quantity: number;
|
|
16
|
+
price: number;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
orderId?: string;
|
|
19
|
+
exitReason?: ExitReason;
|
|
20
|
+
bar?: {
|
|
21
|
+
high: number;
|
|
22
|
+
low: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare class FillSettlement {
|
|
26
|
+
private readonly oms;
|
|
27
|
+
private readonly pms;
|
|
28
|
+
private readonly sim;
|
|
29
|
+
private rules;
|
|
30
|
+
private mktSeq;
|
|
31
|
+
constructor(oms: OrderManagementSystem, pms: PositionManager, sim: ExecutionSimulator, rules: MarketRules);
|
|
32
|
+
/** S2: swap the rules reference (prospective fills only; booked history untouched). */
|
|
33
|
+
updateRules(rules: MarketRules): void;
|
|
34
|
+
settle(books: SettlementBooks, args: SettleFillArgs): ExecutionTicket;
|
|
35
|
+
private openFresh;
|
|
36
|
+
private applyCashflow;
|
|
37
|
+
private flagAmbiguity;
|
|
38
|
+
}
|