acttrader-charts 1.4.0-beta.1 → 1.4.0-beta.3

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 CHANGED
@@ -983,6 +983,7 @@ chart.setVolume(show: boolean): this
983
983
 
984
984
  ```ts
985
985
  chart.addIndicator(indicator: IIndicator, initialParams?: IndicatorParams): this
986
+ chart.addIndicatorByName(shortName: string, params?: IndicatorParams): void // params from a host are normalised to the study's schema first: "20" → 20 (clamped to min/max), "Close" → 'close', TradingView's `length` → `period` — so a native settings sheet draws the same line as the web
986
987
  chart.addIndicatorByName(shortName: string, params?: IndicatorParams): void
987
988
  chart.removeIndicator(idOrShortName: string): this
988
989
  ```
@@ -1202,7 +1203,7 @@ Sub-pane heights are user-resizable by dragging the separator between panes.
1202
1203
  | `horizontalLine` | Horizontal Line | Single click |
1203
1204
  | `verticalLine` | Vertical Line | Single click |
1204
1205
  | `trendLine` | Trend Line | 2 clicks |
1205
- | `trendAngle` | Trend Angle | 2 clicks (shows angle) |
1206
+ | `trendAngle` | Trend Angle | 2 clicks. The angle is the drawing's own property: measured when a point is placed or dragged, kept while zooming, and saved as `angle` on the serialized drawing — so a synced drawing shows the same degrees on web, Android and iOS. |
1206
1207
  | `crossLine` | Cross Line | Single click (H+V) |
1207
1208
  | `parallelChannel` | Parallel Channel | 3 clicks |
1208
1209
  | `flatChannel` | Flat Channel | 2 clicks |
@@ -2280,6 +2281,13 @@ It flips to the other side of the touch rather than running off an edge, never
2280
2281
  takes pointer events (the drag is still in progress), and omits volume rather
2281
2282
  than printing a zero when the feed carries none. Default `false`.
2282
2283
 
2284
+ The long press itself (500 ms, finger still within 6 px) arms the crosshair on
2285
+ every touch platform. The chart claims that touch with `preventDefault()` so a
2286
+ WebView's own long-press gesture — WebKit's text-selection / callout recogniser
2287
+ on iOS, which used to cancel the touch at the same moment and left iPhones with
2288
+ no crosshair at all — cannot take it over; a cancel that still arrives after
2289
+ 300 ms of holding counts as the long press.
2290
+
2283
2291
  ### Native wrapper parity
2284
2292
 
2285
2293
  The four line tools are new `DrawingToolType` strings, so `setDrawingTool('ray')`
@@ -2492,6 +2492,12 @@ interface IDrawing {
2492
2492
  visible?: boolean;
2493
2493
  locked?: boolean;
2494
2494
  text?: string;
2495
+ /**
2496
+ * Trend Angle only: the line's angle in degrees from the horizontal — the
2497
+ * drawing's defining property, kept through zooms and carried across
2498
+ * platforms so the label reads the same everywhere. Other tools leave it unset.
2499
+ */
2500
+ angle?: number;
2495
2501
  /** Optional per-instance style override; falls back to theme defaults when absent. */
2496
2502
  style?: AnyDrawingStyle;
2497
2503
  render(ctx: CanvasRenderingContext2D, scale: ScaleManager, viewport: Viewport, priceRange: PriceRange, chartW: number, chartH: number, isSelected: boolean, pricePrecision?: number, theme?: ChartTheme, context?: DrawingRenderContext): void;
@@ -2511,6 +2517,14 @@ interface IDrawing {
2511
2517
  * a third time.
2512
2518
  */
2513
2519
  onPlaced?(): void;
2520
+ /**
2521
+ * Called after the user moved this drawing's points — while placing it,
2522
+ * dragging the whole drawing, or dragging a handle. Not called when the
2523
+ * engine re-anchors points to new data (reload, scroll-back, timeframe
2524
+ * change), so a tool that derives a property from where the user put the
2525
+ * points — Trend Angle's angle — can tell the two apart.
2526
+ */
2527
+ onPointsEdited?(): void;
2514
2528
  /** Returns the handle under (x, y), or null if none */
2515
2529
  getHandle(x: number, y: number, scale: ScaleManager, viewport: Viewport, priceRange: PriceRange, chartW: number, chartH: number): DrawingHandle | null;
2516
2530
  /**
@@ -2564,6 +2578,8 @@ interface SerializedDrawing {
2564
2578
  visible?: boolean;
2565
2579
  text?: string;
2566
2580
  locked?: boolean;
2581
+ /** Trend Angle: degrees from the horizontal. Present once the angle has been measured; see `IDrawing.angle`. */
2582
+ angle?: number;
2567
2583
  /** Optional per-instance style override; absent for drawings using theme defaults. */
2568
2584
  style?: AnyDrawingStyle;
2569
2585
  }
@@ -2492,6 +2492,12 @@ interface IDrawing {
2492
2492
  visible?: boolean;
2493
2493
  locked?: boolean;
2494
2494
  text?: string;
2495
+ /**
2496
+ * Trend Angle only: the line's angle in degrees from the horizontal — the
2497
+ * drawing's defining property, kept through zooms and carried across
2498
+ * platforms so the label reads the same everywhere. Other tools leave it unset.
2499
+ */
2500
+ angle?: number;
2495
2501
  /** Optional per-instance style override; falls back to theme defaults when absent. */
2496
2502
  style?: AnyDrawingStyle;
2497
2503
  render(ctx: CanvasRenderingContext2D, scale: ScaleManager, viewport: Viewport, priceRange: PriceRange, chartW: number, chartH: number, isSelected: boolean, pricePrecision?: number, theme?: ChartTheme, context?: DrawingRenderContext): void;
@@ -2511,6 +2517,14 @@ interface IDrawing {
2511
2517
  * a third time.
2512
2518
  */
2513
2519
  onPlaced?(): void;
2520
+ /**
2521
+ * Called after the user moved this drawing's points — while placing it,
2522
+ * dragging the whole drawing, or dragging a handle. Not called when the
2523
+ * engine re-anchors points to new data (reload, scroll-back, timeframe
2524
+ * change), so a tool that derives a property from where the user put the
2525
+ * points — Trend Angle's angle — can tell the two apart.
2526
+ */
2527
+ onPointsEdited?(): void;
2514
2528
  /** Returns the handle under (x, y), or null if none */
2515
2529
  getHandle(x: number, y: number, scale: ScaleManager, viewport: Viewport, priceRange: PriceRange, chartW: number, chartH: number): DrawingHandle | null;
2516
2530
  /**
@@ -2564,6 +2578,8 @@ interface SerializedDrawing {
2564
2578
  visible?: boolean;
2565
2579
  text?: string;
2566
2580
  locked?: boolean;
2581
+ /** Trend Angle: degrees from the horizontal. Present once the angle has been measured; see `IDrawing.angle`. */
2582
+ angle?: number;
2567
2583
  /** Optional per-instance style override; absent for drawings using theme defaults. */
2568
2584
  style?: AnyDrawingStyle;
2569
2585
  }