@fintatech/fintachart 3.1.10 → 3.1.12

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.
@@ -42,6 +42,28 @@ declare module FintaChart {
42
42
  }
43
43
  declare module FintaChart {
44
44
  }
45
+ declare module FintaChart {
46
+ interface BBRun {
47
+ text: string;
48
+ bold: boolean;
49
+ italic: boolean;
50
+ underline: boolean;
51
+ color?: string;
52
+ }
53
+ class BBCode {
54
+ private static readonly MAX_LEN;
55
+ private static readonly MAX_TAGS;
56
+ private static readonly MAX_DEPTH;
57
+ private static readonly MAX_COLOR_LEN;
58
+ private static readonly NAMED_COLORS;
59
+ static parse(text: string): BBRun[][];
60
+ private static literal;
61
+ private static parseInternal;
62
+ private static readTag;
63
+ private static safeColor;
64
+ private static inByteRange;
65
+ }
66
+ }
45
67
  declare module FintaChart {
46
68
  }
47
69
  interface Math {
@@ -382,6 +404,11 @@ declare module FintaChart {
382
404
  * @param width
383
405
  * @param height
384
406
  */
407
+ /**
408
+ * Upper bound for the device pixel ratio used when sizing canvases.
409
+ * Lower values trade sharpness for far cheaper fills on mobile.
410
+ */
411
+ static dprCap: number;
385
412
  static canvasRetina(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D, width: number, height: number): void;
386
413
  /**
387
414
  * Returns full screen is enabled
@@ -533,6 +560,15 @@ declare module FintaChart {
533
560
  * @param value The CSS property value.
534
561
  */
535
562
  static css(el: HTMLElement, prop: string, value: string | number): void;
563
+ private static _rectCache;
564
+ private static _rectCacheStamp;
565
+ /**
566
+ * Bounding rect cached within an 8ms frame bucket.
567
+ *
568
+ * @param el The element.
569
+ * @return The (possibly cached) bounding rect.
570
+ */
571
+ static cachedBoundingRect(el: HTMLElement): DOMRect;
536
572
  /**
537
573
  * Converts client (viewport) coordinates to local element coordinates.
538
574
  *
@@ -590,6 +626,13 @@ declare module FintaChart {
590
626
  * @param topOffset The top CSS value (e.g. '6rem').
591
627
  */
592
628
  static centerHorizontally(el: HTMLElement, topOffset: string): void;
629
+ /**
630
+ * Binds a tap handler firing once on touch or click.
631
+ *
632
+ * @param el The target element.
633
+ * @param handler The tap handler.
634
+ */
635
+ static onTap(el: HTMLElement, handler: (e: Event) => void): void;
593
636
  /**
594
637
  * Shows an element by clearing its display style.
595
638
  *
@@ -691,6 +734,8 @@ declare module FintaChart {
691
734
  destroy(): void;
692
735
  /** Enables or disables dragging. */
693
736
  setEnabled(enabled: boolean): void;
737
+ /** Re-clamps the element inside its containment (e.g. after a resize). */
738
+ reclamp(): void;
694
739
  }
695
740
  /**
696
741
  * Makes an element draggable using native pointer events.
@@ -1878,6 +1923,10 @@ declare module FintaChart {
1878
1923
  * The ending date to load bars.
1879
1924
  */
1880
1925
  endDate?: Date;
1926
+ /**
1927
+ * Reset visible range to default view after load.
1928
+ */
1929
+ resetVisibleRange?: boolean;
1881
1930
  }
1882
1931
  }
1883
1932
  declare module FintaChart.Formatters {
@@ -2435,6 +2484,10 @@ declare module FintaChart {
2435
2484
  * Event object
2436
2485
  */
2437
2486
  evt: Event;
2487
+ /**
2488
+ * Overrides the native (read-only) `which` button value.
2489
+ */
2490
+ which?: number;
2438
2491
  /**
2439
2492
  * Pane
2440
2493
  */
@@ -2883,6 +2936,7 @@ declare module FintaChart {
2883
2936
  private _lastScale;
2884
2937
  private _prevScale;
2885
2938
  private _scaleThreshold;
2939
+ private _wheelDeltaAccum;
2886
2940
  /**
2887
2941
  * Delta
2888
2942
  */
@@ -2963,6 +3017,15 @@ declare module FintaChart {
2963
3017
  hide(): void;
2964
3018
  private init;
2965
3019
  private onClose;
3020
+ private onSubmit;
3021
+ private collectFormData;
3022
+ private validate;
3023
+ private isValidEmail;
3024
+ private sendPurchaseRequest;
3025
+ private sendViaBackend;
3026
+ private showError;
3027
+ private showSuccess;
3028
+ private clearMessages;
2966
3029
  }
2967
3030
  }
2968
3031
  declare module FintaChart {
@@ -3861,6 +3924,7 @@ declare module FintaChart {
3861
3924
  private _lineDashFunc;
3862
3925
  private _canvas;
3863
3926
  private _context;
3927
+ private _linearGradientCache;
3864
3928
  /**
3865
3929
  * Get canvas
3866
3930
  */
@@ -4730,6 +4794,8 @@ declare module FintaChart {
4730
4794
  private _canvasEl;
4731
4795
  private _parentEl;
4732
4796
  private _renderer;
4797
+ private _sizeCache;
4798
+ private _sizeCacheStamp;
4733
4799
  /**
4734
4800
  * The canvas element.
4735
4801
  */
@@ -5291,6 +5357,7 @@ declare module FintaChart {
5291
5357
  static enable(control: HTMLElement, enable: boolean): void;
5292
5358
  enable(value?: boolean): void;
5293
5359
  private static isElementReady;
5360
+ private static hasSpectrum;
5294
5361
  private initSpectrum;
5295
5362
  private waitForAttach;
5296
5363
  private static initParams;
@@ -5326,14 +5393,29 @@ declare module FintaChart {
5326
5393
  * Control Drag Pane's root container
5327
5394
  */
5328
5395
  protected rootContainer: HTMLElement;
5329
- /**
5330
- * Draggable controller instance
5331
- */
5332
- private _draggableController;
5333
5396
  /**
5334
5397
  * Bound resize handler reference for cleanup
5335
5398
  */
5336
5399
  private _resizeHandler;
5400
+ /**
5401
+ * Whether the pane has been placed at its initial position
5402
+ */
5403
+ private _positioned;
5404
+ /**
5405
+ * Pointer offset from the pane top-left at drag start
5406
+ */
5407
+ private _dragOffsetX;
5408
+ private _dragOffsetY;
5409
+ /**
5410
+ * Bound drag handlers for cleanup
5411
+ */
5412
+ private _onDragStart;
5413
+ private _onDragMove;
5414
+ private _onDragEnd;
5415
+ /**
5416
+ * Drag handle element
5417
+ */
5418
+ private _handleEl;
5337
5419
  get visible(): boolean;
5338
5420
  /**
5339
5421
  * Creates an instance of DragPane.
@@ -5354,7 +5436,18 @@ declare module FintaChart {
5354
5436
  * Shows Control Drag Pane
5355
5437
  */
5356
5438
  protected show(): void;
5357
- private adjustPosition;
5439
+ /** Returns the offsetParent rect the pane is positioned against. */
5440
+ private parentRect;
5441
+ /** Places the pane near the top-center of the chart. */
5442
+ private placeInitial;
5443
+ private onDragStart;
5444
+ private onDragMove;
5445
+ private onDragEnd;
5446
+ /** Sets absolute position within the offsetParent, clamped inside it. */
5447
+ private applyPosition;
5448
+ private clampIntoViewport;
5449
+ private eventPoint;
5450
+ private teardownDrag;
5358
5451
  private onResize;
5359
5452
  }
5360
5453
  }
@@ -5978,6 +6071,7 @@ declare module FintaChart {
5978
6071
  private _hasCustomPicker;
5979
6072
  private _isActive;
5980
6073
  private _last;
6074
+ private _hoverTimer;
5981
6075
  private _windowScrollHandler;
5982
6076
  private _windowResizeHandler;
5983
6077
  private _bodyClickHandler;
@@ -6018,6 +6112,42 @@ declare module FintaChart {
6018
6112
  private unsubscribe;
6019
6113
  }
6020
6114
  }
6115
+ declare module FintaChart {
6116
+ class ToolbarCalendar {
6117
+ private _chart;
6118
+ private _element;
6119
+ private _onSelect;
6120
+ private _selected;
6121
+ private _viewYear;
6122
+ private _viewMonth;
6123
+ private _months;
6124
+ private _weekdaysShort;
6125
+ private _clearText;
6126
+ private _todayText;
6127
+ constructor(chart: Chart, host: HTMLElement);
6128
+ get isVisible(): boolean;
6129
+ /**
6130
+ * Shows the calendar for the given selection.
6131
+ *
6132
+ * @param selected Currently selected date, highlighted in the grid.
6133
+ * @param onSelect Invoked with the picked date, or `null` when cleared.
6134
+ */
6135
+ show(selected: Date | null, onSelect: (date: Date | null) => void): void;
6136
+ hide(): void;
6137
+ private _loadLocalization;
6138
+ private _localize;
6139
+ private _splitLocalized;
6140
+ private _render;
6141
+ private _renderHeader;
6142
+ private _renderNavButton;
6143
+ private _renderGrid;
6144
+ private _renderDay;
6145
+ private _renderFooter;
6146
+ private _pick;
6147
+ private _isSameDay;
6148
+ private _shiftMonth;
6149
+ }
6150
+ }
6021
6151
  declare module FintaChart {
6022
6152
  /**
6023
6153
  * Represents Toolbar Config
@@ -6057,6 +6187,14 @@ declare module FintaChart {
6057
6187
  private _logScaleBtn;
6058
6188
  private _percentScaleBtn;
6059
6189
  private _lockShapesBtn;
6190
+ private _dateRangeButtons;
6191
+ private _dateRangeMenuItems;
6192
+ private _applyingDateRangePreset;
6193
+ private _dateRangeFrom;
6194
+ private _dateRangeTo;
6195
+ private _openDateRangePopup;
6196
+ private _dateRangeResizeObserver;
6197
+ private _dateRangeInlineWidth;
6060
6198
  private _scalePercentageAdapter;
6061
6199
  onAmountChanged: (quantity: number) => void;
6062
6200
  /**
@@ -6103,6 +6241,26 @@ declare module FintaChart {
6103
6241
  supportedTimeFramesShow(): void;
6104
6242
  private _createPeriodicityForm;
6105
6243
  private _subscribeToCreateCustomTimeFrame;
6244
+ private _subscribeDateRangeControls;
6245
+ private onDocumentTap;
6246
+ private _subscribeCollapsedDateRange;
6247
+ private _observeDateRangeWidth;
6248
+ private _subscribeCustomDateRange;
6249
+ private updateDateRangeApplyState;
6250
+ private formatDisplayDate;
6251
+ private truncateToDay;
6252
+ private endOfDay;
6253
+ /**
6254
+ * Applies a bottom-toolbar date-range preset (1D, 5D, ..., All).
6255
+ *
6256
+ * @param presetKey
6257
+ */
6258
+ applyDateRangePreset(presetKey: string): void;
6259
+ private applyDateRange;
6260
+ private setActiveDateRangeButton;
6261
+ private closestSupportedTimeFrame;
6262
+ private parseSupportedTimeFrame;
6263
+ private addToDate;
6106
6264
  setTimeFrame(timeFrame: TimeFrame): void;
6107
6265
  /**
6108
6266
  * Refresh toolbar components depend to size
@@ -6113,7 +6271,7 @@ declare module FintaChart {
6113
6271
  /**
6114
6272
  * Update trade panel units value
6115
6273
  *
6116
- * @param quantity
6274
+ * @param quantity default quantity expressed in units (backend contract)
6117
6275
  */
6118
6276
  updateTradeHandlerUnits(quantity: number): void;
6119
6277
  private activateStayInShapeModeBtn;
@@ -6132,6 +6290,8 @@ declare module FintaChart {
6132
6290
  private onCrossHairChange;
6133
6291
  private onDeleteClick;
6134
6292
  private onHideOptionClick;
6293
+ /** Reflects the hide buttons' active class from real chart state. */
6294
+ private syncHideButtonsState;
6135
6295
  onIndicatorsClick(): void;
6136
6296
  applyIndicator(typeName: string): void;
6137
6297
  private onInstrumentChange;
@@ -6179,6 +6339,7 @@ declare module FintaChart {
6179
6339
  private resetTradePanelOnInstrumentChange;
6180
6340
  private onLockShapesClick;
6181
6341
  private replaceLockIcon;
6342
+ private getStaticQuantitiesForCalc;
6182
6343
  private getQuantityRules;
6183
6344
  private normalizeAmountByRules;
6184
6345
  private getNumberDecimals;
@@ -6273,7 +6434,13 @@ declare module FintaChart {
6273
6434
  private hideDropDown;
6274
6435
  private init;
6275
6436
  private setValue;
6276
- private showDropDownForHover;
6437
+ /**
6438
+ * Handles a tap/click on the button head, routing to toggle, fire or
6439
+ * drop-down open depending on the button configuration and platform.
6440
+ *
6441
+ * @param e The originating tap/click event.
6442
+ */
6443
+ private handleHeadTap;
6277
6444
  private showDropDown;
6278
6445
  private toggleButton;
6279
6446
  private toggleDropDown;
@@ -8974,6 +9141,14 @@ declare module FintaChart {
8974
9141
  /**
8975
9142
  * Represents indicator state
8976
9143
  */
9144
+ /**
9145
+ * A single indicator plot value for the OHLC card.
9146
+ */
9147
+ interface IIndicatorHoverValue {
9148
+ name: string;
9149
+ color: string;
9150
+ value: string;
9151
+ }
8977
9152
  interface IIndicatorState {
8978
9153
  id?: string;
8979
9154
  parentId?: string;
@@ -9070,6 +9245,11 @@ declare module FintaChart {
9070
9245
  private _hovered;
9071
9246
  private _id;
9072
9247
  private _lineLevels;
9248
+ private _indicatorShapes;
9249
+ private _shapesById;
9250
+ private _shapesPanes;
9251
+ private _shapesForcePricePane;
9252
+ private _shapesFullyAttached;
9073
9253
  private _requireDefaults;
9074
9254
  private _optionsTitle;
9075
9255
  private _parametersContextMenu;
@@ -9125,6 +9305,7 @@ declare module FintaChart {
9125
9305
  get theme(): any;
9126
9306
  set theme(value: any);
9127
9307
  get lineLevels(): any[];
9308
+ get indicatorShapes(): Shape[];
9128
9309
  /**
9129
9310
  * Allow setting dialog state
9130
9311
  */
@@ -9299,6 +9480,15 @@ declare module FintaChart {
9299
9480
  * @param pointY
9300
9481
  */
9301
9482
  addLine(color: string, pointY: number): void;
9483
+ addShape(state: IShapeState): Shape | null;
9484
+ setIndicatorShapes(states: IShapeState[], opts?: {
9485
+ onPricePane?: boolean;
9486
+ }): void;
9487
+ upsertIndicatorShapes(states: IShapeState[]): void;
9488
+ removeIndicatorShapes(): void;
9489
+ private isPixelAnchoredShape;
9490
+ private routeAndAttach;
9491
+ private attachIndicatorShapes;
9302
9492
  /**
9303
9493
  * Add plot
9304
9494
  *
@@ -9395,6 +9585,13 @@ declare module FintaChart {
9395
9585
  */
9396
9586
  updateHoverRecord(record?: number): void;
9397
9587
  getValues(): DataRowsCollection;
9588
+ /**
9589
+ * Per-plot values at a record for the OHLC card.
9590
+ *
9591
+ * @param record Record index; defaults to hovered record.
9592
+ * @return One { name, color, value } per plot.
9593
+ */
9594
+ hoverValues(record?: number): IIndicatorHoverValue[];
9398
9595
  /**
9399
9596
  * Update visibility of title elements
9400
9597
  */
@@ -9504,6 +9701,8 @@ declare module FintaChart {
9504
9701
  SLOW: string;
9505
9702
  VOLUME_DIVISOR: string;
9506
9703
  OFFSET_MULTIPLIER: string;
9704
+ MULTIPLIER: string;
9705
+ BOX_RATIO_SMOOTHING: string;
9507
9706
  ENVELOPE_PERCENTAGE: string;
9508
9707
  BAR_COUNT: string;
9509
9708
  Q_PERIODS: string;
@@ -10840,6 +11039,8 @@ declare module FintaChart {
10840
11039
  */
10841
11040
  get period(): number;
10842
11041
  set period(value: number);
11042
+ get multiplier(): number;
11043
+ set multiplier(value: number);
10843
11044
  /**
10844
11045
  * The signal period.
10845
11046
  */
@@ -11724,6 +11925,8 @@ declare module FintaChart {
11724
11925
  */
11725
11926
  get period(): number;
11726
11927
  set period(value: number);
11928
+ get multiplier(): number;
11929
+ set multiplier(value: number);
11727
11930
  protected onInitializeIndicator(): void;
11728
11931
  protected onResetDefaults(): void;
11729
11932
  protected onInputTick(): void;
@@ -11880,6 +12083,8 @@ declare module FintaChart {
11880
12083
  static get type(): string;
11881
12084
  private _ema;
11882
12085
  private _emv;
12086
+ private _boxRatio;
12087
+ private _smoothedBoxRatio;
11883
12088
  /**
11884
12089
  * The smooth value.
11885
12090
  */
@@ -11890,6 +12095,11 @@ declare module FintaChart {
11890
12095
  */
11891
12096
  get volumeDivisor(): number;
11892
12097
  set volumeDivisor(value: number);
12098
+ /**
12099
+ * The box ratio smoothing period.
12100
+ */
12101
+ get boxRatioSmoothing(): number;
12102
+ set boxRatioSmoothing(value: number);
11893
12103
  protected onInitializeIndicator(): void;
11894
12104
  protected onResetDefaults(): void;
11895
12105
  protected onInputTick(): void;
@@ -11905,6 +12115,8 @@ declare module FintaChart {
11905
12115
  static get type(): string;
11906
12116
  private _smaFast;
11907
12117
  private _smaSlow;
12118
+ private _emaFast;
12119
+ private _emaSlow;
11908
12120
  /**
11909
12121
  * The fast SMA period.
11910
12122
  */
@@ -11920,6 +12132,11 @@ declare module FintaChart {
11920
12132
  */
11921
12133
  get slow(): number;
11922
12134
  set slow(value: number);
12135
+ /**
12136
+ * The maType period.
12137
+ */
12138
+ get maType(): number;
12139
+ set maType(value: number);
11923
12140
  protected onInitializeIndicator(): void;
11924
12141
  protected onResetDefaults(): void;
11925
12142
  protected onInputTick(): void;
@@ -13497,6 +13714,19 @@ declare module FintaChart {
13497
13714
  containsShape(shape: Shape): boolean;
13498
13715
  dispose(): void;
13499
13716
  paint(): void;
13717
+ /**
13718
+ * Returns true when a shape is fully outside the visible frame and
13719
+ * safe to skip. Extrapolated shapes (lines/rays) and selected shapes
13720
+ * are never culled since they can extend across the viewport.
13721
+ */
13722
+ private isShapeOffscreen;
13723
+ /** Shape types that extend beyond their points and must not be culled. */
13724
+ private static NON_CULLABLE_SHAPES;
13725
+ static pGrid: number;
13726
+ static pObjects: number;
13727
+ static pIndicators: number;
13728
+ static pHover: number;
13729
+ static pWatermark: number;
13500
13730
  /**
13501
13731
  * Executes shapes
13502
13732
  *
@@ -13515,6 +13745,12 @@ declare module FintaChart {
13515
13745
  * @param value
13516
13746
  */
13517
13747
  formatValue(value: number): string;
13748
+ /**
13749
+ * Formats a volume value in a compact form (e.g. 1.03M, 12.4K).
13750
+ *
13751
+ * @param value
13752
+ */
13753
+ formatVolume(value: number): string;
13518
13754
  /**
13519
13755
  * Returns index
13520
13756
  *
@@ -13649,7 +13885,30 @@ declare module FintaChart {
13649
13885
  * @param record
13650
13886
  * @return
13651
13887
  */
13888
+ private _lastHoverKey;
13652
13889
  updateHoverRecord(record?: number): void;
13890
+ /**
13891
+ * Fills the OHLC card indicator rows for the hovered record.
13892
+ *
13893
+ * @param control The card's bar-info control.
13894
+ * @param record The hovered record index.
13895
+ */
13896
+ private renderOhlcCardIndicators;
13897
+ /**
13898
+ * Renders the live graphics of an OHLC info card: the volume bar (as a
13899
+ * fraction of the max visible volume) and the price sparkline (the last
13900
+ * N closes up to the hovered record).
13901
+ *
13902
+ * @param control The card's bar-info control.
13903
+ * @param record The hovered record index.
13904
+ * @param color The up/down colour for the current bar.
13905
+ */
13906
+ private renderOhlcCardGraphics;
13907
+ /**
13908
+ * Draws a price sparkline onto a canvas, scaling to its CSS size and
13909
+ * device pixel ratio for a crisp line.
13910
+ */
13911
+ private drawSparkline;
13653
13912
  preserveAutoScaling(): void;
13654
13913
  cancelAutoScaling(): void;
13655
13914
  verticalAxisLabelMaxWidth(verticalAxis: VerticalAxis): number;
@@ -13692,6 +13951,7 @@ declare module FintaChart {
13692
13951
  private initInstrumentPaneTitle;
13693
13952
  private initPaneTitle;
13694
13953
  private initDraggablePaneTitle;
13954
+ private initOHLCCard;
13695
13955
  private layoutHtmlElements;
13696
13956
  private motionHitTest;
13697
13957
  private updateInstrument;
@@ -14923,9 +15183,6 @@ declare module FintaChart {
14923
15183
  }
14924
15184
  }
14925
15185
  declare module FintaChart {
14926
- enum MimeType {
14927
- PNG = "image/png"
14928
- }
14929
15186
  interface IChartSnapshotHandler extends IChartComponent {
14930
15187
  /**
14931
15188
  * Returns snapshot file name.
@@ -14949,11 +15206,22 @@ declare module FintaChart {
14949
15206
  name(): string;
14950
15207
  save(): void;
14951
15208
  saveToClipboard(): void;
15209
+ private writeBlobToClipboard;
15210
+ private fallbackDownload;
15211
+ private showChartMessage;
15212
+ /**
15213
+ * Composites the chart's own canvas layers into one bitmap.
15214
+ * Far cheaper than serializing the whole DOM. Returns null when
15215
+ * no canvases are found so the caller can fall back.
15216
+ */
15217
+ private compositeCanvasLayers;
14952
15218
  private createSnapshot;
14953
15219
  private saveImage;
14954
- private writeToClipboard;
14955
- private canWriteToClipboard;
14956
- private canvasToBlob;
15220
+ /**
15221
+ * Returns a human-readable reason why the clipboard cannot be used,
15222
+ * or `null` when a clipboard write may be attempted.
15223
+ */
15224
+ private clipboardUnavailableReason;
14957
15225
  private addBorders;
14958
15226
  private trimTransparentMargins;
14959
15227
  private loadImage;
@@ -17332,7 +17600,6 @@ declare module FintaChart {
17332
17600
  private updateCoordinateMapper;
17333
17601
  private autoScroll;
17334
17602
  private refresh;
17335
- private animateZoom;
17336
17603
  }
17337
17604
  }
17338
17605
  declare module FintaChart {
@@ -20587,7 +20854,7 @@ declare module FintaChart {
20587
20854
  */
20588
20855
  class TextShape extends Shape {
20589
20856
  static get type(): string;
20590
- private _lines;
20857
+ private _parsed;
20591
20858
  /**
20592
20859
  * Creates an instance of TextShape.
20593
20860
  *
@@ -20606,7 +20873,10 @@ declare module FintaChart {
20606
20873
  restoreState(state: IShapeState): void;
20607
20874
  pointsLocalizationKeys(): string[];
20608
20875
  protected paintHovered(oldTheme: any): any;
20876
+ private get baseTextTheme();
20609
20877
  private updateLines;
20878
+ private deriveRunTheme;
20879
+ private measureLineWidth;
20610
20880
  }
20611
20881
  }
20612
20882
  declare module FintaChart {
@@ -21296,6 +21566,7 @@ declare module FintaChart {
21296
21566
  private _accountSize;
21297
21567
  private _lotSize;
21298
21568
  private _riskPercentage;
21569
+ private _leverage;
21299
21570
  private _profitTicks;
21300
21571
  private _profitPrice;
21301
21572
  private _stopTicks;
@@ -21303,6 +21574,7 @@ declare module FintaChart {
21303
21574
  private _entryPrice;
21304
21575
  private _input_accountSizeHTMLObj;
21305
21576
  private _input_lotSizeHTMLObj;
21577
+ private _input_leverageHTMLObj;
21306
21578
  private _input_riskPercentageHTMLObj;
21307
21579
  private _input_profitTicksHTMLObj;
21308
21580
  private _input_profitPriceHTMLObj;
@@ -21351,6 +21623,7 @@ declare module FintaChart {
21351
21623
  private handleLevelPriceChange;
21352
21624
  private getRelatedInputField;
21353
21625
  private updateLevel;
21626
+ private applyEntryChange;
21354
21627
  private calculateTicksFromPrice;
21355
21628
  private calculatePriceFromTicks;
21356
21629
  private validatePrice;
@@ -21390,6 +21663,8 @@ declare module FintaChart {
21390
21663
  rewardPips: number;
21391
21664
  calculatedStop: number;
21392
21665
  calculatedTarget: number;
21666
+ accountTooSmall: boolean;
21667
+ minLotSize: number;
21393
21668
  }
21394
21669
  interface IPositionDrawingShapeState extends IShapeState {
21395
21670
  entry: number;
@@ -21442,9 +21717,13 @@ declare module FintaChart {
21442
21717
  */
21443
21718
  lotSize?: number;
21444
21719
  /**
21445
- * Shape risk percentage
21720
+ * Shape risk percentage (display-only — no longer drives Qty)
21446
21721
  */
21447
21722
  riskPercentage?: number;
21723
+ /**
21724
+ * Account leverage used to size the position: Qty = (accountSize * leverage) / entryPrice
21725
+ */
21726
+ leverage?: number;
21448
21727
  }
21449
21728
  interface IPositionShapeDefaults extends IShapeDefaults {
21450
21729
  /**
@@ -21471,6 +21750,10 @@ declare module FintaChart {
21471
21750
  * Shape risk percentage
21472
21751
  */
21473
21752
  riskPercentage: number;
21753
+ /**
21754
+ * Account leverage used to size the position: Qty = (accountSize * leverage) / entryPrice
21755
+ */
21756
+ leverage: number;
21474
21757
  /**
21475
21758
  * Shape visibility config
21476
21759
  */
@@ -21494,6 +21777,7 @@ declare module FintaChart {
21494
21777
  const COMPACT_MODE_CHANGED = "compactModeChanged";
21495
21778
  const ALWAYS_SHOW_STATS_CHANGED = "alwaysShowStatsChanged";
21496
21779
  const VISIBILITY_CONFIG_CHANGED = "visibilityConfigChanged";
21780
+ const ACCOUNT_TOO_SMALL_CHANGED = "accountTooSmallChanged";
21497
21781
  }
21498
21782
  abstract class PositionDrawingShape extends Shape {
21499
21783
  private _entry;
@@ -21511,6 +21795,7 @@ declare module FintaChart {
21511
21795
  private _dragStartPoints?;
21512
21796
  private _initialTimeframe?;
21513
21797
  private _initialWidthInBars?;
21798
+ private _accountTooSmall;
21514
21799
  static defaults: IPositionShapeDefaults;
21515
21800
  protected get defaults(): IPositionShapeDefaults;
21516
21801
  static get type(): string;
@@ -21531,6 +21816,8 @@ declare module FintaChart {
21531
21816
  set riskPercentage(value: number);
21532
21817
  get lotSize(): number;
21533
21818
  set lotSize(value: number);
21819
+ get leverage(): number;
21820
+ set leverage(value: number);
21534
21821
  get visibilityConfig(): ITimeFrameVisibilityConfig;
21535
21822
  set visibilityConfig(value: ITimeFrameVisibilityConfig);
21536
21823
  setCustomPoints(points: IPositionPoint[]): void;
@@ -21588,6 +21875,7 @@ declare module FintaChart {
21588
21875
  private paintExecutionPoint;
21589
21876
  private addOpacity;
21590
21877
  private getShapeWidth;
21878
+ private decimalPlaces;
21591
21879
  private findClosestBarIndex;
21592
21880
  /**
21593
21881
  * Check if the current timeframe matches the initial timeframe
@@ -21994,6 +22282,11 @@ declare module FintaChart {
21994
22282
  private generateList;
21995
22283
  deleteTemplate(key: string): void;
21996
22284
  selectTemplate(key: string): void;
22285
+ /** Fixed-positions the dropdown so the pane cell does not clip it. */
22286
+ private positionDropList;
22287
+ /** Clears inline fixed-positioning so the closed dropdown returns to flow. */
22288
+ private resetDropListPosition;
22289
+ private resetFibonacciLevels;
21997
22290
  }
21998
22291
  }
21999
22292
  declare module FintaChart {
@@ -22402,8 +22695,23 @@ declare module FintaChart {
22402
22695
  private _motions;
22403
22696
  protected state: TradingToolState;
22404
22697
  locked: boolean;
22698
+ protected _dim: number | null;
22405
22699
  protected get canHandleEvents(): boolean;
22406
22700
  get canMove(): boolean;
22701
+ get dim(): number | null;
22702
+ /**
22703
+ * Visually dims the trading tool by multiplying its theme colors by `value`.
22704
+ * Pass `null` (or omit) to undim and restore the original theme.
22705
+ * @param value Number in (0, 1] or null to clear.
22706
+ */
22707
+ setDimmed(value?: number | null): void;
22708
+ /**
22709
+ * Returns a deep clone of `src` with every `strokeColor` and `fillColor`
22710
+ * leaf multiplied by `value`. Used by subclasses inside `actualTheme` when
22711
+ * `_dim` is set.
22712
+ */
22713
+ protected _dimThemeColors<T extends object>(src: T, value: number): T;
22714
+ private _dimWalk;
22407
22715
  protected constructor();
22408
22716
  dispose(): void;
22409
22717
  protected onPaneChanged(oldValue: Pane): void;
@@ -22426,6 +22734,10 @@ declare module FintaChart {
22426
22734
  private formatProfitDescription;
22427
22735
  modifyThemeColor(color: string, opacity?: number): string;
22428
22736
  formatValue(value: number): number;
22737
+ protected getDisplayedBidAsk(fallbackPrice?: number): {
22738
+ bid: number;
22739
+ ask: number;
22740
+ };
22429
22741
  private _initButtons;
22430
22742
  private initMotionEvents;
22431
22743
  protected _handleHoverGesture(gesture?: MouseHoverMotionEvent): boolean;
@@ -22541,6 +22853,10 @@ declare module FintaChart {
22541
22853
  const defaultLabelZIndex = 500;
22542
22854
  const selectedLabelZIndex = 501;
22543
22855
  const blur = 10;
22856
+ const priceTypeBadgeWidth = 22;
22857
+ const priceTypeBadgeGap = 5;
22858
+ const STOP_LIMIT_LIMIT_SUFFIX = "limit";
22859
+ const STOP_LIMIT_STOP_SUFFIX = "stop";
22544
22860
  class OrderBar extends TradingTool {
22545
22861
  private _config;
22546
22862
  get localizedKind(): string;
@@ -22553,6 +22869,7 @@ declare module FintaChart {
22553
22869
  get theme(): IOrderBarTheme;
22554
22870
  set theme(value: IOrderBarTheme);
22555
22871
  get actualTheme(): IOrderBarTheme;
22872
+ setDimmed(value?: number | null): void;
22556
22873
  get defaultTheme(): IOrderBarTheme;
22557
22874
  _cancelButtonOptions: IButtonOptions;
22558
22875
  private _acceptedButtonOptions;
@@ -22629,6 +22946,8 @@ declare module FintaChart {
22629
22946
  private _forceExpanded;
22630
22947
  private _parentOrder?;
22631
22948
  get showlabel(): boolean;
22949
+ get priceType(): 'LP' | 'SP' | null;
22950
+ get priceTypeBadgeReservedWidth(): number;
22632
22951
  get isSelected(): boolean;
22633
22952
  private get _isExitChildOrder();
22634
22953
  private _ensureParentLink;
@@ -22664,6 +22983,7 @@ declare module FintaChart {
22664
22983
  * @inheritdoc
22665
22984
  */
22666
22985
  paint(): void;
22986
+ private _paintPriceTypeBadge;
22667
22987
  finishModifyMode(): void;
22668
22988
  paintVerticalAxisLabels(): void;
22669
22989
  orderModifyStarted(): boolean;
@@ -22767,6 +23087,14 @@ declare module FintaChart {
22767
23087
  private _takeProfitLine;
22768
23088
  private _stTpLine;
22769
23089
  private _selected;
23090
+ /**
23091
+ * Instance text width for kind.
23092
+ */
23093
+ private _kindTextWidth;
23094
+ /**
23095
+ * Instance text width for quantity.
23096
+ */
23097
+ private _quantityTextWidth;
22770
23098
  /**
22771
23099
  * Gets/Set position.
22772
23100
  */
@@ -22808,6 +23136,7 @@ declare module FintaChart {
22808
23136
  * Gets current theme of position tool.
22809
23137
  */
22810
23138
  get actualTheme(): IPositionBarTheme;
23139
+ setDimmed(value?: number | null): void;
22811
23140
  /**
22812
23141
  * Gets default theme of position tool.
22813
23142
  */
@@ -23056,12 +23385,17 @@ declare module FintaChart {
23056
23385
  private DRAG_THRESHOLD;
23057
23386
  _isTP: boolean;
23058
23387
  _isSL: boolean;
23059
- _isTpDrag: boolean;
23388
+ _isTpDrag: boolean | null;
23060
23389
  sizeOptions: any;
23061
23390
  constructor(parent: OrderBar, isTP: boolean, isSL: boolean);
23062
23391
  paintVerticalAxisLabels(): void;
23063
23392
  protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean;
23064
23393
  protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean;
23394
+ private _isTakeProfitCreated;
23395
+ private _isStopLossCreated;
23396
+ private _getButtonAreas;
23397
+ private _isOnTakeProfitButton;
23398
+ private _isOnStopLossButton;
23065
23399
  private _detectTP;
23066
23400
  private _updateStopLossTakeProfit;
23067
23401
  /**
@@ -23498,6 +23832,10 @@ declare module FintaChart {
23498
23832
  * Is chart OHLC panel showed
23499
23833
  */
23500
23834
  ohlcShowed?: boolean;
23835
+ /**
23836
+ * Is chart OHLC info card showed
23837
+ */
23838
+ ohlcCardShowed?: boolean;
23501
23839
  /**
23502
23840
  * Scrollbar loaded event emitter
23503
23841
  */
@@ -23578,6 +23916,7 @@ declare module FintaChart {
23578
23916
  orderSettings?: GetOrderSettingsType;
23579
23917
  useExternalSearchInput?: boolean;
23580
23918
  showLogoWatermark?: boolean;
23919
+ useNewBrandedWatermark?: boolean;
23581
23920
  isChartWidget?: boolean;
23582
23921
  }
23583
23922
  /**
@@ -23608,6 +23947,10 @@ declare module FintaChart {
23608
23947
  * Is OHLC panel showed
23609
23948
  */
23610
23949
  ohlcShowed?: boolean;
23950
+ /**
23951
+ * Is OHLC info card showed
23952
+ */
23953
+ ohlcCardShowed?: boolean;
23611
23954
  /**
23612
23955
  * Is chart scroll enabled
23613
23956
  */
@@ -23621,6 +23964,7 @@ declare module FintaChart {
23621
23964
  */
23622
23965
  showInstrumentWatermark: boolean;
23623
23966
  showLogoWatermark: boolean;
23967
+ useNewBrandedWatermark: boolean;
23624
23968
  /**
23625
23969
  * Is hide chart scroll to last bar
23626
23970
  */
@@ -23735,6 +24079,14 @@ declare module FintaChart {
23735
24079
  Fok = "fok",
23736
24080
  Ioc = "ioc"
23737
24081
  }
24082
+ /**
24083
+ * Rendering quality: trades sharpness for paint speed on weak devices.
24084
+ */
24085
+ enum RenderQuality {
24086
+ LOW = "low",
24087
+ MEDIUM = "medium",
24088
+ HIGH = "high"
24089
+ }
23738
24090
  /**
23739
24091
  * Provides model of min and max
23740
24092
  */
@@ -23835,6 +24187,10 @@ declare module FintaChart {
23835
24187
  const DEFAULT_BARS_COUNT = 500;
23836
24188
  const DEFAULT_MORE_BARS_COUNT = 1000;
23837
24189
  const DEFAULT_QUANTITY = 1;
24190
+ interface IDateRangeSelection {
24191
+ startDate: Date | null;
24192
+ endDate: Date | null;
24193
+ }
23838
24194
  const version = "2.0.0";
23839
24195
  enum AutoScalePanesKind {
23840
24196
  AllPanes = 0,
@@ -23868,6 +24224,12 @@ declare module FintaChart {
23868
24224
  private readonly _sessionBreakLines;
23869
24225
  private _supportedTimeFrames;
23870
24226
  private readonly _handleWindowResizeEvent;
24227
+ private _rootResizeObserver;
24228
+ private _lastObservedWidth;
24229
+ private _lastObservedHeight;
24230
+ private _resizeRafPending;
24231
+ private _windowResizeRafPending;
24232
+ private _renderQuality;
23871
24233
  private readonly _indicatorAlertsHandler;
23872
24234
  private readonly _addThemeCssClass;
23873
24235
  private readonly _barCountdown;
@@ -23943,15 +24305,21 @@ declare module FintaChart {
23943
24305
  private _showAlertId;
23944
24306
  private _favoriteIndicators;
23945
24307
  private _shapeTemplates;
24308
+ private static readonly _shapeTemplatesStorageKey;
24309
+ private static loadShapeTemplatesFromStorage;
24310
+ private static saveShapeTemplatesToStorage;
23946
24311
  private _magnetMode;
23947
24312
  private _lockShapes;
23948
24313
  private _pendingTimeFrameRangeClamp;
23949
24314
  private _pendingInstrumentChangeDateRange;
24315
+ private _pendingDateRangeSelection;
24316
+ private _dateRangeSelectionToken;
23950
24317
  private _lastBid;
23951
24318
  private _lastAsk;
23952
24319
  private _conversionRate;
23953
24320
  private _touchPanActive;
23954
24321
  private _touchPanLastX;
24322
+ get isTouchPanActive(): boolean;
23955
24323
  get conversionRate(): {
23956
24324
  ask: number;
23957
24325
  bid: number;
@@ -23996,6 +24364,13 @@ declare module FintaChart {
23996
24364
  get timezone(): ITimezone | null;
23997
24365
  set timezone(data: ITimezone | null);
23998
24366
  constructor(config: IChartConfig);
24367
+ /**
24368
+ * Dev-only on-screen FPS / frame-time meter, shown only on localhost.
24369
+ * A small toggle button is placed at the right edge; clicking it starts
24370
+ * an independent rAF loop that measures the real display frame rate
24371
+ * (independent of the RefreshOptimizer throttle) during pan/zoom/hover.
24372
+ */
24373
+ private setupFpsMeter;
23999
24374
  get isInReplayMode(): boolean;
24000
24375
  get dateTimezoneConverter(): DateTimezoneConverter;
24001
24376
  get smoothLines(): boolean;
@@ -24167,6 +24542,11 @@ declare module FintaChart {
24167
24542
  */
24168
24543
  get ohlcShowed(): boolean;
24169
24544
  set ohlcShowed(value: boolean);
24545
+ /**
24546
+ * Get is OHLC info card showed
24547
+ */
24548
+ get ohlcCardShowed(): boolean;
24549
+ set ohlcCardShowed(value: boolean);
24170
24550
  /**
24171
24551
  * Get chart panes
24172
24552
  */
@@ -24243,6 +24623,7 @@ declare module FintaChart {
24243
24623
  get showInstrumentWatermark(): boolean;
24244
24624
  set showInstrumentWatermark(value: boolean);
24245
24625
  get showLogoWatermark(): boolean;
24626
+ get useNewBrandedWatermark(): boolean;
24246
24627
  /**
24247
24628
  * Get chart size
24248
24629
  */
@@ -24294,6 +24675,15 @@ declare module FintaChart {
24294
24675
  */
24295
24676
  get zoomEnabled(): boolean;
24296
24677
  set zoomEnabled(value: boolean);
24678
+ /**
24679
+ * Rendering quality (sharpness vs paint speed).
24680
+ */
24681
+ get renderQuality(): RenderQuality;
24682
+ set renderQuality(value: RenderQuality);
24683
+ /**
24684
+ * Maps render quality to the DPR cap and max visible bars.
24685
+ */
24686
+ private applyRenderQualityCap;
24297
24687
  /**
24298
24688
  * Get trading session hours type
24299
24689
  */
@@ -24330,7 +24720,10 @@ declare module FintaChart {
24330
24720
  * @param event
24331
24721
  * @return Is event handled
24332
24722
  */
24723
+ static evtCount: number;
24724
+ static evtMs: number;
24333
24725
  onMouseEvents(event: Event): boolean;
24726
+ private onMouseEventsImpl;
24334
24727
  /**
24335
24728
  * Scrolling chart to real time arrow
24336
24729
  */
@@ -24450,6 +24843,19 @@ declare module FintaChart {
24450
24843
  * @return Data range
24451
24844
  */
24452
24845
  dateRange(startDate?: Date, endDate?: Date): any;
24846
+ /**
24847
+ * Shows the specified date range, loading missing history first and
24848
+ * optionally switching the time frame (used by the bottom-toolbar
24849
+ * date-range presets: 1D, 5D, ..., All).
24850
+ *
24851
+ * @param startDate Range start; `null` shows all available history.
24852
+ * @param endDate Range end; defaults to the last loaded bar.
24853
+ * @param timeFrame Optional time frame to switch to before applying the range.
24854
+ */
24855
+ setVisibleDateRange(startDate: Date | null, endDate?: Date | null, timeFrame?: ITimeFrame): void;
24856
+ private estimateDateRangeBarsCount;
24857
+ private applyDateRangeSelection;
24858
+ private waitForBarsRequestComplete;
24453
24859
  /**
24454
24860
  * Alias for `dispose()`. Both names are documented across the
24455
24861
  * public guides; both are supported on the runtime.
@@ -24464,6 +24870,7 @@ declare module FintaChart {
24464
24870
  /**
24465
24871
  * Paints horizontal scale and panes container
24466
24872
  */
24873
+ static lastPaintMs: number;
24467
24874
  paint(): void;
24468
24875
  /**
24469
24876
  * Executes indicator or indicators
@@ -24549,6 +24956,14 @@ declare module FintaChart {
24549
24956
  * @param state
24550
24957
  */
24551
24958
  restoreIndicatorsState(state: string | IIndicatorState[]): void;
24959
+ /**
24960
+ * Removes orphaned panes (non-primary, no indicators, no savable
24961
+ * shapes). Panes claimed by `indicatorStates` via `paneIndex` are kept.
24962
+ *
24963
+ * @param indicatorStates States whose `paneIndex` marks panes to keep.
24964
+ * @return The number of panes removed.
24965
+ */
24966
+ pruneEmptyPanes(indicatorStates?: IIndicatorState[]): number;
24552
24967
  /**
24553
24968
  * Loads shapes state
24554
24969
  *
@@ -24717,6 +25132,15 @@ declare module FintaChart {
24717
25132
  * @param makeAutoScale
24718
25133
  */
24719
25134
  refreshAsync(makeAutoScale?: boolean): void;
25135
+ private _tickRefreshInterval;
25136
+ private _lastTickRefresh;
25137
+ private _tickRefreshTimer;
25138
+ private _restoreIndicatorsTimer;
25139
+ /**
25140
+ * Throttled refresh for the live-tick path so a busy feed cannot force
25141
+ * a full repaint every frame. User gestures still use refreshAsync.
25142
+ */
25143
+ refreshOnTickAsync(): void;
24720
25144
  autoScalePanes(kind?: AutoScalePanesKind): void;
24721
25145
  /**
24722
25146
  * Sets chart window mode
@@ -24763,6 +25187,11 @@ declare module FintaChart {
24763
25187
  *
24764
25188
  * @param updateInstruments
24765
25189
  */
25190
+ static lastRefreshMs: number;
25191
+ static lastLayoutMs: number;
25192
+ static lastChartTypeMs: number;
25193
+ static lastHScaleMs: number;
25194
+ static lastPanesMs: number;
24766
25195
  refresh(updateInstruments?: boolean): void;
24767
25196
  /**
24768
25197
  * Triggers a repaint after direct property mutations (theme,
@@ -24836,6 +25265,20 @@ declare module FintaChart {
24836
25265
  private showDataInfo;
24837
25266
  private hideDataInfo;
24838
25267
  toggleDataInfo(show: boolean): void;
25268
+ /**
25269
+ * Resolves the root container that holds this chart's OHLC card,
25270
+ * accounting for the multi-chart / mobile layouts where `_rootDiv`
25271
+ * may not be an ancestor of the card element.
25272
+ */
25273
+ private ohlcCardRootContainer;
25274
+ private showOhlcCard;
25275
+ /**
25276
+ * Places the OHLC card at (left, top) but clamps it so the whole card
25277
+ */
25278
+ private clampOhlcCardPosition;
25279
+ private hideOhlcCard;
25280
+ toggleOhlcCardButton(show: boolean): void;
25281
+ setOhlcCardVariant(variant: string): void;
24839
25282
  private translateClonedShape;
24840
25283
  private subscribe;
24841
25284
  private unsubscribe;