acttrader-charts 1.3.0-beta.4 → 1.3.0-beta.6

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.
@@ -1001,6 +1001,21 @@ interface ChartConfig {
1001
1001
  * Clamped to `[1, 3]`. Default: `1`.
1002
1002
  */
1003
1003
  tradeLevelButtonScale?: number;
1004
+ /**
1005
+ * What the SL/TP bracket pills show.
1006
+ *
1007
+ * `'price'` (default) renders the bracket price — `SL 4159.00`.
1008
+ * `'amount'` renders the money the position gains or loses if that bracket
1009
+ * is hit — `SL -$290.80` — computed from the level's `lots`, `contractSize`
1010
+ * and `valuePerPoint`. Falls back to the price for any level lacking the
1011
+ * data needed to compute it, so a partial rollout degrades gracefully.
1012
+ */
1013
+ bracketLabelMode?: 'price' | 'amount';
1014
+ /**
1015
+ * Currency symbol for SL/TP amounts, used when `bracketLabelMode: 'amount'`
1016
+ * and the level does not carry its own `currencySymbol`. Default `'$'`.
1017
+ */
1018
+ currencySymbol?: string;
1004
1019
  /**
1005
1020
  * When `true`, a theme toggle (Dark / Light) is shown in the Settings dialog.
1006
1021
  * Default: `false` — the toggle is hidden.
@@ -1226,6 +1241,15 @@ interface DrawingPoint {
1226
1241
  interface DrawingHandle {
1227
1242
  pointIndex: number;
1228
1243
  cursor: string;
1244
+ /**
1245
+ * Corners that are a mixture of two stored points — a rectangle's top-right
1246
+ * is `(p2.barIndex, p1.price)` — set these instead of relying on
1247
+ * `pointIndex` alone. The drag then writes the x to `points[xPointIndex]`
1248
+ * and the y to `points[yPointIndex]`, which is what makes all four corners
1249
+ * of a two-point shape draggable rather than just the two stored ones.
1250
+ */
1251
+ xPointIndex?: number;
1252
+ yPointIndex?: number;
1229
1253
  }
1230
1254
  /** Base per-instance style fields applicable to every drawing. */
1231
1255
  interface DrawingStyle {
@@ -1748,6 +1772,23 @@ interface PositionLevel {
1748
1772
  takeProfitPrice?: number;
1749
1773
  /** Data object for the TP bracket — returned in TP-related events instead of the parent's `data`. */
1750
1774
  takeProfitData?: unknown;
1775
+ /**
1776
+ * Units per lot for this instrument (e.g. `100` for XAUUSD, `100000` for most
1777
+ * FX pairs). Only used when `bracketLabelMode: 'amount'`, to convert an SL/TP
1778
+ * price distance into money. Default `1`.
1779
+ */
1780
+ contractSize?: number;
1781
+ /**
1782
+ * Account-currency value of one price unit per contract unit — folds in any
1783
+ * quote → account conversion. Only used when `bracketLabelMode: 'amount'`.
1784
+ * Default `1`.
1785
+ */
1786
+ valuePerPoint?: number;
1787
+ /**
1788
+ * Currency symbol for this level's SL/TP amounts. Falls back to
1789
+ * `ChartConfig.currencySymbol`, then `'$'`.
1790
+ */
1791
+ currencySymbol?: string;
1751
1792
  /**
1752
1793
  * When true, the entry price line becomes draggable — renders a grip handle and emits
1753
1794
  * `tradeLevelEdit` with `field: 'main'` on confirm. Use this for pending entry orders
@@ -1901,4 +1942,4 @@ declare class MACD implements IIndicator {
1901
1942
  render(ctx: CanvasRenderingContext2D, results: IndicatorResult[], scale: ScaleManager, viewport: Viewport, paneHeight: number, rangeOverride?: PriceRange): void;
1902
1943
  }
1903
1944
 
1904
- export { type DrawingToolbarUiConfig as $, type AnyDrawingStyle as A, BollingerBands as B, type ChartConfig as C, type DrawingToolType as D, DEFAULT_CROSSHAIR_CONFIG as E, DEFAULT_DRAWING_TOOLBAR_CONFIG as F, DEFAULT_INDICATOR_OVERLAY_CONFIG as G, DEFAULT_LABELS as H, type IIndicator as I, DEFAULT_LAYOUT_SYNC as J, DEFAULT_PRICE_AXIS_CONFIG as K, type LayoutSyncState as L, DEFAULT_TIME_AXIS_CONFIG as M, DEFAULT_TOP_BAR_CONFIG as N, type OHLCVBar as O, type PriceRange as P, DEFAULT_TRADE_BUTTON_CONFIG as Q, DEFAULT_UI_CONFIG as R, type SeriesType as S, type Timeframe as T, type DataLoaderParams as U, type Viewport as V, type DeepPartial$1 as W, type DeepPartialChartTheme as X, type DialogLabels as Y, type DrawingToolbarColors as Z, type DrawingToolbarLabels as _, type IndicatorParams as a, type Duration as a0, EMA as a1, type IndicatorOverlayColors as a2, type IndicatorOverlayUiConfig as a3, type IndicatorResult as a4, type IndicatorStateEntry as a5, LAYOUT_PRESETS as a6, LIGHT_THEME as a7, type LayoutPreset as a8, MACD as a9, getAllPresets as aA, getCustomPresets as aB, getPreset as aC, registerCustomPreset as aD, resolveCssVarsInTheme as aE, resolveLabels as aF, resolveUiConfig as aG, unregisterCustomPreset as aH, type PriceSource as aI, type OhlcLabels as aa, type OrderSubmit as ab, PRESETS_BY_COUNT as ac, PRESET_COUNTS as ad, PRESET_LABEL as ae, type Padding as af, type PendingOrderLevel as ag, type PositionLevel as ah, type PositionRenderStyle as ai, type PriceAxisUiConfig as aj, RSI as ak, SMA as al, type Theme as am, type ThemeOverrides as an, type TimeAxisUiConfig as ao, type TopBarColors as ap, type TopBarLabels as aq, type TopBarUiConfig as ar, type TradeButtonUiConfig as as, type TradeDisplayFilter as at, type TradeLabels as au, type TradeLevel as av, type TradeLevelColors as aw, type TradePanelColors as ax, type UiConfig as ay, deepMergeTheme as az, type ChartEventMap as b, type ChartState as c, type IDrawing as d, type IWebSocketAdapter as e, type TradeLevelType as f, type ChartTheme as g, type AnyLevel as h, type DrawingPoint as i, ScaleManager as j, type DrawingHandle as k, type SerializedDrawing as l, type Tick as m, type StreamStatus as n, type ActiveIndicatorState as o, type BottomBarColors as p, type BottomBarLabels as q, type BottomBarUiConfig as r, type CanvasColorSettings as s, type ChartLabels as t, type ChartMiscLabels as u, type ChartThemeUi as v, type CrosshairPosition as w, type CrosshairUiConfig as x, DARK_THEME as y, DEFAULT_BOTTOM_BAR_CONFIG as z };
1945
+ export { type DrawingToolbarLabels as $, type AnyDrawingStyle as A, BollingerBands as B, type ChartConfig as C, type Duration as D, DEFAULT_BOTTOM_BAR_CONFIG as E, DEFAULT_CROSSHAIR_CONFIG as F, DEFAULT_DRAWING_TOOLBAR_CONFIG as G, DEFAULT_INDICATOR_OVERLAY_CONFIG as H, type IIndicator as I, DEFAULT_LABELS as J, DEFAULT_LAYOUT_SYNC as K, type LayoutSyncState as L, DEFAULT_PRICE_AXIS_CONFIG as M, DEFAULT_TIME_AXIS_CONFIG as N, type OHLCVBar as O, type PriceRange as P, DEFAULT_TOP_BAR_CONFIG as Q, DEFAULT_TRADE_BUTTON_CONFIG as R, type SeriesType as S, type Timeframe as T, DEFAULT_UI_CONFIG as U, type Viewport as V, type DataLoaderParams as W, type DeepPartial$1 as X, type DeepPartialChartTheme as Y, type DialogLabels as Z, type DrawingToolbarColors as _, type IndicatorParams as a, type DrawingToolbarUiConfig as a0, EMA as a1, type IndicatorOverlayColors as a2, type IndicatorOverlayUiConfig as a3, type IndicatorResult as a4, type IndicatorStateEntry as a5, LAYOUT_PRESETS as a6, LIGHT_THEME as a7, type LayoutPreset as a8, MACD as a9, getAllPresets as aA, getCustomPresets as aB, getPreset as aC, registerCustomPreset as aD, resolveCssVarsInTheme as aE, resolveLabels as aF, resolveUiConfig as aG, unregisterCustomPreset as aH, type PriceSource as aI, type OhlcLabels as aa, type OrderSubmit as ab, PRESETS_BY_COUNT as ac, PRESET_COUNTS as ad, PRESET_LABEL as ae, type Padding as af, type PendingOrderLevel as ag, type PositionLevel as ah, type PositionRenderStyle as ai, type PriceAxisUiConfig as aj, RSI as ak, SMA as al, type Theme as am, type ThemeOverrides as an, type TimeAxisUiConfig as ao, type TopBarColors as ap, type TopBarLabels as aq, type TopBarUiConfig as ar, type TradeButtonUiConfig as as, type TradeDisplayFilter as at, type TradeLabels as au, type TradeLevel as av, type TradeLevelColors as aw, type TradePanelColors as ax, type UiConfig as ay, deepMergeTheme as az, type ChartEventMap as b, type ChartState as c, type DrawingToolType as d, type IDrawing as e, type IWebSocketAdapter as f, type TradeLevelType as g, type ChartTheme as h, type AnyLevel as i, type DrawingPoint as j, type DrawingHandle as k, ScaleManager as l, type SerializedDrawing as m, type Tick as n, type StreamStatus as o, type ActiveIndicatorState as p, type BottomBarColors as q, type BottomBarLabels as r, type BottomBarUiConfig as s, type CanvasColorSettings as t, type ChartLabels as u, type ChartMiscLabels as v, type ChartThemeUi as w, type CrosshairPosition as x, type CrosshairUiConfig as y, DARK_THEME as z };
@@ -1001,6 +1001,21 @@ interface ChartConfig {
1001
1001
  * Clamped to `[1, 3]`. Default: `1`.
1002
1002
  */
1003
1003
  tradeLevelButtonScale?: number;
1004
+ /**
1005
+ * What the SL/TP bracket pills show.
1006
+ *
1007
+ * `'price'` (default) renders the bracket price — `SL 4159.00`.
1008
+ * `'amount'` renders the money the position gains or loses if that bracket
1009
+ * is hit — `SL -$290.80` — computed from the level's `lots`, `contractSize`
1010
+ * and `valuePerPoint`. Falls back to the price for any level lacking the
1011
+ * data needed to compute it, so a partial rollout degrades gracefully.
1012
+ */
1013
+ bracketLabelMode?: 'price' | 'amount';
1014
+ /**
1015
+ * Currency symbol for SL/TP amounts, used when `bracketLabelMode: 'amount'`
1016
+ * and the level does not carry its own `currencySymbol`. Default `'$'`.
1017
+ */
1018
+ currencySymbol?: string;
1004
1019
  /**
1005
1020
  * When `true`, a theme toggle (Dark / Light) is shown in the Settings dialog.
1006
1021
  * Default: `false` — the toggle is hidden.
@@ -1226,6 +1241,15 @@ interface DrawingPoint {
1226
1241
  interface DrawingHandle {
1227
1242
  pointIndex: number;
1228
1243
  cursor: string;
1244
+ /**
1245
+ * Corners that are a mixture of two stored points — a rectangle's top-right
1246
+ * is `(p2.barIndex, p1.price)` — set these instead of relying on
1247
+ * `pointIndex` alone. The drag then writes the x to `points[xPointIndex]`
1248
+ * and the y to `points[yPointIndex]`, which is what makes all four corners
1249
+ * of a two-point shape draggable rather than just the two stored ones.
1250
+ */
1251
+ xPointIndex?: number;
1252
+ yPointIndex?: number;
1229
1253
  }
1230
1254
  /** Base per-instance style fields applicable to every drawing. */
1231
1255
  interface DrawingStyle {
@@ -1748,6 +1772,23 @@ interface PositionLevel {
1748
1772
  takeProfitPrice?: number;
1749
1773
  /** Data object for the TP bracket — returned in TP-related events instead of the parent's `data`. */
1750
1774
  takeProfitData?: unknown;
1775
+ /**
1776
+ * Units per lot for this instrument (e.g. `100` for XAUUSD, `100000` for most
1777
+ * FX pairs). Only used when `bracketLabelMode: 'amount'`, to convert an SL/TP
1778
+ * price distance into money. Default `1`.
1779
+ */
1780
+ contractSize?: number;
1781
+ /**
1782
+ * Account-currency value of one price unit per contract unit — folds in any
1783
+ * quote → account conversion. Only used when `bracketLabelMode: 'amount'`.
1784
+ * Default `1`.
1785
+ */
1786
+ valuePerPoint?: number;
1787
+ /**
1788
+ * Currency symbol for this level's SL/TP amounts. Falls back to
1789
+ * `ChartConfig.currencySymbol`, then `'$'`.
1790
+ */
1791
+ currencySymbol?: string;
1751
1792
  /**
1752
1793
  * When true, the entry price line becomes draggable — renders a grip handle and emits
1753
1794
  * `tradeLevelEdit` with `field: 'main'` on confirm. Use this for pending entry orders
@@ -1901,4 +1942,4 @@ declare class MACD implements IIndicator {
1901
1942
  render(ctx: CanvasRenderingContext2D, results: IndicatorResult[], scale: ScaleManager, viewport: Viewport, paneHeight: number, rangeOverride?: PriceRange): void;
1902
1943
  }
1903
1944
 
1904
- export { type DrawingToolbarUiConfig as $, type AnyDrawingStyle as A, BollingerBands as B, type ChartConfig as C, type DrawingToolType as D, DEFAULT_CROSSHAIR_CONFIG as E, DEFAULT_DRAWING_TOOLBAR_CONFIG as F, DEFAULT_INDICATOR_OVERLAY_CONFIG as G, DEFAULT_LABELS as H, type IIndicator as I, DEFAULT_LAYOUT_SYNC as J, DEFAULT_PRICE_AXIS_CONFIG as K, type LayoutSyncState as L, DEFAULT_TIME_AXIS_CONFIG as M, DEFAULT_TOP_BAR_CONFIG as N, type OHLCVBar as O, type PriceRange as P, DEFAULT_TRADE_BUTTON_CONFIG as Q, DEFAULT_UI_CONFIG as R, type SeriesType as S, type Timeframe as T, type DataLoaderParams as U, type Viewport as V, type DeepPartial$1 as W, type DeepPartialChartTheme as X, type DialogLabels as Y, type DrawingToolbarColors as Z, type DrawingToolbarLabels as _, type IndicatorParams as a, type Duration as a0, EMA as a1, type IndicatorOverlayColors as a2, type IndicatorOverlayUiConfig as a3, type IndicatorResult as a4, type IndicatorStateEntry as a5, LAYOUT_PRESETS as a6, LIGHT_THEME as a7, type LayoutPreset as a8, MACD as a9, getAllPresets as aA, getCustomPresets as aB, getPreset as aC, registerCustomPreset as aD, resolveCssVarsInTheme as aE, resolveLabels as aF, resolveUiConfig as aG, unregisterCustomPreset as aH, type PriceSource as aI, type OhlcLabels as aa, type OrderSubmit as ab, PRESETS_BY_COUNT as ac, PRESET_COUNTS as ad, PRESET_LABEL as ae, type Padding as af, type PendingOrderLevel as ag, type PositionLevel as ah, type PositionRenderStyle as ai, type PriceAxisUiConfig as aj, RSI as ak, SMA as al, type Theme as am, type ThemeOverrides as an, type TimeAxisUiConfig as ao, type TopBarColors as ap, type TopBarLabels as aq, type TopBarUiConfig as ar, type TradeButtonUiConfig as as, type TradeDisplayFilter as at, type TradeLabels as au, type TradeLevel as av, type TradeLevelColors as aw, type TradePanelColors as ax, type UiConfig as ay, deepMergeTheme as az, type ChartEventMap as b, type ChartState as c, type IDrawing as d, type IWebSocketAdapter as e, type TradeLevelType as f, type ChartTheme as g, type AnyLevel as h, type DrawingPoint as i, ScaleManager as j, type DrawingHandle as k, type SerializedDrawing as l, type Tick as m, type StreamStatus as n, type ActiveIndicatorState as o, type BottomBarColors as p, type BottomBarLabels as q, type BottomBarUiConfig as r, type CanvasColorSettings as s, type ChartLabels as t, type ChartMiscLabels as u, type ChartThemeUi as v, type CrosshairPosition as w, type CrosshairUiConfig as x, DARK_THEME as y, DEFAULT_BOTTOM_BAR_CONFIG as z };
1945
+ export { type DrawingToolbarLabels as $, type AnyDrawingStyle as A, BollingerBands as B, type ChartConfig as C, type Duration as D, DEFAULT_BOTTOM_BAR_CONFIG as E, DEFAULT_CROSSHAIR_CONFIG as F, DEFAULT_DRAWING_TOOLBAR_CONFIG as G, DEFAULT_INDICATOR_OVERLAY_CONFIG as H, type IIndicator as I, DEFAULT_LABELS as J, DEFAULT_LAYOUT_SYNC as K, type LayoutSyncState as L, DEFAULT_PRICE_AXIS_CONFIG as M, DEFAULT_TIME_AXIS_CONFIG as N, type OHLCVBar as O, type PriceRange as P, DEFAULT_TOP_BAR_CONFIG as Q, DEFAULT_TRADE_BUTTON_CONFIG as R, type SeriesType as S, type Timeframe as T, DEFAULT_UI_CONFIG as U, type Viewport as V, type DataLoaderParams as W, type DeepPartial$1 as X, type DeepPartialChartTheme as Y, type DialogLabels as Z, type DrawingToolbarColors as _, type IndicatorParams as a, type DrawingToolbarUiConfig as a0, EMA as a1, type IndicatorOverlayColors as a2, type IndicatorOverlayUiConfig as a3, type IndicatorResult as a4, type IndicatorStateEntry as a5, LAYOUT_PRESETS as a6, LIGHT_THEME as a7, type LayoutPreset as a8, MACD as a9, getAllPresets as aA, getCustomPresets as aB, getPreset as aC, registerCustomPreset as aD, resolveCssVarsInTheme as aE, resolveLabels as aF, resolveUiConfig as aG, unregisterCustomPreset as aH, type PriceSource as aI, type OhlcLabels as aa, type OrderSubmit as ab, PRESETS_BY_COUNT as ac, PRESET_COUNTS as ad, PRESET_LABEL as ae, type Padding as af, type PendingOrderLevel as ag, type PositionLevel as ah, type PositionRenderStyle as ai, type PriceAxisUiConfig as aj, RSI as ak, SMA as al, type Theme as am, type ThemeOverrides as an, type TimeAxisUiConfig as ao, type TopBarColors as ap, type TopBarLabels as aq, type TopBarUiConfig as ar, type TradeButtonUiConfig as as, type TradeDisplayFilter as at, type TradeLabels as au, type TradeLevel as av, type TradeLevelColors as aw, type TradePanelColors as ax, type UiConfig as ay, deepMergeTheme as az, type ChartEventMap as b, type ChartState as c, type DrawingToolType as d, type IDrawing as e, type IWebSocketAdapter as f, type TradeLevelType as g, type ChartTheme as h, type AnyLevel as i, type DrawingPoint as j, type DrawingHandle as k, ScaleManager as l, type SerializedDrawing as m, type Tick as n, type StreamStatus as o, type ActiveIndicatorState as p, type BottomBarColors as q, type BottomBarLabels as r, type BottomBarUiConfig as s, type CanvasColorSettings as t, type ChartLabels as u, type ChartMiscLabels as v, type ChartThemeUi as w, type CrosshairPosition as x, type CrosshairUiConfig as y, DARK_THEME as z };