acttrader-charts 1.0.12 → 1.0.13
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 +8 -2
- package/dist/{MACD-DoO45b_C.d.cts → MACD-CEmdbwGz.d.cts} +19 -1
- package/dist/{MACD-DoO45b_C.d.ts → MACD-CEmdbwGz.d.ts} +19 -1
- package/dist/index.cjs +139 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +139 -43
- 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 +7 -7
- package/package.json +1 -1
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,
|
|
2
|
-
export {
|
|
1
|
+
import { C as ChartConfig, O as OHLCVBar, I as IIndicator, a as ChartEventMap, T as Timeframe, S as SeriesType, b as ChartState, D as DrawingToolType, c as IDrawing, d as IWebSocketAdapter, e as TradeLevelType, A as AnyLevel, f as DrawingPoint, g as ScaleManager, V as Viewport, P as PriceRange$1, h as DrawingHandle, i as SerializedDrawing, j as Tick, k as StreamStatus } from './MACD-CEmdbwGz.cjs';
|
|
2
|
+
export { l as ActiveIndicatorState, B as BollingerBands, m as BottomBarColors, n as BottomBarLabels, o as BottomBarUiConfig, p as CanvasColorSettings, q as ChartLabels, r as ChartMiscLabels, s as ChartTheme, t as ChartThemeUi, u as CrosshairPosition, v as CrosshairUiConfig, w as DARK_THEME, x as DEFAULT_BOTTOM_BAR_CONFIG, y as DEFAULT_CROSSHAIR_CONFIG, z as DEFAULT_DRAWING_TOOLBAR_CONFIG, E as DEFAULT_INDICATOR_OVERLAY_CONFIG, F as DEFAULT_LABELS, G as DEFAULT_PRICE_AXIS_CONFIG, H as DEFAULT_TIME_AXIS_CONFIG, J as DEFAULT_TOP_BAR_CONFIG, K as DEFAULT_TRADE_BUTTON_CONFIG, L as DEFAULT_UI_CONFIG, M as DataLoaderParams, N as DeepPartial, Q as DeepPartialChartTheme, R as DialogLabels, U as DrawingToolbarColors, W as DrawingToolbarLabels, X as DrawingToolbarUiConfig, Y as Duration, Z as EMA, _ as IndicatorOverlayColors, $ as IndicatorOverlayUiConfig, a0 as IndicatorParams, a1 as IndicatorResult, a2 as IndicatorStateEntry, a3 as LIGHT_THEME, a4 as MACD, a5 as OhlcLabels, a6 as OrderSubmit, a7 as Padding, a8 as PendingOrderLevel, a9 as PositionLevel, aa as PositionRenderStyle, ab as PriceAxisUiConfig, ac as RSI, ad as SMA, ae as Theme, af as TimeAxisUiConfig, ag as TopBarColors, ah as TopBarLabels, ai as TopBarUiConfig, aj as TradeButtonUiConfig, ak as TradeDisplayFilter, al as TradeLabels, am as TradeLevel, an as TradeLevelColors, ao as TradePanelColors, ap as UiConfig, aq as deepMergeTheme, ar as resolveCssVarsInTheme, as as resolveLabels, at as resolveUiConfig } from './MACD-CEmdbwGz.cjs';
|
|
3
3
|
|
|
4
4
|
declare class ChartEngine {
|
|
5
5
|
private wrapper;
|
|
@@ -178,6 +178,10 @@ declare class ChartEngine {
|
|
|
178
178
|
on<K extends keyof ChartEventMap>(event: K, listener: (payload: ChartEventMap[K]) => void): () => void;
|
|
179
179
|
private buildTheme;
|
|
180
180
|
setTheme(theme: 'dark' | 'light'): this;
|
|
181
|
+
/** Programmatically change the active timeframe and reload data. */
|
|
182
|
+
setTimeframe(tf: Timeframe): this;
|
|
183
|
+
/** Update per-theme deep-partial color overrides and rebuild the active theme. */
|
|
184
|
+
setThemeOverrides(overrides: ChartConfig['themeOverrides']): this;
|
|
181
185
|
setSeries(series: SeriesType): this;
|
|
182
186
|
private clearDuration;
|
|
183
187
|
setVolume(show: boolean): this;
|
|
@@ -319,8 +323,10 @@ declare class ChartEngine {
|
|
|
319
323
|
*/
|
|
320
324
|
updateLevelMainPrice(label: string, price: number): this;
|
|
321
325
|
/**
|
|
322
|
-
* Set or clear the estimated PNL text shown on
|
|
323
|
-
*
|
|
326
|
+
* Set or clear the estimated PNL text shown on the SL or TP bracket line.
|
|
327
|
+
* Applies to the currently active bracket host — a draft order while drafting,
|
|
328
|
+
* or the selected/hovered level while editing an existing pending order or position.
|
|
329
|
+
* Pass `null` to clear the text.
|
|
324
330
|
* Use this to display the consumer-calculated estimated profit/loss next to the bracket.
|
|
325
331
|
*/
|
|
326
332
|
setDraftBracketPnl(type: 'sl' | 'tp', pnlText: string | null): this;
|
|
@@ -1434,4 +1440,4 @@ declare class WebSocketAdapter implements IWebSocketAdapter {
|
|
|
1434
1440
|
private emitStatus;
|
|
1435
1441
|
}
|
|
1436
1442
|
|
|
1437
|
-
export { AbcdPattern, AnchoredNote, AnchoredVP, type AnyDragArea, AnyLevel, Arc, ArrowDown, ArrowMarker, ArrowUp, BatPattern, Brush, ButterflyPattern, Callout, ChartConfig, ChartEngine, ChartEventMap, ChartState, Circle, CrabPattern, CrossLine, CyclicLines, CypherPattern, DatePriceRange, DateRange, DisjointChannel, DrawingHandle, DrawingManager, DrawingPoint, DrawingToolType, ElliottCombination, ElliottCorrective, ElliottImpulse, ElliottTriangle, ElliottWxy, Ellipse, FibChannel, FibCircles, FibExtension, FibFan, FibProjection, FibRetracement, FibSpiral, FibTimezone, FixedRangeVP, Flag, FlatChannel, GannBox, GannFan, GannSquare, GartleyPattern, GhostFeed, HeadShoulders, Highlighter, HorizontalLine, IDrawing, IIndicator, IWebSocketAdapter, InsidePitchfork, ModifiedSchiff, OHLCVBar, ParallelChannel, Path, Pitchfork, Polyline, PriceLabel, PriceNote, PriceProjection, PriceRange, PriceRange$1 as PriceRangeType, Projection, Rectangle, RegressionTrend, RotatedRectangle, Ruler, SchiffPitchfork, SerializedDrawing, SeriesType, SharkPattern, SineLine, StreamStatus, Text, ThreeDrives, Tick, TimeCycles, type TradeLevelBracketDragArea, type TradeLevelDragArea, TradeLevelType, TrendAngle, TrendLine, Triangle, TrianglePattern, VerticalLine, Viewport, VolumeProfile, WebSocketAdapter, aggregateCandles };
|
|
1443
|
+
export { AbcdPattern, AnchoredNote, AnchoredVP, type AnyDragArea, AnyLevel, Arc, ArrowDown, ArrowMarker, ArrowUp, BatPattern, Brush, ButterflyPattern, Callout, ChartConfig, ChartEngine, ChartEventMap, ChartState, Circle, CrabPattern, CrossLine, CyclicLines, CypherPattern, DatePriceRange, DateRange, DisjointChannel, DrawingHandle, DrawingManager, DrawingPoint, DrawingToolType, ElliottCombination, ElliottCorrective, ElliottImpulse, ElliottTriangle, ElliottWxy, Ellipse, FibChannel, FibCircles, FibExtension, FibFan, FibProjection, FibRetracement, FibSpiral, FibTimezone, FixedRangeVP, Flag, FlatChannel, GannBox, GannFan, GannSquare, GartleyPattern, GhostFeed, HeadShoulders, Highlighter, HorizontalLine, IDrawing, IIndicator, IWebSocketAdapter, InsidePitchfork, ModifiedSchiff, OHLCVBar, ParallelChannel, Path, Pitchfork, Polyline, PriceLabel, PriceNote, PriceProjection, PriceRange, PriceRange$1 as PriceRangeType, Projection, Rectangle, RegressionTrend, RotatedRectangle, Ruler, SchiffPitchfork, SerializedDrawing, SeriesType, SharkPattern, SineLine, StreamStatus, Text, ThreeDrives, Tick, TimeCycles, Timeframe, type TradeLevelBracketDragArea, type TradeLevelDragArea, TradeLevelType, TrendAngle, TrendLine, Triangle, TrianglePattern, VerticalLine, Viewport, VolumeProfile, WebSocketAdapter, aggregateCandles };
|
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,
|
|
2
|
-
export {
|
|
1
|
+
import { C as ChartConfig, O as OHLCVBar, I as IIndicator, a as ChartEventMap, T as Timeframe, S as SeriesType, b as ChartState, D as DrawingToolType, c as IDrawing, d as IWebSocketAdapter, e as TradeLevelType, A as AnyLevel, f as DrawingPoint, g as ScaleManager, V as Viewport, P as PriceRange$1, h as DrawingHandle, i as SerializedDrawing, j as Tick, k as StreamStatus } from './MACD-CEmdbwGz.js';
|
|
2
|
+
export { l as ActiveIndicatorState, B as BollingerBands, m as BottomBarColors, n as BottomBarLabels, o as BottomBarUiConfig, p as CanvasColorSettings, q as ChartLabels, r as ChartMiscLabels, s as ChartTheme, t as ChartThemeUi, u as CrosshairPosition, v as CrosshairUiConfig, w as DARK_THEME, x as DEFAULT_BOTTOM_BAR_CONFIG, y as DEFAULT_CROSSHAIR_CONFIG, z as DEFAULT_DRAWING_TOOLBAR_CONFIG, E as DEFAULT_INDICATOR_OVERLAY_CONFIG, F as DEFAULT_LABELS, G as DEFAULT_PRICE_AXIS_CONFIG, H as DEFAULT_TIME_AXIS_CONFIG, J as DEFAULT_TOP_BAR_CONFIG, K as DEFAULT_TRADE_BUTTON_CONFIG, L as DEFAULT_UI_CONFIG, M as DataLoaderParams, N as DeepPartial, Q as DeepPartialChartTheme, R as DialogLabels, U as DrawingToolbarColors, W as DrawingToolbarLabels, X as DrawingToolbarUiConfig, Y as Duration, Z as EMA, _ as IndicatorOverlayColors, $ as IndicatorOverlayUiConfig, a0 as IndicatorParams, a1 as IndicatorResult, a2 as IndicatorStateEntry, a3 as LIGHT_THEME, a4 as MACD, a5 as OhlcLabels, a6 as OrderSubmit, a7 as Padding, a8 as PendingOrderLevel, a9 as PositionLevel, aa as PositionRenderStyle, ab as PriceAxisUiConfig, ac as RSI, ad as SMA, ae as Theme, af as TimeAxisUiConfig, ag as TopBarColors, ah as TopBarLabels, ai as TopBarUiConfig, aj as TradeButtonUiConfig, ak as TradeDisplayFilter, al as TradeLabels, am as TradeLevel, an as TradeLevelColors, ao as TradePanelColors, ap as UiConfig, aq as deepMergeTheme, ar as resolveCssVarsInTheme, as as resolveLabels, at as resolveUiConfig } from './MACD-CEmdbwGz.js';
|
|
3
3
|
|
|
4
4
|
declare class ChartEngine {
|
|
5
5
|
private wrapper;
|
|
@@ -178,6 +178,10 @@ declare class ChartEngine {
|
|
|
178
178
|
on<K extends keyof ChartEventMap>(event: K, listener: (payload: ChartEventMap[K]) => void): () => void;
|
|
179
179
|
private buildTheme;
|
|
180
180
|
setTheme(theme: 'dark' | 'light'): this;
|
|
181
|
+
/** Programmatically change the active timeframe and reload data. */
|
|
182
|
+
setTimeframe(tf: Timeframe): this;
|
|
183
|
+
/** Update per-theme deep-partial color overrides and rebuild the active theme. */
|
|
184
|
+
setThemeOverrides(overrides: ChartConfig['themeOverrides']): this;
|
|
181
185
|
setSeries(series: SeriesType): this;
|
|
182
186
|
private clearDuration;
|
|
183
187
|
setVolume(show: boolean): this;
|
|
@@ -319,8 +323,10 @@ declare class ChartEngine {
|
|
|
319
323
|
*/
|
|
320
324
|
updateLevelMainPrice(label: string, price: number): this;
|
|
321
325
|
/**
|
|
322
|
-
* Set or clear the estimated PNL text shown on
|
|
323
|
-
*
|
|
326
|
+
* Set or clear the estimated PNL text shown on the SL or TP bracket line.
|
|
327
|
+
* Applies to the currently active bracket host — a draft order while drafting,
|
|
328
|
+
* or the selected/hovered level while editing an existing pending order or position.
|
|
329
|
+
* Pass `null` to clear the text.
|
|
324
330
|
* Use this to display the consumer-calculated estimated profit/loss next to the bracket.
|
|
325
331
|
*/
|
|
326
332
|
setDraftBracketPnl(type: 'sl' | 'tp', pnlText: string | null): this;
|
|
@@ -1434,4 +1440,4 @@ declare class WebSocketAdapter implements IWebSocketAdapter {
|
|
|
1434
1440
|
private emitStatus;
|
|
1435
1441
|
}
|
|
1436
1442
|
|
|
1437
|
-
export { AbcdPattern, AnchoredNote, AnchoredVP, type AnyDragArea, AnyLevel, Arc, ArrowDown, ArrowMarker, ArrowUp, BatPattern, Brush, ButterflyPattern, Callout, ChartConfig, ChartEngine, ChartEventMap, ChartState, Circle, CrabPattern, CrossLine, CyclicLines, CypherPattern, DatePriceRange, DateRange, DisjointChannel, DrawingHandle, DrawingManager, DrawingPoint, DrawingToolType, ElliottCombination, ElliottCorrective, ElliottImpulse, ElliottTriangle, ElliottWxy, Ellipse, FibChannel, FibCircles, FibExtension, FibFan, FibProjection, FibRetracement, FibSpiral, FibTimezone, FixedRangeVP, Flag, FlatChannel, GannBox, GannFan, GannSquare, GartleyPattern, GhostFeed, HeadShoulders, Highlighter, HorizontalLine, IDrawing, IIndicator, IWebSocketAdapter, InsidePitchfork, ModifiedSchiff, OHLCVBar, ParallelChannel, Path, Pitchfork, Polyline, PriceLabel, PriceNote, PriceProjection, PriceRange, PriceRange$1 as PriceRangeType, Projection, Rectangle, RegressionTrend, RotatedRectangle, Ruler, SchiffPitchfork, SerializedDrawing, SeriesType, SharkPattern, SineLine, StreamStatus, Text, ThreeDrives, Tick, TimeCycles, type TradeLevelBracketDragArea, type TradeLevelDragArea, TradeLevelType, TrendAngle, TrendLine, Triangle, TrianglePattern, VerticalLine, Viewport, VolumeProfile, WebSocketAdapter, aggregateCandles };
|
|
1443
|
+
export { AbcdPattern, AnchoredNote, AnchoredVP, type AnyDragArea, AnyLevel, Arc, ArrowDown, ArrowMarker, ArrowUp, BatPattern, Brush, ButterflyPattern, Callout, ChartConfig, ChartEngine, ChartEventMap, ChartState, Circle, CrabPattern, CrossLine, CyclicLines, CypherPattern, DatePriceRange, DateRange, DisjointChannel, DrawingHandle, DrawingManager, DrawingPoint, DrawingToolType, ElliottCombination, ElliottCorrective, ElliottImpulse, ElliottTriangle, ElliottWxy, Ellipse, FibChannel, FibCircles, FibExtension, FibFan, FibProjection, FibRetracement, FibSpiral, FibTimezone, FixedRangeVP, Flag, FlatChannel, GannBox, GannFan, GannSquare, GartleyPattern, GhostFeed, HeadShoulders, Highlighter, HorizontalLine, IDrawing, IIndicator, IWebSocketAdapter, InsidePitchfork, ModifiedSchiff, OHLCVBar, ParallelChannel, Path, Pitchfork, Polyline, PriceLabel, PriceNote, PriceProjection, PriceRange, PriceRange$1 as PriceRangeType, Projection, Rectangle, RegressionTrend, RotatedRectangle, Ruler, SchiffPitchfork, SerializedDrawing, SeriesType, SharkPattern, SineLine, StreamStatus, Text, ThreeDrives, Tick, TimeCycles, Timeframe, type TradeLevelBracketDragArea, type TradeLevelDragArea, TradeLevelType, TrendAngle, TrendLine, Triangle, TrianglePattern, VerticalLine, Viewport, VolumeProfile, WebSocketAdapter, aggregateCandles };
|
package/dist/index.js
CHANGED
|
@@ -429,6 +429,9 @@ var DEFAULT_TOP_BAR_CONFIG = {
|
|
|
429
429
|
dropBtnFontFamily: INTER_FONT,
|
|
430
430
|
drawBtnSize: "26px",
|
|
431
431
|
drawBtnIconFontSize: "14px",
|
|
432
|
+
iconBtnSize: "26px",
|
|
433
|
+
mobileIconBtnSize: "28px",
|
|
434
|
+
mobileDrawBtnIconSize: "16px",
|
|
432
435
|
flyoutRowFontSize: "12px",
|
|
433
436
|
flyoutRowFontFamily: INTER_FONT,
|
|
434
437
|
flyoutCategoryFontSize: "10px",
|
|
@@ -466,6 +469,12 @@ var DEFAULT_INDICATOR_OVERLAY_CONFIG = {
|
|
|
466
469
|
dropdownRowFontFamily: INTER_FONT,
|
|
467
470
|
dropdownIconFontSize: "10px"
|
|
468
471
|
};
|
|
472
|
+
var DEFAULT_TRADE_BUTTON_CONFIG = {
|
|
473
|
+
size: 22,
|
|
474
|
+
mobileSize: 24,
|
|
475
|
+
iconSize: 14,
|
|
476
|
+
mobileIconSize: 16
|
|
477
|
+
};
|
|
469
478
|
var DEFAULT_UI_CONFIG = {
|
|
470
479
|
drawingToolbar: DEFAULT_DRAWING_TOOLBAR_CONFIG,
|
|
471
480
|
topBar: DEFAULT_TOP_BAR_CONFIG,
|
|
@@ -473,7 +482,8 @@ var DEFAULT_UI_CONFIG = {
|
|
|
473
482
|
priceAxis: DEFAULT_PRICE_AXIS_CONFIG,
|
|
474
483
|
timeAxis: DEFAULT_TIME_AXIS_CONFIG,
|
|
475
484
|
crosshair: DEFAULT_CROSSHAIR_CONFIG,
|
|
476
|
-
indicatorOverlay: DEFAULT_INDICATOR_OVERLAY_CONFIG
|
|
485
|
+
indicatorOverlay: DEFAULT_INDICATOR_OVERLAY_CONFIG,
|
|
486
|
+
tradeButton: DEFAULT_TRADE_BUTTON_CONFIG
|
|
477
487
|
};
|
|
478
488
|
function resolveUiConfig(override) {
|
|
479
489
|
if (!override) return DEFAULT_UI_CONFIG;
|
|
@@ -484,7 +494,8 @@ function resolveUiConfig(override) {
|
|
|
484
494
|
priceAxis: { ...DEFAULT_PRICE_AXIS_CONFIG, ...override.priceAxis },
|
|
485
495
|
timeAxis: { ...DEFAULT_TIME_AXIS_CONFIG, ...override.timeAxis },
|
|
486
496
|
crosshair: { ...DEFAULT_CROSSHAIR_CONFIG, ...override.crosshair },
|
|
487
|
-
indicatorOverlay: { ...DEFAULT_INDICATOR_OVERLAY_CONFIG, ...override.indicatorOverlay }
|
|
497
|
+
indicatorOverlay: { ...DEFAULT_INDICATOR_OVERLAY_CONFIG, ...override.indicatorOverlay },
|
|
498
|
+
tradeButton: { ...DEFAULT_TRADE_BUTTON_CONFIG, ...override.tradeButton }
|
|
488
499
|
};
|
|
489
500
|
}
|
|
490
501
|
|
|
@@ -3238,6 +3249,9 @@ var TopBar = class {
|
|
|
3238
3249
|
this.fullscreenBtn.innerHTML = active ? ICON_FULLSCREEN_EXIT : ICON_FULLSCREEN_ENTER;
|
|
3239
3250
|
this.fullscreenBtn.title = active ? this.labels.exitFullscreenTitle : this.labels.toggleFullscreenTitle;
|
|
3240
3251
|
this.applyIconBtnStyles(this.fullscreenBtn, this.theme, active);
|
|
3252
|
+
if (this.isMobileLayout) {
|
|
3253
|
+
this.resizeSvg(this.fullscreenBtn, this.getSvgSize(this.fullscreenBtn) + 2);
|
|
3254
|
+
}
|
|
3241
3255
|
}
|
|
3242
3256
|
setDrawingsBtnActive(active) {
|
|
3243
3257
|
if (!this.drawingBtn) return;
|
|
@@ -3290,6 +3304,21 @@ var TopBar = class {
|
|
|
3290
3304
|
}
|
|
3291
3305
|
this.durationSep.style.display = btnDisplay;
|
|
3292
3306
|
this.durationDropBtn.style.display = isMobile ? "" : "none";
|
|
3307
|
+
const containerSize = isMobile ? this.cfg.mobileIconBtnSize : this.cfg.iconBtnSize;
|
|
3308
|
+
for (const btn of [this.fullscreenBtn, this.settingsBtn, this.drawingBtn]) {
|
|
3309
|
+
if (!btn) continue;
|
|
3310
|
+
btn.style.width = containerSize;
|
|
3311
|
+
btn.style.height = containerSize;
|
|
3312
|
+
}
|
|
3313
|
+
const delta = isMobile ? 2 : -2;
|
|
3314
|
+
this.resizeSvg(this.fullscreenBtn, this.getSvgSize(this.fullscreenBtn) + delta);
|
|
3315
|
+
if (this.settingsBtn) {
|
|
3316
|
+
this.resizeSvg(this.settingsBtn, this.getSvgSize(this.settingsBtn) + delta);
|
|
3317
|
+
}
|
|
3318
|
+
if (this.drawingBtn) {
|
|
3319
|
+
const drawIconSize = isMobile ? parseInt(this.cfg.mobileDrawBtnIconSize, 10) : parseInt(this.cfg.drawBtnIconFontSize, 10);
|
|
3320
|
+
this.resizeSvg(this.drawingBtn, drawIconSize);
|
|
3321
|
+
}
|
|
3293
3322
|
}
|
|
3294
3323
|
setIndicatorOptions(options) {
|
|
3295
3324
|
this.indicatorOptions = options;
|
|
@@ -3696,13 +3725,14 @@ var TopBar = class {
|
|
|
3696
3725
|
}
|
|
3697
3726
|
applyIconBtnStyles(btn, theme, active) {
|
|
3698
3727
|
btn.dataset.active = String(active);
|
|
3728
|
+
const size = this.isMobileLayout ? this.cfg.mobileIconBtnSize : this.cfg.iconBtnSize;
|
|
3699
3729
|
Object.assign(btn.style, {
|
|
3700
3730
|
background: active ? theme.ui.accentBg : "transparent",
|
|
3701
3731
|
color: active ? theme.ui.accentText : theme.topBar.btnColor,
|
|
3702
3732
|
border: `1px solid ${active ? theme.ui.accent : theme.axisBorder}`,
|
|
3703
3733
|
borderRadius: "5px",
|
|
3704
|
-
width:
|
|
3705
|
-
height:
|
|
3734
|
+
width: size,
|
|
3735
|
+
height: size,
|
|
3706
3736
|
cursor: "pointer",
|
|
3707
3737
|
outline: "none",
|
|
3708
3738
|
display: "flex",
|
|
@@ -3713,6 +3743,20 @@ var TopBar = class {
|
|
|
3713
3743
|
transition: "border-color 0.12s, background 0.12s"
|
|
3714
3744
|
});
|
|
3715
3745
|
}
|
|
3746
|
+
resizeSvg(btn, size) {
|
|
3747
|
+
if (!btn) return;
|
|
3748
|
+
const svg = btn.querySelector("svg");
|
|
3749
|
+
if (svg) {
|
|
3750
|
+
svg.setAttribute("width", String(size));
|
|
3751
|
+
svg.setAttribute("height", String(size));
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3754
|
+
getSvgSize(btn) {
|
|
3755
|
+
if (!btn) return 0;
|
|
3756
|
+
const svg = btn.querySelector("svg");
|
|
3757
|
+
if (!svg) return 0;
|
|
3758
|
+
return parseInt(svg.getAttribute("width") ?? "0", 10);
|
|
3759
|
+
}
|
|
3716
3760
|
};
|
|
3717
3761
|
|
|
3718
3762
|
// src/ui/BottomBar.ts
|
|
@@ -12229,9 +12273,11 @@ var ChartSettingsDialog = class {
|
|
|
12229
12273
|
|
|
12230
12274
|
// src/ui/TradeButton.ts
|
|
12231
12275
|
var TradeButton = class {
|
|
12232
|
-
constructor(theme, priceAxisWidth, onClick, labels = DEFAULT_LABELS.trade) {
|
|
12276
|
+
constructor(theme, priceAxisWidth, onClick, labels = DEFAULT_LABELS.trade, cfg = DEFAULT_TRADE_BUTTON_CONFIG) {
|
|
12233
12277
|
this._visible = false;
|
|
12278
|
+
this._isMobile = false;
|
|
12234
12279
|
this.theme = theme;
|
|
12280
|
+
this.cfg = cfg;
|
|
12235
12281
|
this.el = document.createElement("button");
|
|
12236
12282
|
this.el.innerHTML = ICON_PLUS_CIRCLE;
|
|
12237
12283
|
this.el.title = labels.placeOrderTitle;
|
|
@@ -12239,8 +12285,8 @@ var TradeButton = class {
|
|
|
12239
12285
|
position: "absolute",
|
|
12240
12286
|
right: `${priceAxisWidth + 26}px`,
|
|
12241
12287
|
top: "0",
|
|
12242
|
-
width:
|
|
12243
|
-
height:
|
|
12288
|
+
width: `${cfg.size}px`,
|
|
12289
|
+
height: `${cfg.size}px`,
|
|
12244
12290
|
borderRadius: "50%",
|
|
12245
12291
|
border: `1px solid ${theme.axisBorder}`,
|
|
12246
12292
|
background: theme.tooltip.background,
|
|
@@ -12259,6 +12305,7 @@ var TradeButton = class {
|
|
|
12259
12305
|
pointerEvents: "auto",
|
|
12260
12306
|
userSelect: "none"
|
|
12261
12307
|
});
|
|
12308
|
+
this.applyIconSize(cfg.iconSize);
|
|
12262
12309
|
this.el.addEventListener("click", (e) => {
|
|
12263
12310
|
e.stopPropagation();
|
|
12264
12311
|
onClick();
|
|
@@ -12306,6 +12353,27 @@ var TradeButton = class {
|
|
|
12306
12353
|
right: `${priceAxisWidth + 26}px`
|
|
12307
12354
|
});
|
|
12308
12355
|
}
|
|
12356
|
+
/**
|
|
12357
|
+
* Toggle mobile sizing. When `isMobile` is true, the button diameter and
|
|
12358
|
+
* inner SVG icon are swapped for the configured mobile values; when false,
|
|
12359
|
+
* they revert to desktop values.
|
|
12360
|
+
*/
|
|
12361
|
+
setMobileMode(isMobile) {
|
|
12362
|
+
if (this._isMobile === isMobile) return;
|
|
12363
|
+
this._isMobile = isMobile;
|
|
12364
|
+
const size = isMobile ? this.cfg.mobileSize : this.cfg.size;
|
|
12365
|
+
const iconSize = isMobile ? this.cfg.mobileIconSize : this.cfg.iconSize;
|
|
12366
|
+
this.el.style.width = `${size}px`;
|
|
12367
|
+
this.el.style.height = `${size}px`;
|
|
12368
|
+
this.applyIconSize(iconSize);
|
|
12369
|
+
}
|
|
12370
|
+
applyIconSize(size) {
|
|
12371
|
+
const svg = this.el.querySelector("svg");
|
|
12372
|
+
if (svg) {
|
|
12373
|
+
svg.setAttribute("width", String(size));
|
|
12374
|
+
svg.setAttribute("height", String(size));
|
|
12375
|
+
}
|
|
12376
|
+
}
|
|
12309
12377
|
};
|
|
12310
12378
|
|
|
12311
12379
|
// src/ui/TradePopover.ts
|
|
@@ -13978,7 +14046,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
13978
14046
|
Math.min(Math.ceil(this.viewport.endIndex), Math.round(rawBarIndex))
|
|
13979
14047
|
);
|
|
13980
14048
|
const bar = this.dataStore.all[clamped] ?? null;
|
|
13981
|
-
this.crosshair = isInChartArea && !this.tradePopover?.isVisible ? { x, y, barIndex: clamped, price, bar } : null;
|
|
14049
|
+
this.crosshair = isInChartArea && !this.tradePopover?.isVisible && this.selectedTradeLabel === null ? { x, y, barIndex: clamped, price, bar } : null;
|
|
13982
14050
|
if (this.crosshair) this.emitter.emit("crosshair", this.crosshair);
|
|
13983
14051
|
const hoveringDotLevel = this.positionRenderStyle === "dot" && this.hoveredTradeLabel !== null;
|
|
13984
14052
|
if (this.tradeButton) {
|
|
@@ -14497,7 +14565,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
14497
14565
|
Math.min(Math.ceil(this.viewport.endIndex), Math.round(rawBarIndex))
|
|
14498
14566
|
);
|
|
14499
14567
|
const bar = this.dataStore.all[clamped] ?? null;
|
|
14500
|
-
this.crosshair = { x, y, barIndex: clamped, price, bar };
|
|
14568
|
+
this.crosshair = this.selectedTradeLabel === null ? { x, y, barIndex: clamped, price, bar } : null;
|
|
14501
14569
|
if (this.tradeButton) {
|
|
14502
14570
|
this.tradeButton.setY(y);
|
|
14503
14571
|
if (this._isTradingActive) {
|
|
@@ -15107,30 +15175,32 @@ var _ChartEngine = class _ChartEngine {
|
|
|
15107
15175
|
padding: "0 2px"
|
|
15108
15176
|
});
|
|
15109
15177
|
this.canvasWrap.appendChild(this.textInputEl);
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
|
|
15127
|
-
|
|
15128
|
-
|
|
15129
|
-
|
|
15130
|
-
|
|
15131
|
-
|
|
15132
|
-
|
|
15133
|
-
|
|
15178
|
+
if (showUI) {
|
|
15179
|
+
this.loadingOverlayEl = document.createElement("div");
|
|
15180
|
+
Object.assign(this.loadingOverlayEl.style, {
|
|
15181
|
+
display: "none",
|
|
15182
|
+
position: "absolute",
|
|
15183
|
+
top: "0",
|
|
15184
|
+
left: "0",
|
|
15185
|
+
width: "100%",
|
|
15186
|
+
height: "100%",
|
|
15187
|
+
alignItems: "center",
|
|
15188
|
+
justifyContent: "center",
|
|
15189
|
+
pointerEvents: "none",
|
|
15190
|
+
zIndex: "20"
|
|
15191
|
+
});
|
|
15192
|
+
const loadingLabel = document.createElement("span");
|
|
15193
|
+
loadingLabel.textContent = this.labels.chart.loading;
|
|
15194
|
+
Object.assign(loadingLabel.style, {
|
|
15195
|
+
color: "rgba(200,200,200,0.9)",
|
|
15196
|
+
fontSize: "13px",
|
|
15197
|
+
background: "rgba(0,0,0,0.45)",
|
|
15198
|
+
padding: "4px 12px",
|
|
15199
|
+
borderRadius: "4px"
|
|
15200
|
+
});
|
|
15201
|
+
this.loadingOverlayEl.appendChild(loadingLabel);
|
|
15202
|
+
this.canvasWrap.appendChild(this.loadingOverlayEl);
|
|
15203
|
+
}
|
|
15134
15204
|
if (showUI) {
|
|
15135
15205
|
this.siEl = document.createElement("div");
|
|
15136
15206
|
Object.assign(this.siEl.style, {
|
|
@@ -15262,7 +15332,8 @@ var _ChartEngine = class _ChartEngine {
|
|
|
15262
15332
|
);
|
|
15263
15333
|
}
|
|
15264
15334
|
},
|
|
15265
|
-
this.labels.trade
|
|
15335
|
+
this.labels.trade,
|
|
15336
|
+
this.uiConfig.tradeButton
|
|
15266
15337
|
);
|
|
15267
15338
|
this.canvasWrap.appendChild(this.tradeButton.el);
|
|
15268
15339
|
this.tradeButton.el.addEventListener("mouseenter", () => {
|
|
@@ -15862,6 +15933,30 @@ var _ChartEngine = class _ChartEngine {
|
|
|
15862
15933
|
this.emitStateChange();
|
|
15863
15934
|
return this;
|
|
15864
15935
|
}
|
|
15936
|
+
/** Programmatically change the active timeframe and reload data. */
|
|
15937
|
+
setTimeframe(tf) {
|
|
15938
|
+
this.timeframe = tf;
|
|
15939
|
+
this.topBar?.setTimeframe(tf);
|
|
15940
|
+
this.emitter.emit("timeframeChange", { timeframe: tf });
|
|
15941
|
+
this.emitStateChange();
|
|
15942
|
+
this.updateCountdownState();
|
|
15943
|
+
this.triggerLoad("timeframe");
|
|
15944
|
+
return this;
|
|
15945
|
+
}
|
|
15946
|
+
/** Update per-theme deep-partial color overrides and rebuild the active theme. */
|
|
15947
|
+
setThemeOverrides(overrides) {
|
|
15948
|
+
this.themeOverrides = overrides;
|
|
15949
|
+
this.theme = this.buildTheme(this.themeName);
|
|
15950
|
+
this.topBar?.setTheme(this.theme);
|
|
15951
|
+
this.bottomBar?.setTheme(this.theme);
|
|
15952
|
+
this.leftBar?.setTheme(this.theme);
|
|
15953
|
+
this.tradeButton?.setTheme(this.theme, this.priceAxisWidth);
|
|
15954
|
+
this.tradePopover?.setTheme(this.theme);
|
|
15955
|
+
this.indicatorSettingsDialog?.setTheme(this.theme);
|
|
15956
|
+
this.chartSettingsDialog?.setTheme(this.theme);
|
|
15957
|
+
this.scheduleRender();
|
|
15958
|
+
return this;
|
|
15959
|
+
}
|
|
15865
15960
|
setSeries(series) {
|
|
15866
15961
|
this.series = series;
|
|
15867
15962
|
this.topBar?.setSeries(series);
|
|
@@ -16503,12 +16598,13 @@ var _ChartEngine = class _ChartEngine {
|
|
|
16503
16598
|
return this;
|
|
16504
16599
|
}
|
|
16505
16600
|
/**
|
|
16506
|
-
* Set or clear the estimated PNL text shown on
|
|
16507
|
-
*
|
|
16601
|
+
* Set or clear the estimated PNL text shown on the SL or TP bracket line.
|
|
16602
|
+
* Applies to the currently active bracket host — a draft order while drafting,
|
|
16603
|
+
* or the selected/hovered level while editing an existing pending order or position.
|
|
16604
|
+
* Pass `null` to clear the text.
|
|
16508
16605
|
* Use this to display the consumer-calculated estimated profit/loss next to the bracket.
|
|
16509
16606
|
*/
|
|
16510
16607
|
setDraftBracketPnl(type, pnlText) {
|
|
16511
|
-
if (!this.draftOrderLabel) return this;
|
|
16512
16608
|
if (type === "sl") {
|
|
16513
16609
|
this.draftBracketPnl = { ...this.draftBracketPnl, sl: pnlText ?? void 0 };
|
|
16514
16610
|
} else {
|
|
@@ -16586,6 +16682,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
16586
16682
|
*/
|
|
16587
16683
|
selectLevel(label) {
|
|
16588
16684
|
this.selectedTradeLabel = label;
|
|
16685
|
+
if (label !== null) this.crosshair = null;
|
|
16589
16686
|
this.renderTradeLayer();
|
|
16590
16687
|
return this;
|
|
16591
16688
|
}
|
|
@@ -17111,16 +17208,14 @@ var _ChartEngine = class _ChartEngine {
|
|
|
17111
17208
|
if (!level) return;
|
|
17112
17209
|
if (label === this.draftOrderLabel) {
|
|
17113
17210
|
const mainEntry = changes.find((c) => c.field === "main");
|
|
17114
|
-
const slEntry = changes.find((c) => c.field === "stopLoss" && c.isNew);
|
|
17115
|
-
const tpEntry = changes.find((c) => c.field === "takeProfit" && c.isNew);
|
|
17116
17211
|
const draft = level;
|
|
17117
17212
|
this._onOrderSubmit?.({
|
|
17118
17213
|
price: mainEntry?.newPrice ?? draft.price,
|
|
17119
17214
|
lots: this._minLots,
|
|
17120
17215
|
side: draft.side,
|
|
17121
17216
|
orderType: draft.orderType,
|
|
17122
|
-
...
|
|
17123
|
-
...
|
|
17217
|
+
...draft.stopLossPrice !== void 0 ? { stopLoss: draft.stopLossPrice } : {},
|
|
17218
|
+
...draft.takeProfitPrice !== void 0 ? { takeProfit: draft.takeProfitPrice } : {}
|
|
17124
17219
|
});
|
|
17125
17220
|
this.emitter.emit("tradeLevelConfirmed", {
|
|
17126
17221
|
label,
|
|
@@ -17690,6 +17785,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
17690
17785
|
this._mobileLayout = isMobile;
|
|
17691
17786
|
this.leftBar?.setMobileMode(isMobile);
|
|
17692
17787
|
this.topBar?.setMobileLayout(isMobile);
|
|
17788
|
+
this.tradeButton?.setMobileMode(isMobile);
|
|
17693
17789
|
if (this.siEl) {
|
|
17694
17790
|
this.siEl.style.flexDirection = isMobile ? "column" : "row";
|
|
17695
17791
|
this.siEl.style.alignItems = isMobile ? "flex-start" : "center";
|
|
@@ -17854,7 +17950,7 @@ var _ChartEngine = class _ChartEngine {
|
|
|
17854
17950
|
Math.min(Math.ceil(this.viewport.endIndex), Math.round(rawBarIndex))
|
|
17855
17951
|
);
|
|
17856
17952
|
const bar = this.dataStore.all[clamped] ?? null;
|
|
17857
|
-
this.crosshair = { x, y, barIndex: clamped, price, bar };
|
|
17953
|
+
this.crosshair = this.selectedTradeLabel === null ? { x, y, barIndex: clamped, price, bar } : null;
|
|
17858
17954
|
if (this.tradeButton) {
|
|
17859
17955
|
this.tradeButton.setY(y);
|
|
17860
17956
|
if (this._isTradingActive) {
|
|
@@ -18303,6 +18399,6 @@ function defaultTransform(msg) {
|
|
|
18303
18399
|
};
|
|
18304
18400
|
}
|
|
18305
18401
|
|
|
18306
|
-
export { AbcdPattern, AnchoredNote, AnchoredVP, Arc, ArrowDown, ArrowMarker, ArrowUp, BatPattern, Brush, ButterflyPattern, Callout, ChartEngine, Circle, CrabPattern, CrossLine, CyclicLines, CypherPattern, DARK_THEME, DEFAULT_BOTTOM_BAR_CONFIG, DEFAULT_CROSSHAIR_CONFIG, DEFAULT_DRAWING_TOOLBAR_CONFIG, DEFAULT_INDICATOR_OVERLAY_CONFIG, DEFAULT_LABELS, DEFAULT_PRICE_AXIS_CONFIG, DEFAULT_TIME_AXIS_CONFIG, DEFAULT_TOP_BAR_CONFIG, DEFAULT_UI_CONFIG, DatePriceRange, DateRange, DisjointChannel, DrawingManager, ElliottCombination, ElliottCorrective, ElliottImpulse, ElliottTriangle, ElliottWxy, Ellipse, FibChannel, FibCircles, FibExtension, FibFan, FibProjection, FibRetracement, FibSpiral, FibTimezone, FixedRangeVP, Flag, FlatChannel, GannBox, GannFan, GannSquare, GartleyPattern, GhostFeed, HeadShoulders, Highlighter, HorizontalLine, InsidePitchfork, LIGHT_THEME, ModifiedSchiff, ParallelChannel, Path, Pitchfork, Polyline, PriceLabel, PriceNote, PriceProjection, PriceRange, Projection, Rectangle, RegressionTrend, RotatedRectangle, Ruler, SchiffPitchfork, SharkPattern, SineLine, Text, ThreeDrives, TimeCycles, TrendAngle, TrendLine, Triangle, TrianglePattern, VerticalLine, VolumeProfile, WebSocketAdapter, aggregateCandles, deepMergeTheme, resolveCssVarsInTheme, resolveLabels, resolveUiConfig };
|
|
18402
|
+
export { AbcdPattern, AnchoredNote, AnchoredVP, Arc, ArrowDown, ArrowMarker, ArrowUp, BatPattern, Brush, ButterflyPattern, Callout, ChartEngine, Circle, CrabPattern, CrossLine, CyclicLines, CypherPattern, DARK_THEME, DEFAULT_BOTTOM_BAR_CONFIG, DEFAULT_CROSSHAIR_CONFIG, DEFAULT_DRAWING_TOOLBAR_CONFIG, DEFAULT_INDICATOR_OVERLAY_CONFIG, DEFAULT_LABELS, DEFAULT_PRICE_AXIS_CONFIG, DEFAULT_TIME_AXIS_CONFIG, DEFAULT_TOP_BAR_CONFIG, DEFAULT_TRADE_BUTTON_CONFIG, DEFAULT_UI_CONFIG, DatePriceRange, DateRange, DisjointChannel, DrawingManager, ElliottCombination, ElliottCorrective, ElliottImpulse, ElliottTriangle, ElliottWxy, Ellipse, FibChannel, FibCircles, FibExtension, FibFan, FibProjection, FibRetracement, FibSpiral, FibTimezone, FixedRangeVP, Flag, FlatChannel, GannBox, GannFan, GannSquare, GartleyPattern, GhostFeed, HeadShoulders, Highlighter, HorizontalLine, InsidePitchfork, LIGHT_THEME, ModifiedSchiff, ParallelChannel, Path, Pitchfork, Polyline, PriceLabel, PriceNote, PriceProjection, PriceRange, Projection, Rectangle, RegressionTrend, RotatedRectangle, Ruler, SchiffPitchfork, SharkPattern, SineLine, Text, ThreeDrives, TimeCycles, TrendAngle, TrendLine, Triangle, TrianglePattern, VerticalLine, VolumeProfile, WebSocketAdapter, aggregateCandles, deepMergeTheme, resolveCssVarsInTheme, resolveLabels, resolveUiConfig };
|
|
18307
18403
|
//# sourceMappingURL=index.js.map
|
|
18308
18404
|
//# sourceMappingURL=index.js.map
|