acttrader-charts 1.0.9 → 1.0.10

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,12 +534,8 @@ 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) */
538
- minLots?: number;
539
537
  /** Called when user submits an order via the floating trade button */
540
538
  onOrderSubmit?: (order: OrderSubmit) => void;
541
- /** Called when the user changes the qty input on a draft order. Use to sync external order panels. */
542
- onLotsChange?: (lots: number) => void;
543
539
  /** @deprecated Use onLevelEdit which delivers all changes in one event. */
544
540
  onLevelDragEnd?: (payload: {
545
541
  label: string;
@@ -742,11 +738,10 @@ interface ChartConfig {
742
738
  */
743
739
  hideLevelConfirmCancel?: boolean;
744
740
  /**
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`.
741
+ * When `true`, a theme toggle (Dark / Light) is shown in the Settings dialog.
742
+ * Default: `false` the toggle is hidden.
748
743
  */
749
- hideQtyButton?: boolean;
744
+ enableThemeToggle?: boolean;
750
745
  }
751
746
  interface IndicatorResult {
752
747
  index: number;
@@ -988,7 +983,7 @@ type ChartEventMap = {
988
983
  openingBar: OHLCVBar;
989
984
  intervalMs: number;
990
985
  };
991
- /** Emitted after addLevelBracket() auto-places a SL or TP bracket so consumers can populate their form's price field. */
986
+ /** 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
987
  tradeLevelBracketActivated: {
993
988
  label: string;
994
989
  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,12 +534,8 @@ 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) */
538
- minLots?: number;
539
537
  /** Called when user submits an order via the floating trade button */
540
538
  onOrderSubmit?: (order: OrderSubmit) => void;
541
- /** Called when the user changes the qty input on a draft order. Use to sync external order panels. */
542
- onLotsChange?: (lots: number) => void;
543
539
  /** @deprecated Use onLevelEdit which delivers all changes in one event. */
544
540
  onLevelDragEnd?: (payload: {
545
541
  label: string;
@@ -742,11 +738,10 @@ interface ChartConfig {
742
738
  */
743
739
  hideLevelConfirmCancel?: boolean;
744
740
  /**
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`.
741
+ * When `true`, a theme toggle (Dark / Light) is shown in the Settings dialog.
742
+ * Default: `false` the toggle is hidden.
748
743
  */
749
- hideQtyButton?: boolean;
744
+ enableThemeToggle?: boolean;
750
745
  }
751
746
  interface IndicatorResult {
752
747
  index: number;
@@ -988,7 +983,7 @@ type ChartEventMap = {
988
983
  openingBar: OHLCVBar;
989
984
  intervalMs: number;
990
985
  };
991
- /** Emitted after addLevelBracket() auto-places a SL or TP bracket so consumers can populate their form's price field. */
986
+ /** 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
987
  tradeLevelBracketActivated: {
993
988
  label: string;
994
989
  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