acttrader-charts 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/dist/{MACD-BmvUIYwI.d.cts → MACD-K2nBudgk.d.cts} +30 -0
- package/dist/{MACD-BmvUIYwI.d.ts → MACD-K2nBudgk.d.ts} +30 -0
- package/dist/index.cjs +593 -251
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -3
- package/dist/index.d.ts +33 -3
- package/dist/index.js +593 -251
- package/dist/index.js.map +1 -1
- package/dist/indicators/index.d.cts +2 -2
- package/dist/indicators/index.d.ts +2 -2
- package/dist/webview/chart.html +237 -0
- package/package.json +8 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChartConfig, O as OHLCVBar, I as IIndicator, a as ChartEventMap, S as SeriesType, b as ChartState, D as DrawingToolType, c as IDrawing, d as IWebSocketAdapter, T as TradeLevelType, A as AnyLevel, e as DrawingPoint, f as ScaleManager, V as Viewport, P as PriceRange$1, g as DrawingHandle, h as SerializedDrawing, i as Tick, j as StreamStatus } from './MACD-
|
|
2
|
-
export { k as ActiveIndicatorState, B as BollingerBands, l as BottomBarColors, m as BottomBarLabels, n as BottomBarUiConfig, o as CanvasColorSettings, p as ChartLabels, q as ChartMiscLabels, r as ChartTheme, s as ChartThemeUi, t as CrosshairPosition, u as CrosshairUiConfig, v as DARK_THEME, w as DEFAULT_BOTTOM_BAR_CONFIG, x as DEFAULT_CROSSHAIR_CONFIG, y as DEFAULT_DRAWING_TOOLBAR_CONFIG, z as DEFAULT_INDICATOR_OVERLAY_CONFIG, E as DEFAULT_LABELS, F as DEFAULT_PRICE_AXIS_CONFIG, G as DEFAULT_TIME_AXIS_CONFIG, H as DEFAULT_TOP_BAR_CONFIG, J as DEFAULT_UI_CONFIG, K as DataLoaderParams, L as DeepPartial, M as DeepPartialChartTheme, N as DialogLabels, Q as DrawingToolbarColors, R as DrawingToolbarLabels, U as DrawingToolbarUiConfig, W as Duration, X as EMA, Y as IndicatorOverlayColors, Z as IndicatorOverlayUiConfig, _ as IndicatorParams, $ as IndicatorResult, a0 as IndicatorStateEntry, a1 as LIGHT_THEME, a2 as MACD, a3 as OhlcLabels, a4 as OrderSubmit, a5 as Padding, a6 as PendingOrderLevel, a7 as PositionLevel, a8 as PositionRenderStyle, a9 as PriceAxisUiConfig, aa as RSI, ab as SMA, ac as Theme, ad as TimeAxisUiConfig, ae as Timeframe, af as TopBarColors, ag as TopBarLabels, ah as TopBarUiConfig, ai as TradeDisplayFilter, aj as TradeLabels, ak as TradeLevel, al as TradeLevelColors, am as TradePanelColors, an as UiConfig, ao as deepMergeTheme, ap as resolveCssVarsInTheme, aq as resolveLabels, ar as resolveUiConfig } from './MACD-
|
|
1
|
+
import { C as ChartConfig, O as OHLCVBar, I as IIndicator, a as ChartEventMap, S as SeriesType, b as ChartState, D as DrawingToolType, c as IDrawing, d as IWebSocketAdapter, T as TradeLevelType, A as AnyLevel, e as DrawingPoint, f as ScaleManager, V as Viewport, P as PriceRange$1, g as DrawingHandle, h as SerializedDrawing, i as Tick, j as StreamStatus } from './MACD-K2nBudgk.cjs';
|
|
2
|
+
export { k as ActiveIndicatorState, B as BollingerBands, l as BottomBarColors, m as BottomBarLabels, n as BottomBarUiConfig, o as CanvasColorSettings, p as ChartLabels, q as ChartMiscLabels, r as ChartTheme, s as ChartThemeUi, t as CrosshairPosition, u as CrosshairUiConfig, v as DARK_THEME, w as DEFAULT_BOTTOM_BAR_CONFIG, x as DEFAULT_CROSSHAIR_CONFIG, y as DEFAULT_DRAWING_TOOLBAR_CONFIG, z as DEFAULT_INDICATOR_OVERLAY_CONFIG, E as DEFAULT_LABELS, F as DEFAULT_PRICE_AXIS_CONFIG, G as DEFAULT_TIME_AXIS_CONFIG, H as DEFAULT_TOP_BAR_CONFIG, J as DEFAULT_UI_CONFIG, K as DataLoaderParams, L as DeepPartial, M as DeepPartialChartTheme, N as DialogLabels, Q as DrawingToolbarColors, R as DrawingToolbarLabels, U as DrawingToolbarUiConfig, W as Duration, X as EMA, Y as IndicatorOverlayColors, Z as IndicatorOverlayUiConfig, _ as IndicatorParams, $ as IndicatorResult, a0 as IndicatorStateEntry, a1 as LIGHT_THEME, a2 as MACD, a3 as OhlcLabels, a4 as OrderSubmit, a5 as Padding, a6 as PendingOrderLevel, a7 as PositionLevel, a8 as PositionRenderStyle, a9 as PriceAxisUiConfig, aa as RSI, ab as SMA, ac as Theme, ad as TimeAxisUiConfig, ae as Timeframe, af as TopBarColors, ag as TopBarLabels, ah as TopBarUiConfig, ai as TradeDisplayFilter, aj as TradeLabels, ak as TradeLevel, al as TradeLevelColors, am as TradePanelColors, an as UiConfig, ao as deepMergeTheme, ap as resolveCssVarsInTheme, aq as resolveLabels, ar as resolveUiConfig } from './MACD-K2nBudgk.cjs';
|
|
3
3
|
|
|
4
4
|
declare class ChartEngine {
|
|
5
5
|
private wrapper;
|
|
@@ -22,6 +22,7 @@ declare class ChartEngine {
|
|
|
22
22
|
private siStreamDot;
|
|
23
23
|
private siSymbolSpan;
|
|
24
24
|
private siOHLCSpan;
|
|
25
|
+
private siOHLC2Span;
|
|
25
26
|
private tickActivityTimer;
|
|
26
27
|
private tickActivityMs;
|
|
27
28
|
private streamStatus;
|
|
@@ -56,10 +57,17 @@ declare class ChartEngine {
|
|
|
56
57
|
private get indicators();
|
|
57
58
|
private indicatorResults;
|
|
58
59
|
private viewport;
|
|
60
|
+
private _targetViewport;
|
|
61
|
+
private _isPanning;
|
|
59
62
|
private crosshair;
|
|
60
63
|
private drawingManager;
|
|
61
64
|
private textInputEl;
|
|
62
65
|
private textInputDrawing;
|
|
66
|
+
/** Pending drag — committed only after mouse moves past DRAW_GESTURE_THRESHOLD. */
|
|
67
|
+
private _pendingDrawDrag;
|
|
68
|
+
/** Pending resize — committed only after mouse moves past DRAW_GESTURE_THRESHOLD. */
|
|
69
|
+
private _pendingDrawResize;
|
|
70
|
+
private static readonly DRAW_GESTURE_THRESHOLD;
|
|
63
71
|
private paneHeightOverrides;
|
|
64
72
|
private separatorDrag;
|
|
65
73
|
private readonly priceAxisWidth;
|
|
@@ -72,7 +80,9 @@ declare class ChartEngine {
|
|
|
72
80
|
private subPaneScaleFactors;
|
|
73
81
|
private _mobileCrosshairActive;
|
|
74
82
|
private _mobileTapStartXY;
|
|
75
|
-
private
|
|
83
|
+
private _longPressTimer;
|
|
84
|
+
private _longPressPoint;
|
|
85
|
+
private _lastTouchTime;
|
|
76
86
|
private _tradeButtonClickData;
|
|
77
87
|
private panHandler;
|
|
78
88
|
private zoomHandler;
|
|
@@ -123,8 +133,12 @@ declare class ChartEngine {
|
|
|
123
133
|
private isFetching;
|
|
124
134
|
private noMoreData;
|
|
125
135
|
private maxCandles;
|
|
136
|
+
private defaultVisibleBars;
|
|
137
|
+
private defaultMobileVisibleBars;
|
|
126
138
|
private mobileBarDivisor;
|
|
127
139
|
private explicitMobileDivisor;
|
|
140
|
+
private _autoVisibleBars;
|
|
141
|
+
private targetCandleWidth;
|
|
128
142
|
private maxSubPanes;
|
|
129
143
|
private showCandleCountdown;
|
|
130
144
|
private candleCountdownTimeframes;
|
|
@@ -172,6 +186,12 @@ declare class ChartEngine {
|
|
|
172
186
|
* Call this after construction to hydrate a chart from persisted state.
|
|
173
187
|
*/
|
|
174
188
|
setState(state: ChartState): this;
|
|
189
|
+
/**
|
|
190
|
+
* Re-anchors all loaded drawings to the current dataset using their stored timestamps.
|
|
191
|
+
* Called after loadData() to fix drawings restored via setState() before data was
|
|
192
|
+
* available (bars.length === 0 at restore time causes the raw barIndex fallback).
|
|
193
|
+
*/
|
|
194
|
+
private reanchorDrawingsByTimestamp;
|
|
175
195
|
/**
|
|
176
196
|
* Resets all chart settings that are captured by `getState()` back to their
|
|
177
197
|
* defaults (candlestick / dark / 1D / 1Y / volume on / no indicators / no drawings)
|
|
@@ -331,6 +351,14 @@ declare class ChartEngine {
|
|
|
331
351
|
private onMouseLeave;
|
|
332
352
|
private onMouseUp;
|
|
333
353
|
private touchToDrawingPoint;
|
|
354
|
+
/** Shared close-button handler used by both mouse click and touch tap. */
|
|
355
|
+
private _handleTradeLevelClose;
|
|
356
|
+
/** Activates the mobile crosshair at canvas coords (x, y). */
|
|
357
|
+
private _activateMobileCrosshair;
|
|
358
|
+
/** Shared helper: initiate a trade level main-line drag from a hit area. */
|
|
359
|
+
private _startTradeDragFromHit;
|
|
360
|
+
/** Shared helper: initiate a +SL/+TP add-bracket drag from a hit area. */
|
|
361
|
+
private _startAddBracketFromHit;
|
|
334
362
|
private onDrawingTouchStart;
|
|
335
363
|
private onDrawingTouchMove;
|
|
336
364
|
private onDrawingTouchEnd;
|
|
@@ -463,6 +491,8 @@ declare class DrawingManager {
|
|
|
463
491
|
startResize(drawing: IDrawing, pointIndex: number): void;
|
|
464
492
|
endResize(): void;
|
|
465
493
|
isResizingDrawing(): boolean;
|
|
494
|
+
/** Shift all drawings' barIndex values by `delta` (called when bars are prepended to DataStore). */
|
|
495
|
+
shiftBarIndices(delta: number): void;
|
|
466
496
|
/** Returns the handle under (x,y) across all complete drawings, or null */
|
|
467
497
|
getHandleAtPoint(x: number, y: number, scale: ScaleManager, viewport: Viewport, priceRange: PriceRange$1, chartW: number, chartH: number): {
|
|
468
498
|
drawing: IDrawing;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChartConfig, O as OHLCVBar, I as IIndicator, a as ChartEventMap, S as SeriesType, b as ChartState, D as DrawingToolType, c as IDrawing, d as IWebSocketAdapter, T as TradeLevelType, A as AnyLevel, e as DrawingPoint, f as ScaleManager, V as Viewport, P as PriceRange$1, g as DrawingHandle, h as SerializedDrawing, i as Tick, j as StreamStatus } from './MACD-
|
|
2
|
-
export { k as ActiveIndicatorState, B as BollingerBands, l as BottomBarColors, m as BottomBarLabels, n as BottomBarUiConfig, o as CanvasColorSettings, p as ChartLabels, q as ChartMiscLabels, r as ChartTheme, s as ChartThemeUi, t as CrosshairPosition, u as CrosshairUiConfig, v as DARK_THEME, w as DEFAULT_BOTTOM_BAR_CONFIG, x as DEFAULT_CROSSHAIR_CONFIG, y as DEFAULT_DRAWING_TOOLBAR_CONFIG, z as DEFAULT_INDICATOR_OVERLAY_CONFIG, E as DEFAULT_LABELS, F as DEFAULT_PRICE_AXIS_CONFIG, G as DEFAULT_TIME_AXIS_CONFIG, H as DEFAULT_TOP_BAR_CONFIG, J as DEFAULT_UI_CONFIG, K as DataLoaderParams, L as DeepPartial, M as DeepPartialChartTheme, N as DialogLabels, Q as DrawingToolbarColors, R as DrawingToolbarLabels, U as DrawingToolbarUiConfig, W as Duration, X as EMA, Y as IndicatorOverlayColors, Z as IndicatorOverlayUiConfig, _ as IndicatorParams, $ as IndicatorResult, a0 as IndicatorStateEntry, a1 as LIGHT_THEME, a2 as MACD, a3 as OhlcLabels, a4 as OrderSubmit, a5 as Padding, a6 as PendingOrderLevel, a7 as PositionLevel, a8 as PositionRenderStyle, a9 as PriceAxisUiConfig, aa as RSI, ab as SMA, ac as Theme, ad as TimeAxisUiConfig, ae as Timeframe, af as TopBarColors, ag as TopBarLabels, ah as TopBarUiConfig, ai as TradeDisplayFilter, aj as TradeLabels, ak as TradeLevel, al as TradeLevelColors, am as TradePanelColors, an as UiConfig, ao as deepMergeTheme, ap as resolveCssVarsInTheme, aq as resolveLabels, ar as resolveUiConfig } from './MACD-
|
|
1
|
+
import { C as ChartConfig, O as OHLCVBar, I as IIndicator, a as ChartEventMap, S as SeriesType, b as ChartState, D as DrawingToolType, c as IDrawing, d as IWebSocketAdapter, T as TradeLevelType, A as AnyLevel, e as DrawingPoint, f as ScaleManager, V as Viewport, P as PriceRange$1, g as DrawingHandle, h as SerializedDrawing, i as Tick, j as StreamStatus } from './MACD-K2nBudgk.js';
|
|
2
|
+
export { k as ActiveIndicatorState, B as BollingerBands, l as BottomBarColors, m as BottomBarLabels, n as BottomBarUiConfig, o as CanvasColorSettings, p as ChartLabels, q as ChartMiscLabels, r as ChartTheme, s as ChartThemeUi, t as CrosshairPosition, u as CrosshairUiConfig, v as DARK_THEME, w as DEFAULT_BOTTOM_BAR_CONFIG, x as DEFAULT_CROSSHAIR_CONFIG, y as DEFAULT_DRAWING_TOOLBAR_CONFIG, z as DEFAULT_INDICATOR_OVERLAY_CONFIG, E as DEFAULT_LABELS, F as DEFAULT_PRICE_AXIS_CONFIG, G as DEFAULT_TIME_AXIS_CONFIG, H as DEFAULT_TOP_BAR_CONFIG, J as DEFAULT_UI_CONFIG, K as DataLoaderParams, L as DeepPartial, M as DeepPartialChartTheme, N as DialogLabels, Q as DrawingToolbarColors, R as DrawingToolbarLabels, U as DrawingToolbarUiConfig, W as Duration, X as EMA, Y as IndicatorOverlayColors, Z as IndicatorOverlayUiConfig, _ as IndicatorParams, $ as IndicatorResult, a0 as IndicatorStateEntry, a1 as LIGHT_THEME, a2 as MACD, a3 as OhlcLabels, a4 as OrderSubmit, a5 as Padding, a6 as PendingOrderLevel, a7 as PositionLevel, a8 as PositionRenderStyle, a9 as PriceAxisUiConfig, aa as RSI, ab as SMA, ac as Theme, ad as TimeAxisUiConfig, ae as Timeframe, af as TopBarColors, ag as TopBarLabels, ah as TopBarUiConfig, ai as TradeDisplayFilter, aj as TradeLabels, ak as TradeLevel, al as TradeLevelColors, am as TradePanelColors, an as UiConfig, ao as deepMergeTheme, ap as resolveCssVarsInTheme, aq as resolveLabels, ar as resolveUiConfig } from './MACD-K2nBudgk.js';
|
|
3
3
|
|
|
4
4
|
declare class ChartEngine {
|
|
5
5
|
private wrapper;
|
|
@@ -22,6 +22,7 @@ declare class ChartEngine {
|
|
|
22
22
|
private siStreamDot;
|
|
23
23
|
private siSymbolSpan;
|
|
24
24
|
private siOHLCSpan;
|
|
25
|
+
private siOHLC2Span;
|
|
25
26
|
private tickActivityTimer;
|
|
26
27
|
private tickActivityMs;
|
|
27
28
|
private streamStatus;
|
|
@@ -56,10 +57,17 @@ declare class ChartEngine {
|
|
|
56
57
|
private get indicators();
|
|
57
58
|
private indicatorResults;
|
|
58
59
|
private viewport;
|
|
60
|
+
private _targetViewport;
|
|
61
|
+
private _isPanning;
|
|
59
62
|
private crosshair;
|
|
60
63
|
private drawingManager;
|
|
61
64
|
private textInputEl;
|
|
62
65
|
private textInputDrawing;
|
|
66
|
+
/** Pending drag — committed only after mouse moves past DRAW_GESTURE_THRESHOLD. */
|
|
67
|
+
private _pendingDrawDrag;
|
|
68
|
+
/** Pending resize — committed only after mouse moves past DRAW_GESTURE_THRESHOLD. */
|
|
69
|
+
private _pendingDrawResize;
|
|
70
|
+
private static readonly DRAW_GESTURE_THRESHOLD;
|
|
63
71
|
private paneHeightOverrides;
|
|
64
72
|
private separatorDrag;
|
|
65
73
|
private readonly priceAxisWidth;
|
|
@@ -72,7 +80,9 @@ declare class ChartEngine {
|
|
|
72
80
|
private subPaneScaleFactors;
|
|
73
81
|
private _mobileCrosshairActive;
|
|
74
82
|
private _mobileTapStartXY;
|
|
75
|
-
private
|
|
83
|
+
private _longPressTimer;
|
|
84
|
+
private _longPressPoint;
|
|
85
|
+
private _lastTouchTime;
|
|
76
86
|
private _tradeButtonClickData;
|
|
77
87
|
private panHandler;
|
|
78
88
|
private zoomHandler;
|
|
@@ -123,8 +133,12 @@ declare class ChartEngine {
|
|
|
123
133
|
private isFetching;
|
|
124
134
|
private noMoreData;
|
|
125
135
|
private maxCandles;
|
|
136
|
+
private defaultVisibleBars;
|
|
137
|
+
private defaultMobileVisibleBars;
|
|
126
138
|
private mobileBarDivisor;
|
|
127
139
|
private explicitMobileDivisor;
|
|
140
|
+
private _autoVisibleBars;
|
|
141
|
+
private targetCandleWidth;
|
|
128
142
|
private maxSubPanes;
|
|
129
143
|
private showCandleCountdown;
|
|
130
144
|
private candleCountdownTimeframes;
|
|
@@ -172,6 +186,12 @@ declare class ChartEngine {
|
|
|
172
186
|
* Call this after construction to hydrate a chart from persisted state.
|
|
173
187
|
*/
|
|
174
188
|
setState(state: ChartState): this;
|
|
189
|
+
/**
|
|
190
|
+
* Re-anchors all loaded drawings to the current dataset using their stored timestamps.
|
|
191
|
+
* Called after loadData() to fix drawings restored via setState() before data was
|
|
192
|
+
* available (bars.length === 0 at restore time causes the raw barIndex fallback).
|
|
193
|
+
*/
|
|
194
|
+
private reanchorDrawingsByTimestamp;
|
|
175
195
|
/**
|
|
176
196
|
* Resets all chart settings that are captured by `getState()` back to their
|
|
177
197
|
* defaults (candlestick / dark / 1D / 1Y / volume on / no indicators / no drawings)
|
|
@@ -331,6 +351,14 @@ declare class ChartEngine {
|
|
|
331
351
|
private onMouseLeave;
|
|
332
352
|
private onMouseUp;
|
|
333
353
|
private touchToDrawingPoint;
|
|
354
|
+
/** Shared close-button handler used by both mouse click and touch tap. */
|
|
355
|
+
private _handleTradeLevelClose;
|
|
356
|
+
/** Activates the mobile crosshair at canvas coords (x, y). */
|
|
357
|
+
private _activateMobileCrosshair;
|
|
358
|
+
/** Shared helper: initiate a trade level main-line drag from a hit area. */
|
|
359
|
+
private _startTradeDragFromHit;
|
|
360
|
+
/** Shared helper: initiate a +SL/+TP add-bracket drag from a hit area. */
|
|
361
|
+
private _startAddBracketFromHit;
|
|
334
362
|
private onDrawingTouchStart;
|
|
335
363
|
private onDrawingTouchMove;
|
|
336
364
|
private onDrawingTouchEnd;
|
|
@@ -463,6 +491,8 @@ declare class DrawingManager {
|
|
|
463
491
|
startResize(drawing: IDrawing, pointIndex: number): void;
|
|
464
492
|
endResize(): void;
|
|
465
493
|
isResizingDrawing(): boolean;
|
|
494
|
+
/** Shift all drawings' barIndex values by `delta` (called when bars are prepended to DataStore). */
|
|
495
|
+
shiftBarIndices(delta: number): void;
|
|
466
496
|
/** Returns the handle under (x,y) across all complete drawings, or null */
|
|
467
497
|
getHandleAtPoint(x: number, y: number, scale: ScaleManager, viewport: Viewport, priceRange: PriceRange$1, chartW: number, chartH: number): {
|
|
468
498
|
drawing: IDrawing;
|