acttrader-charts 1.0.9 → 1.0.11

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.
@@ -488,7 +488,7 @@ interface PriceRange {
488
488
  }
489
489
  type SeriesType = "candlestick" | "hollow" | "line" | "area" | "ohlc" | "heikinashi" | "volumecandles" | "linemarkers" | "step" | "hlcarea" | "baseline" | "columns" | "highlow";
490
490
  type Theme = "dark" | "light";
491
- type Timeframe = "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "1D" | "1W" | "1M" | "1Y";
491
+ type Timeframe = "1m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "8h" | "1D" | "1W" | "1M";
492
492
  type Duration = "1D" | "5D" | "1M" | "3M" | "6M" | "1Y" | "5Y" | "All";
493
493
  interface Padding {
494
494
  top: number;
@@ -534,11 +534,19 @@ interface ChartConfig {
534
534
  */
535
535
  onSymbolClick?: (symbol: string) => void;
536
536
  padding?: Partial<Padding>;
537
- /** Minimum (and default) lot size shown in the trade popover and pre-filled in the draft order qty input (default: 1) */
537
+ /**
538
+ * @deprecated DraftOrderQtyInput has been removed. This value is stored
539
+ * internally and used as the submitted lot size, but no qty input is shown.
540
+ * Minimum (and default) lot size for draft order submission. Default: `1`.
541
+ */
538
542
  minLots?: number;
539
543
  /** Called when user submits an order via the floating trade button */
540
544
  onOrderSubmit?: (order: OrderSubmit) => void;
541
- /** Called when the user changes the qty input on a draft order. Use to sync external order panels. */
545
+ /**
546
+ * @deprecated DraftOrderQtyInput has been removed. This callback is accepted
547
+ * for backward compatibility but will never fire — there is no qty input to change.
548
+ * Use external state to track lot size.
549
+ */
542
550
  onLotsChange?: (lots: number) => void;
543
551
  /** @deprecated Use onLevelEdit which delivers all changes in one event. */
544
552
  onLevelDragEnd?: (payload: {
@@ -742,9 +750,13 @@ interface ChartConfig {
742
750
  */
743
751
  hideLevelConfirmCancel?: boolean;
744
752
  /**
745
- * Hide the floating Qty input overlay shown on draft orders.
746
- * Use when the host app manages lot-size entry natively.
747
- * Default: `false`.
753
+ * When `true`, a theme toggle (Dark / Light) is shown in the Settings dialog.
754
+ * Default: `false` the toggle is hidden.
755
+ */
756
+ enableThemeToggle?: boolean;
757
+ /**
758
+ * @deprecated DraftOrderQtyInput has been removed. This option is a no-op.
759
+ * Accepted for backward compatibility only.
748
760
  */
749
761
  hideQtyButton?: boolean;
750
762
  }
@@ -952,6 +964,13 @@ type ChartEventMap = {
952
964
  bracketType?: 'stopLoss' | 'takeProfit';
953
965
  isFullscreen: boolean;
954
966
  };
967
+ /** Emitted at the instant a bracket (SL/TP) drag begins — before any movement.
968
+ * Native layers listen to this to suppress tap-outside dismiss while dragging. */
969
+ tradeLevelDragStart: {
970
+ label: string;
971
+ bracketType: 'stopLoss' | 'takeProfit';
972
+ isFullscreen: boolean;
973
+ };
955
974
  /** Emitted when chart's ✓ button confirms an edit (including draft orders). External panel listens to reset/close itself. */
956
975
  tradeLevelConfirmed: {
957
976
  label: string;
@@ -988,7 +1007,7 @@ type ChartEventMap = {
988
1007
  openingBar: OHLCVBar;
989
1008
  intervalMs: number;
990
1009
  };
991
- /** Emitted after addLevelBracket() auto-places a SL or TP bracket so consumers can populate their form's price field. */
1010
+ /** Emitted after addLevelBracket() / addBracket() auto-places a SL or TP bracket so consumers can populate their form's price field. label is an empty string when the bracket was placed on a draft order (no external ID yet). */
992
1011
  tradeLevelBracketActivated: {
993
1012
  label: string;
994
1013
  bracketType: 'sl' | 'tp';
@@ -488,7 +488,7 @@ interface PriceRange {
488
488
  }
489
489
  type SeriesType = "candlestick" | "hollow" | "line" | "area" | "ohlc" | "heikinashi" | "volumecandles" | "linemarkers" | "step" | "hlcarea" | "baseline" | "columns" | "highlow";
490
490
  type Theme = "dark" | "light";
491
- type Timeframe = "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "1D" | "1W" | "1M" | "1Y";
491
+ type Timeframe = "1m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "8h" | "1D" | "1W" | "1M";
492
492
  type Duration = "1D" | "5D" | "1M" | "3M" | "6M" | "1Y" | "5Y" | "All";
493
493
  interface Padding {
494
494
  top: number;
@@ -534,11 +534,19 @@ interface ChartConfig {
534
534
  */
535
535
  onSymbolClick?: (symbol: string) => void;
536
536
  padding?: Partial<Padding>;
537
- /** Minimum (and default) lot size shown in the trade popover and pre-filled in the draft order qty input (default: 1) */
537
+ /**
538
+ * @deprecated DraftOrderQtyInput has been removed. This value is stored
539
+ * internally and used as the submitted lot size, but no qty input is shown.
540
+ * Minimum (and default) lot size for draft order submission. Default: `1`.
541
+ */
538
542
  minLots?: number;
539
543
  /** Called when user submits an order via the floating trade button */
540
544
  onOrderSubmit?: (order: OrderSubmit) => void;
541
- /** Called when the user changes the qty input on a draft order. Use to sync external order panels. */
545
+ /**
546
+ * @deprecated DraftOrderQtyInput has been removed. This callback is accepted
547
+ * for backward compatibility but will never fire — there is no qty input to change.
548
+ * Use external state to track lot size.
549
+ */
542
550
  onLotsChange?: (lots: number) => void;
543
551
  /** @deprecated Use onLevelEdit which delivers all changes in one event. */
544
552
  onLevelDragEnd?: (payload: {
@@ -742,9 +750,13 @@ interface ChartConfig {
742
750
  */
743
751
  hideLevelConfirmCancel?: boolean;
744
752
  /**
745
- * Hide the floating Qty input overlay shown on draft orders.
746
- * Use when the host app manages lot-size entry natively.
747
- * Default: `false`.
753
+ * When `true`, a theme toggle (Dark / Light) is shown in the Settings dialog.
754
+ * Default: `false` the toggle is hidden.
755
+ */
756
+ enableThemeToggle?: boolean;
757
+ /**
758
+ * @deprecated DraftOrderQtyInput has been removed. This option is a no-op.
759
+ * Accepted for backward compatibility only.
748
760
  */
749
761
  hideQtyButton?: boolean;
750
762
  }
@@ -952,6 +964,13 @@ type ChartEventMap = {
952
964
  bracketType?: 'stopLoss' | 'takeProfit';
953
965
  isFullscreen: boolean;
954
966
  };
967
+ /** Emitted at the instant a bracket (SL/TP) drag begins — before any movement.
968
+ * Native layers listen to this to suppress tap-outside dismiss while dragging. */
969
+ tradeLevelDragStart: {
970
+ label: string;
971
+ bracketType: 'stopLoss' | 'takeProfit';
972
+ isFullscreen: boolean;
973
+ };
955
974
  /** Emitted when chart's ✓ button confirms an edit (including draft orders). External panel listens to reset/close itself. */
956
975
  tradeLevelConfirmed: {
957
976
  label: string;
@@ -988,7 +1007,7 @@ type ChartEventMap = {
988
1007
  openingBar: OHLCVBar;
989
1008
  intervalMs: number;
990
1009
  };
991
- /** Emitted after addLevelBracket() auto-places a SL or TP bracket so consumers can populate their form's price field. */
1010
+ /** Emitted after addLevelBracket() / addBracket() auto-places a SL or TP bracket so consumers can populate their form's price field. label is an empty string when the bracket was placed on a draft order (no external ID yet). */
992
1011
  tradeLevelBracketActivated: {
993
1012
  label: string;
994
1013
  bracketType: 'sl' | 'tp';
@@ -374,32 +374,21 @@ var KeltnerChannels = class {
374
374
  Math.abs(bar.low - data[i - 1].close)
375
375
  );
376
376
  if (atr === null) {
377
- if (i < this.atrPeriod) {
378
- results.pop();
379
- results.push({ index: i, value: null, upper: null, lower: null });
380
- if (i === this.atrPeriod - 1) {
381
- let trSum = 0;
382
- for (let j = 0; j < this.atrPeriod; j++) {
383
- const b = data[i - j];
384
- const prev = data[i - j - 1];
385
- const trj = j === i ? b.high - b.low : Math.max(
386
- b.high - b.low,
387
- Math.abs(b.high - prev.close),
388
- Math.abs(b.low - prev.close)
389
- );
390
- trSum += trj;
391
- }
392
- atr = trSum / this.atrPeriod;
393
- }
394
- continue;
377
+ let trSum = 0;
378
+ for (let j = 0; j < this.atrPeriod; j++) {
379
+ const b = data[i - j];
380
+ const prev = i - j > 0 ? data[i - j - 1] : null;
381
+ const trj = prev == null ? b.high - b.low : Math.max(
382
+ b.high - b.low,
383
+ Math.abs(b.high - prev.close),
384
+ Math.abs(b.low - prev.close)
385
+ );
386
+ trSum += trj;
395
387
  }
388
+ atr = trSum / this.atrPeriod;
396
389
  } else {
397
390
  atr = (atr * (this.atrPeriod - 1) + tr) / this.atrPeriod;
398
391
  }
399
- if (atr === null) {
400
- results.push({ index: i, value: null, upper: null, lower: null });
401
- continue;
402
- }
403
392
  const upper = ema + this.mult * atr;
404
393
  const lower = ema - this.mult * atr;
405
394
  results.push({ index: i, value: ema, upper, lower });
@@ -2519,5 +2508,5 @@ var LinearRegression = class {
2519
2508
  };
2520
2509
 
2521
2510
  export { ADX, ATR, AccDistribution, AwesomeOscillator, BollingerBands, CCI, CMF, DonchianChannels, EMA, FibRetracementIndicator, HMA, HeikinAshi, IchimokuCloud, KeltnerChannels, LinearRegression, MACD, MARibbon, MFI, OBV, ParabolicSAR, PivotPoints, ROC, RSI, SMA, StochRSI, Stochastic, Supertrend, VOL, VWAP, WMA, WilliamsR };
2522
- //# sourceMappingURL=chunk-X6OSI4P2.js.map
2523
- //# sourceMappingURL=chunk-X6OSI4P2.js.map
2511
+ //# sourceMappingURL=chunk-3H3T5S77.js.map
2512
+ //# sourceMappingURL=chunk-3H3T5S77.js.map