@pipsend/charts 2.3.2 → 2.3.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/dist/pipsend-charts.development.mjs +45 -123
- package/dist/pipsend-charts.production.mjs +2 -2
- package/dist/pipsend-charts.standalone.development.js +45 -123
- package/dist/pipsend-charts.standalone.development.mjs +45 -123
- package/dist/pipsend-charts.standalone.production.js +2 -2
- package/dist/pipsend-charts.standalone.production.mjs +2 -2
- package/dist/typings.d.ts +24 -155
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license
|
|
3
|
-
* Pipsend Charts v2.3.
|
|
3
|
+
* Pipsend Charts v2.3.3
|
|
4
4
|
* Copyright (c) 2026 Pipsend
|
|
5
5
|
* Licensed under MIT License
|
|
6
6
|
* Built on TradingView Lightweight Charts™ (Apache 2.0)
|
|
@@ -2482,6 +2482,22 @@ class SeriesBarColorer {
|
|
|
2482
2482
|
// Used to avoid binary search if bars are already known
|
|
2483
2483
|
return this._private__styleGetter(this._private__findBar, this._private__series._internal_options(), barIndex, precomputedBars);
|
|
2484
2484
|
}
|
|
2485
|
+
/**
|
|
2486
|
+
* Like `barStyle`, but returns null instead of throwing when the bar is
|
|
2487
|
+
* gone.
|
|
2488
|
+
*
|
|
2489
|
+
* Recolouring walks items that were laid out against the data as it was. A
|
|
2490
|
+
* bar that has since disappeared is not an error there: the view is about
|
|
2491
|
+
* to be rebuilt from the new data anyway. Letting it throw took down
|
|
2492
|
+
* whatever asked for the repaint — including `setData`, which left the
|
|
2493
|
+
* series without its data and the pane empty until the page was reloaded.
|
|
2494
|
+
*/
|
|
2495
|
+
_internal_barStyleOrNull(barIndex, precomputedBars) {
|
|
2496
|
+
if (precomputedBars === undefined && this._private__series._internal_bars()._internal_valueAt(barIndex) === null) {
|
|
2497
|
+
return null;
|
|
2498
|
+
}
|
|
2499
|
+
return this._internal_barStyle(barIndex, precomputedBars);
|
|
2500
|
+
}
|
|
2485
2501
|
}
|
|
2486
2502
|
|
|
2487
2503
|
/**
|
|
@@ -11425,10 +11441,14 @@ class SeriesPaneViewBase {
|
|
|
11425
11441
|
return this._internal__itemsVisibleRange === null ? null : this._internal__renderer;
|
|
11426
11442
|
}
|
|
11427
11443
|
_internal__updateOptions() {
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11444
|
+
const colorer = this._internal__series._internal_barColorer();
|
|
11445
|
+
this._internal__items = this._internal__items.map((item) => {
|
|
11446
|
+
// An item whose bar is gone keeps the colour it had. Throwing here
|
|
11447
|
+
// took down whatever asked for the repaint — `setData` among them,
|
|
11448
|
+
// which left the series without its data and the pane empty.
|
|
11449
|
+
const style = colorer._internal_barStyleOrNull(item._internal_time);
|
|
11450
|
+
return style === null ? item : { ...item, ...style };
|
|
11451
|
+
});
|
|
11432
11452
|
}
|
|
11433
11453
|
_internal__clearVisibleRange() {
|
|
11434
11454
|
this._internal__itemsVisibleRange = null;
|
|
@@ -15857,9 +15877,6 @@ function createUpDownMarkers(series, options = {}) {
|
|
|
15857
15877
|
return wrapper;
|
|
15858
15878
|
}
|
|
15859
15879
|
|
|
15860
|
-
/**
|
|
15861
|
-
* Gestor de marcadores de posiciones de trading
|
|
15862
|
-
*/
|
|
15863
15880
|
class PositionMarkersManager {
|
|
15864
15881
|
constructor(series, options) {
|
|
15865
15882
|
this._private__markersPlugin = null;
|
|
@@ -15879,30 +15896,20 @@ class PositionMarkersManager {
|
|
|
15879
15896
|
};
|
|
15880
15897
|
this._private__markersPlugin = createSeriesMarkers(series);
|
|
15881
15898
|
}
|
|
15882
|
-
/**
|
|
15883
|
-
* Agrega una posición al gráfico
|
|
15884
|
-
*/
|
|
15885
15899
|
addPosition(position) {
|
|
15886
15900
|
this._private__positions.push(position);
|
|
15887
15901
|
this._private__updateMarkers();
|
|
15888
15902
|
}
|
|
15889
|
-
/**
|
|
15890
|
-
* Agrega múltiples posiciones al gráfico
|
|
15891
|
-
*/
|
|
15892
15903
|
addPositions(positions) {
|
|
15893
15904
|
this._private__positions.push(...positions);
|
|
15894
15905
|
this._private__updateMarkers();
|
|
15895
15906
|
}
|
|
15896
|
-
/**
|
|
15897
|
-
* Establece las posiciones (reemplaza las existentes)
|
|
15898
|
-
*/
|
|
15907
|
+
/** Replaces every position currently on the chart. */
|
|
15899
15908
|
setPositions(positions) {
|
|
15900
15909
|
this._private__positions = [...positions];
|
|
15901
15910
|
this._private__updateMarkers();
|
|
15902
15911
|
}
|
|
15903
|
-
/**
|
|
15904
|
-
* Cierra una posición abierta agregando el punto de salida
|
|
15905
|
-
*/
|
|
15912
|
+
/** Closes an open position by giving it an exit point. */
|
|
15906
15913
|
closePosition(id, exit, exitText) {
|
|
15907
15914
|
const position = this._private__positions.find(p => p.id === id);
|
|
15908
15915
|
if (position) {
|
|
@@ -15916,29 +15923,17 @@ class PositionMarkersManager {
|
|
|
15916
15923
|
this._private__updateMarkers();
|
|
15917
15924
|
}
|
|
15918
15925
|
}
|
|
15919
|
-
/**
|
|
15920
|
-
* Elimina una posición por ID
|
|
15921
|
-
*/
|
|
15922
15926
|
removePosition(id) {
|
|
15923
15927
|
this._private__positions = this._private__positions.filter(p => p.id !== id);
|
|
15924
15928
|
this._private__updateMarkers();
|
|
15925
15929
|
}
|
|
15926
|
-
/**
|
|
15927
|
-
* Limpia todas las posiciones
|
|
15928
|
-
*/
|
|
15929
15930
|
clearPositions() {
|
|
15930
15931
|
this._private__positions = [];
|
|
15931
15932
|
this._private__updateMarkers();
|
|
15932
15933
|
}
|
|
15933
|
-
/**
|
|
15934
|
-
* Obtiene todas las posiciones actuales
|
|
15935
|
-
*/
|
|
15936
15934
|
getPositions() {
|
|
15937
15935
|
return this._private__positions;
|
|
15938
15936
|
}
|
|
15939
|
-
/**
|
|
15940
|
-
* Actualiza las opciones del gestor
|
|
15941
|
-
*/
|
|
15942
15937
|
applyOptions(options) {
|
|
15943
15938
|
if (options.longColors) {
|
|
15944
15939
|
this._private__options.longColors = {
|
|
@@ -15963,9 +15958,6 @@ class PositionMarkersManager {
|
|
|
15963
15958
|
}
|
|
15964
15959
|
this._private__updateMarkers();
|
|
15965
15960
|
}
|
|
15966
|
-
/**
|
|
15967
|
-
* Convierte las posiciones a marcadores de serie
|
|
15968
|
-
*/
|
|
15969
15961
|
_private__positionsToMarkers() {
|
|
15970
15962
|
const markers = [];
|
|
15971
15963
|
for (const position of this._private__positions) {
|
|
@@ -16012,18 +16004,12 @@ class PositionMarkersManager {
|
|
|
16012
16004
|
}
|
|
16013
16005
|
return markers;
|
|
16014
16006
|
}
|
|
16015
|
-
/**
|
|
16016
|
-
* Actualiza los marcadores en el gráfico
|
|
16017
|
-
*/
|
|
16018
16007
|
_private__updateMarkers() {
|
|
16019
16008
|
if (this._private__markersPlugin) {
|
|
16020
16009
|
const markers = this._private__positionsToMarkers();
|
|
16021
16010
|
this._private__markersPlugin.setMarkers(markers);
|
|
16022
16011
|
}
|
|
16023
16012
|
}
|
|
16024
|
-
/**
|
|
16025
|
-
* Desconecta el plugin y limpia recursos
|
|
16026
|
-
*/
|
|
16027
16013
|
detach() {
|
|
16028
16014
|
if (this._private__markersPlugin) {
|
|
16029
16015
|
this._private__markersPlugin.detach();
|
|
@@ -16033,47 +16019,18 @@ class PositionMarkersManager {
|
|
|
16033
16019
|
}
|
|
16034
16020
|
}
|
|
16035
16021
|
/**
|
|
16036
|
-
*
|
|
16037
|
-
*
|
|
16038
|
-
* @param series - Serie a la que se adjuntarán los marcadores
|
|
16039
|
-
* @param positions - Posiciones iniciales (opcional)
|
|
16040
|
-
* @param options - Opciones de configuración (opcional)
|
|
16041
|
-
* @returns Instancia del gestor de posiciones
|
|
16022
|
+
* Marks trades on a series with an arrow at the entry and, once closed, at the
|
|
16023
|
+
* exit.
|
|
16042
16024
|
*
|
|
16043
16025
|
* @example
|
|
16044
16026
|
* ```typescript
|
|
16045
|
-
*
|
|
16046
|
-
*
|
|
16047
|
-
*
|
|
16048
|
-
* // Agregar una posición long
|
|
16049
|
-
* positionMarkers.addPosition({
|
|
16050
|
-
* type: 'long',
|
|
16051
|
-
* entry: { time: '2023-01-01', price: 100.50 },
|
|
16052
|
-
* exit: { time: '2023-01-05', price: 105.20 },
|
|
16053
|
-
* id: 'pos-1'
|
|
16054
|
-
* });
|
|
16055
|
-
*
|
|
16056
|
-
* // Agregar una posición short
|
|
16057
|
-
* positionMarkers.addPosition({
|
|
16058
|
-
* type: 'short',
|
|
16059
|
-
* entry: { time: '2023-01-10', price: 110.00 },
|
|
16060
|
-
* exit: { time: '2023-01-15', price: 107.50 },
|
|
16061
|
-
* id: 'pos-2'
|
|
16062
|
-
* });
|
|
16063
|
-
*
|
|
16064
|
-
* // Agregar múltiples posiciones
|
|
16065
|
-
* positionMarkers.setPositions([
|
|
16066
|
-
* {
|
|
16027
|
+
* const markers = createPositionMarkers(candleSeries);
|
|
16028
|
+
* markers.addPosition({
|
|
16067
16029
|
* type: 'long',
|
|
16068
|
-
* entry: { time: '2023-
|
|
16069
|
-
* exit: { time: '2023-
|
|
16070
|
-
*
|
|
16071
|
-
*
|
|
16072
|
-
* type: 'short',
|
|
16073
|
-
* entry: { time: '2023-02-15', price: 102.00 },
|
|
16074
|
-
* exit: { time: '2023-02-20', price: 99.00 }
|
|
16075
|
-
* }
|
|
16076
|
-
* ]);
|
|
16030
|
+
* entry: { time: '2023-01-01', price: 100.50 },
|
|
16031
|
+
* exit: { time: '2023-01-05', price: 105.20 },
|
|
16032
|
+
* id: 'pos-1',
|
|
16033
|
+
* });
|
|
16077
16034
|
* ```
|
|
16078
16035
|
*/
|
|
16079
16036
|
function createPositionMarkers(series, positions, options) {
|
|
@@ -20324,9 +20281,6 @@ function createTradingLine(series, chart, options) {
|
|
|
20324
20281
|
return new DraggablePriceLine(chart, series, lineOptions);
|
|
20325
20282
|
}
|
|
20326
20283
|
|
|
20327
|
-
/**
|
|
20328
|
-
* Interactive Line Manager - Permite crear líneas haciendo clic en el gráfico
|
|
20329
|
-
*/
|
|
20330
20284
|
class InteractiveLineManager {
|
|
20331
20285
|
constructor(chart, series) {
|
|
20332
20286
|
this._private__container = null;
|
|
@@ -20355,10 +20309,9 @@ class InteractiveLineManager {
|
|
|
20355
20309
|
return price === null ? 0 : price;
|
|
20356
20310
|
}
|
|
20357
20311
|
/**
|
|
20358
|
-
*
|
|
20359
|
-
*
|
|
20360
|
-
* @
|
|
20361
|
-
* @returns Promesa que se resuelve cuando el usuario hace clic
|
|
20312
|
+
* Arms the chart so the next click drops a line.
|
|
20313
|
+
*
|
|
20314
|
+
* @returns The line, once the user has clicked.
|
|
20362
20315
|
*/
|
|
20363
20316
|
enableClickToCreate(mode, customOptions) {
|
|
20364
20317
|
if (!this._private__container) {
|
|
@@ -20379,9 +20332,6 @@ class InteractiveLineManager {
|
|
|
20379
20332
|
this._private__container.addEventListener('click', this._private__clickHandler);
|
|
20380
20333
|
});
|
|
20381
20334
|
}
|
|
20382
|
-
/**
|
|
20383
|
-
* Desactiva el modo de creación por clic
|
|
20384
|
-
*/
|
|
20385
20335
|
disableClickToCreate() {
|
|
20386
20336
|
if (this._private__container && this._private__clickHandler) {
|
|
20387
20337
|
this._private__container.removeEventListener('click', this._private__clickHandler);
|
|
@@ -20471,31 +20421,21 @@ class InteractiveLineManager {
|
|
|
20471
20421
|
}
|
|
20472
20422
|
return new DraggablePriceLine(this._private__chart, this._private__series, options);
|
|
20473
20423
|
}
|
|
20474
|
-
/**
|
|
20475
|
-
* Obtiene el modo actual de creación
|
|
20476
|
-
*/
|
|
20477
20424
|
getCreationMode() {
|
|
20478
20425
|
return this._private__creationMode;
|
|
20479
20426
|
}
|
|
20480
|
-
/**
|
|
20481
|
-
* Verifica si está en modo de creación
|
|
20482
|
-
*/
|
|
20483
20427
|
isCreating() {
|
|
20484
20428
|
return this._private__creationMode !== null;
|
|
20485
20429
|
}
|
|
20486
20430
|
}
|
|
20487
20431
|
/**
|
|
20488
|
-
*
|
|
20489
|
-
*
|
|
20490
|
-
* @param series - Series instance
|
|
20491
|
-
* @returns InteractiveLineManager
|
|
20432
|
+
* Lets the user place draggable lines by clicking the chart.
|
|
20433
|
+
*
|
|
20492
20434
|
* @example
|
|
20493
20435
|
* ```typescript
|
|
20494
20436
|
* const manager = createInteractiveLineManager(chart, candleSeries);
|
|
20495
|
-
*
|
|
20496
|
-
* // Activar modo de creación
|
|
20497
20437
|
* const line = await manager.enableClickToCreate('stop-loss', {
|
|
20498
|
-
* onDragEnd: (price) => console.log('SL:', price)
|
|
20438
|
+
* onDragEnd: (price) => console.log('SL:', price),
|
|
20499
20439
|
* });
|
|
20500
20440
|
* ```
|
|
20501
20441
|
*/
|
|
@@ -24358,9 +24298,6 @@ function createVerticalLineTool(context, options) {
|
|
|
24358
24298
|
return new VerticalLineTool(context, options);
|
|
24359
24299
|
}
|
|
24360
24300
|
|
|
24361
|
-
/**
|
|
24362
|
-
* Fibonacci Calculator - Cálculos de niveles de retroceso de Fibonacci
|
|
24363
|
-
*/
|
|
24364
24301
|
/**
|
|
24365
24302
|
* Standard Fibonacci retracement ratios
|
|
24366
24303
|
*/
|
|
@@ -24506,10 +24443,7 @@ class FibonacciPaneView {
|
|
|
24506
24443
|
}
|
|
24507
24444
|
}
|
|
24508
24445
|
|
|
24509
|
-
/**
|
|
24510
|
-
* Fibonacci Retracement Tool - Herramienta para dibujar niveles de Fibonacci
|
|
24511
|
-
* Muestra niveles estándar: 0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%
|
|
24512
|
-
*/
|
|
24446
|
+
/** Draws 0, 23.6, 38.2, 50, 61.8, 78.6 and 100% unless `levels` says otherwise. */
|
|
24513
24447
|
/** A ratio and the label it is shown with, derived rather than stored. */
|
|
24514
24448
|
function toRatio(ratio) {
|
|
24515
24449
|
return { _internal_ratio: ratio, _internal_label: `${(ratio * 100).toFixed(1)}%` };
|
|
@@ -28340,9 +28274,6 @@ function createTextTool(context, options) {
|
|
|
28340
28274
|
return new TextTool(context, options);
|
|
28341
28275
|
}
|
|
28342
28276
|
|
|
28343
|
-
/**
|
|
28344
|
-
* Position Calculator - Cálculos de P&L, pips, R:R para trading
|
|
28345
|
-
*/
|
|
28346
28277
|
class PositionCalculator {
|
|
28347
28278
|
constructor(pipConfig) {
|
|
28348
28279
|
this._private__pipConfig = pipConfig;
|
|
@@ -28494,9 +28425,6 @@ function getPipConfig(symbolOrPrice, price) {
|
|
|
28494
28425
|
};
|
|
28495
28426
|
}
|
|
28496
28427
|
|
|
28497
|
-
/**
|
|
28498
|
-
* Ruler Calculator - Cálculos de distancia, pips, tiempo para mediciones
|
|
28499
|
-
*/
|
|
28500
28428
|
class RulerCalculator {
|
|
28501
28429
|
constructor(pipConfig) {
|
|
28502
28430
|
this._private__pipConfig = pipConfig;
|
|
@@ -28615,10 +28543,7 @@ class RulerPaneView {
|
|
|
28615
28543
|
}
|
|
28616
28544
|
}
|
|
28617
28545
|
|
|
28618
|
-
/**
|
|
28619
|
-
* Measurement Ruler Tool - Herramienta para medir distancia entre dos puntos
|
|
28620
|
-
* Muestra pips, porcentaje, tiempo transcurrido y número de barras
|
|
28621
|
-
*/
|
|
28546
|
+
/** Measures two points: pips, percent, elapsed time and bar count. */
|
|
28622
28547
|
class RulerTool extends DrawingToolBase {
|
|
28623
28548
|
constructor(context, options) {
|
|
28624
28549
|
super(context, 'ruler-tool', options);
|
|
@@ -29178,10 +29103,7 @@ class PositionPaneView {
|
|
|
29178
29103
|
}
|
|
29179
29104
|
}
|
|
29180
29105
|
|
|
29181
|
-
/**
|
|
29182
|
-
* Position Tool - Herramienta unificada para marcar posiciones long/short
|
|
29183
|
-
* Muestra dos rectángulos ajustables (profit/loss) con línea vertical conectora
|
|
29184
|
-
*/
|
|
29106
|
+
/** Two adjustable boxes, profit and loss, joined by a vertical connector. */
|
|
29185
29107
|
class PositionTool extends DrawingToolBase {
|
|
29186
29108
|
constructor(context, options) {
|
|
29187
29109
|
super(context, 'position-tool', options);
|
|
@@ -31076,7 +30998,7 @@ const customSeriesDefaultOptions = {
|
|
|
31076
30998
|
* Returns the current version as a string. For example `'1.0.0'`.
|
|
31077
30999
|
*/
|
|
31078
31000
|
function version() {
|
|
31079
|
-
return "2.3.
|
|
31001
|
+
return "2.3.3";
|
|
31080
31002
|
}
|
|
31081
31003
|
|
|
31082
31004
|
export { areaSeries as AreaSeries, ArrowTool, barSeries as BarSeries, baselineSeries as BaselineSeries, BrushTool, candlestickSeries as CandlestickSeries, CircleTool, ColorType, CrossLineTool, CrosshairMode, DEFAULT_SESSIONS, DraggablePriceLine, DrawingToolsManager, EXTENDED_FIBONACCI_RATIOS, FibonacciCalculator, FibonacciExtensionTool, FibonacciFanTool, FibonacciTool, GanttTool, histogramSeries as HistogramSeries, HorizontalLineTool, InteractiveLineManager, LastPriceAnimationMode, lineSeries as LineSeries, LineStyle, LineType, MismatchDirection, ParallelChannelTool, PitchforkTool, PolygonTool, PositionCalculator, PositionLine, PositionMarkersManager, PositionTool, PriceLineSource, PriceScaleMode, RectangleTool, RulerCalculator, RulerTool, STANDARD_FIBONACCI_RATIOS, TextTool, TickMarkType, TrackingModeExitMode, TradingSessionsIndicator, TrendLineTool, VerticalLineTool, VolumeProfileIndicator, applyADX, applyATR, applyBollingerBands, applyCCI, applyDonchianChannels, applyEMA, applyHeikinAshi, applyIchimoku, applyKeltnerChannels, applyMACD, applyMFI, applyOBV, applyParabolicSAR, applyPivotPoints, applyRSI, applySMA, applyStochastic, applySuperTrend, applyVWAP, applyVolume, applyWMA, applyWilliamsR, calculateHeikinAshi, calculatePipConfig, coordinateFromTime, createArrowTool, createBrushTool, createChart, createChartEx, createCircleTool, createCrossLineTool, createFibonacciExtensionTool, createFibonacciFanTool, createFibonacciTool, createGanttTool, createHorizontalLineTool, createImageWatermark, createInteractiveLineManager, createOptionsChart, createParallelChannelTool, createPitchforkTool, createPolygonTool, createPositionLine, createPositionMarkers, createPositionTool, createRectangleTool, createRulerTool, createSeriesMarkers, createTextTool, createTextWatermark, createTradingLine, createTradingSessionsIndicator, createTrendLineTool, createUpDownMarkers, createVerticalLineTool, createVolumeProfileIndicator, createYieldCurveChart, customSeriesDefaultOptions, defaultHorzScaleBehavior, getPipConfig, hideSeriesPaint, isBusinessDay, isUTCTimestamp, setSeriesVolumes, setVolumeProfileData, timeFromCoordinate, version };
|