@pipsend/charts 2.3.2 → 2.3.4
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 +62 -135
- package/dist/pipsend-charts.production.mjs +2 -2
- package/dist/pipsend-charts.standalone.development.js +62 -135
- package/dist/pipsend-charts.standalone.development.mjs +62 -135
- 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
package/dist/typings.d.ts
CHANGED
|
@@ -874,9 +874,6 @@ export declare class HorizontalLineTool extends DrawingToolBase {
|
|
|
874
874
|
protected _update(): void;
|
|
875
875
|
remove(): void;
|
|
876
876
|
}
|
|
877
|
-
/**
|
|
878
|
-
* Interactive Line Manager - Permite crear líneas haciendo clic en el gráfico
|
|
879
|
-
*/
|
|
880
877
|
export declare class InteractiveLineManager {
|
|
881
878
|
private _chart;
|
|
882
879
|
private _series;
|
|
@@ -892,24 +889,14 @@ export declare class InteractiveLineManager {
|
|
|
892
889
|
*/
|
|
893
890
|
private _getPriceFromMouseEvent;
|
|
894
891
|
/**
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
* @
|
|
898
|
-
* @returns Promesa que se resuelve cuando el usuario hace clic
|
|
892
|
+
* Arms the chart so the next click drops a line.
|
|
893
|
+
*
|
|
894
|
+
* @returns The line, once the user has clicked.
|
|
899
895
|
*/
|
|
900
896
|
enableClickToCreate(mode: LineCreationMode, customOptions?: Partial<DraggablePriceLineOptions>): Promise<DraggablePriceLine | null>;
|
|
901
|
-
/**
|
|
902
|
-
* Desactiva el modo de creación por clic
|
|
903
|
-
*/
|
|
904
897
|
disableClickToCreate(): void;
|
|
905
898
|
private _createLineAtPrice;
|
|
906
|
-
/**
|
|
907
|
-
* Obtiene el modo actual de creación
|
|
908
|
-
*/
|
|
909
899
|
getCreationMode(): LineCreationMode;
|
|
910
|
-
/**
|
|
911
|
-
* Verifica si está en modo de creación
|
|
912
|
-
*/
|
|
913
900
|
isCreating(): boolean;
|
|
914
901
|
}
|
|
915
902
|
/**
|
|
@@ -1218,66 +1205,29 @@ export declare class PositionLine implements ISeriesPrimitive, ControllableLine
|
|
|
1218
1205
|
private _applyPrice;
|
|
1219
1206
|
private _buildRendererData;
|
|
1220
1207
|
}
|
|
1221
|
-
/**
|
|
1222
|
-
* Gestor de marcadores de posiciones de trading
|
|
1223
|
-
*/
|
|
1224
1208
|
export declare class PositionMarkersManager<TimeType> {
|
|
1225
1209
|
private _markersPlugin;
|
|
1226
1210
|
private _positions;
|
|
1227
1211
|
private _options;
|
|
1228
1212
|
constructor(series: ISeriesApi<SeriesType, TimeType>, options?: PositionMarkersOptions);
|
|
1229
|
-
/**
|
|
1230
|
-
* Agrega una posición al gráfico
|
|
1231
|
-
*/
|
|
1232
1213
|
addPosition(position: TradingPosition<TimeType>): void;
|
|
1233
|
-
/**
|
|
1234
|
-
* Agrega múltiples posiciones al gráfico
|
|
1235
|
-
*/
|
|
1236
1214
|
addPositions(positions: TradingPosition<TimeType>[]): void;
|
|
1237
|
-
/**
|
|
1238
|
-
* Establece las posiciones (reemplaza las existentes)
|
|
1239
|
-
*/
|
|
1215
|
+
/** Replaces every position currently on the chart. */
|
|
1240
1216
|
setPositions(positions: TradingPosition<TimeType>[]): void;
|
|
1241
|
-
/**
|
|
1242
|
-
* Cierra una posición abierta agregando el punto de salida
|
|
1243
|
-
*/
|
|
1217
|
+
/** Closes an open position by giving it an exit point. */
|
|
1244
1218
|
closePosition(id: string, exit: {
|
|
1245
1219
|
time: TimeType;
|
|
1246
1220
|
price: number;
|
|
1247
1221
|
}, exitText?: string): void;
|
|
1248
|
-
/**
|
|
1249
|
-
* Elimina una posición por ID
|
|
1250
|
-
*/
|
|
1251
1222
|
removePosition(id: string): void;
|
|
1252
|
-
/**
|
|
1253
|
-
* Limpia todas las posiciones
|
|
1254
|
-
*/
|
|
1255
1223
|
clearPositions(): void;
|
|
1256
|
-
/**
|
|
1257
|
-
* Obtiene todas las posiciones actuales
|
|
1258
|
-
*/
|
|
1259
1224
|
getPositions(): readonly TradingPosition<TimeType>[];
|
|
1260
|
-
/**
|
|
1261
|
-
* Actualiza las opciones del gestor
|
|
1262
|
-
*/
|
|
1263
1225
|
applyOptions(options: PositionMarkersOptions): void;
|
|
1264
|
-
/**
|
|
1265
|
-
* Convierte las posiciones a marcadores de serie
|
|
1266
|
-
*/
|
|
1267
1226
|
private _positionsToMarkers;
|
|
1268
|
-
/**
|
|
1269
|
-
* Actualiza los marcadores en el gráfico
|
|
1270
|
-
*/
|
|
1271
1227
|
private _updateMarkers;
|
|
1272
|
-
/**
|
|
1273
|
-
* Desconecta el plugin y limpia recursos
|
|
1274
|
-
*/
|
|
1275
1228
|
detach(): void;
|
|
1276
1229
|
}
|
|
1277
|
-
/**
|
|
1278
|
-
* Position Tool - Herramienta unificada para marcar posiciones long/short
|
|
1279
|
-
* Muestra dos rectángulos ajustables (profit/loss) con línea vertical conectora
|
|
1280
|
-
*/
|
|
1230
|
+
/** Two adjustable boxes, profit and loss, joined by a vertical connector. */
|
|
1281
1231
|
export declare class PositionTool extends DrawingToolBase {
|
|
1282
1232
|
private _positionOptions;
|
|
1283
1233
|
private _calculator;
|
|
@@ -1436,10 +1386,7 @@ export declare class RulerCalculator {
|
|
|
1436
1386
|
*/
|
|
1437
1387
|
getPipConfig(): PipConfig;
|
|
1438
1388
|
}
|
|
1439
|
-
/**
|
|
1440
|
-
* Measurement Ruler Tool - Herramienta para medir distancia entre dos puntos
|
|
1441
|
-
* Muestra pips, porcentaje, tiempo transcurrido y número de barras
|
|
1442
|
-
*/
|
|
1389
|
+
/** Measures two points: pips, percent, elapsed time and bar count. */
|
|
1443
1390
|
export declare class RulerTool extends DrawingToolBase {
|
|
1444
1391
|
private _rulerOptions;
|
|
1445
1392
|
private _calculator;
|
|
@@ -2349,17 +2296,13 @@ export declare function createHorizontalLineTool(context: DrawingContext, option
|
|
|
2349
2296
|
*/
|
|
2350
2297
|
export declare function createImageWatermark<T>(pane: IPaneApi<T>, imageUrl: string, options: DeepPartial<ImageWatermarkOptions>): IImageWatermarkPluginApi<T>;
|
|
2351
2298
|
/**
|
|
2352
|
-
*
|
|
2353
|
-
*
|
|
2354
|
-
* @param series - Series instance
|
|
2355
|
-
* @returns InteractiveLineManager
|
|
2299
|
+
* Lets the user place draggable lines by clicking the chart.
|
|
2300
|
+
*
|
|
2356
2301
|
* @example
|
|
2357
2302
|
* ```typescript
|
|
2358
2303
|
* const manager = createInteractiveLineManager(chart, candleSeries);
|
|
2359
|
-
*
|
|
2360
|
-
* // Activar modo de creación
|
|
2361
2304
|
* const line = await manager.enableClickToCreate('stop-loss', {
|
|
2362
|
-
* onDragEnd: (price) => console.log('SL:', price)
|
|
2305
|
+
* onDragEnd: (price) => console.log('SL:', price),
|
|
2363
2306
|
* });
|
|
2364
2307
|
* ```
|
|
2365
2308
|
*/
|
|
@@ -2400,47 +2343,18 @@ export declare function createPolygonTool(context: DrawingContext, options: Poly
|
|
|
2400
2343
|
*/
|
|
2401
2344
|
export declare function createPositionLine(series: ISeriesApi<SeriesType>, chart: IChartApi, options: PositionLineOptions): PositionLine;
|
|
2402
2345
|
/**
|
|
2403
|
-
*
|
|
2404
|
-
*
|
|
2405
|
-
* @param series - Serie a la que se adjuntarán los marcadores
|
|
2406
|
-
* @param positions - Posiciones iniciales (opcional)
|
|
2407
|
-
* @param options - Opciones de configuración (opcional)
|
|
2408
|
-
* @returns Instancia del gestor de posiciones
|
|
2346
|
+
* Marks trades on a series with an arrow at the entry and, once closed, at the
|
|
2347
|
+
* exit.
|
|
2409
2348
|
*
|
|
2410
2349
|
* @example
|
|
2411
2350
|
* ```typescript
|
|
2412
|
-
*
|
|
2413
|
-
*
|
|
2414
|
-
*
|
|
2415
|
-
* // Agregar una posición long
|
|
2416
|
-
* positionMarkers.addPosition({
|
|
2417
|
-
* type: 'long',
|
|
2418
|
-
* entry: { time: '2023-01-01', price: 100.50 },
|
|
2419
|
-
* exit: { time: '2023-01-05', price: 105.20 },
|
|
2420
|
-
* id: 'pos-1'
|
|
2421
|
-
* });
|
|
2422
|
-
*
|
|
2423
|
-
* // Agregar una posición short
|
|
2424
|
-
* positionMarkers.addPosition({
|
|
2425
|
-
* type: 'short',
|
|
2426
|
-
* entry: { time: '2023-01-10', price: 110.00 },
|
|
2427
|
-
* exit: { time: '2023-01-15', price: 107.50 },
|
|
2428
|
-
* id: 'pos-2'
|
|
2429
|
-
* });
|
|
2430
|
-
*
|
|
2431
|
-
* // Agregar múltiples posiciones
|
|
2432
|
-
* positionMarkers.setPositions([
|
|
2433
|
-
* {
|
|
2351
|
+
* const markers = createPositionMarkers(candleSeries);
|
|
2352
|
+
* markers.addPosition({
|
|
2434
2353
|
* type: 'long',
|
|
2435
|
-
* entry: { time: '2023-
|
|
2436
|
-
* exit: { time: '2023-
|
|
2437
|
-
*
|
|
2438
|
-
*
|
|
2439
|
-
* type: 'short',
|
|
2440
|
-
* entry: { time: '2023-02-15', price: 102.00 },
|
|
2441
|
-
* exit: { time: '2023-02-20', price: 99.00 }
|
|
2442
|
-
* }
|
|
2443
|
-
* ]);
|
|
2354
|
+
* entry: { time: '2023-01-01', price: 100.50 },
|
|
2355
|
+
* exit: { time: '2023-01-05', price: 105.20 },
|
|
2356
|
+
* id: 'pos-1',
|
|
2357
|
+
* });
|
|
2444
2358
|
* ```
|
|
2445
2359
|
*/
|
|
2446
2360
|
export declare function createPositionMarkers<TimeType>(series: ISeriesApi<SeriesType, TimeType>, positions?: TradingPosition<TimeType>[], options?: PositionMarkersOptions): PositionMarkersManager<TimeType>;
|
|
@@ -6104,9 +6018,6 @@ export interface ParallelChannelToolOptions extends DrawingToolOptions {
|
|
|
6104
6018
|
onRemove?: () => void;
|
|
6105
6019
|
onComplete?: () => void;
|
|
6106
6020
|
}
|
|
6107
|
-
/**
|
|
6108
|
-
* Position Calculator - Cálculos de P&L, pips, R:R para trading
|
|
6109
|
-
*/
|
|
6110
6021
|
export interface PipConfig {
|
|
6111
6022
|
pipValue: number;
|
|
6112
6023
|
decimals: number;
|
|
@@ -6356,37 +6267,19 @@ export interface PositionLineUpdate extends Partial<Omit<PositionLineOptions, "e
|
|
|
6356
6267
|
takeProfit?: Partial<PositionLineLevelOptions>;
|
|
6357
6268
|
stopLoss?: Partial<PositionLineLevelOptions>;
|
|
6358
6269
|
}
|
|
6359
|
-
/**
|
|
6360
|
-
* Opciones para el gestor de posiciones
|
|
6361
|
-
*/
|
|
6362
6270
|
export interface PositionMarkersOptions {
|
|
6363
|
-
/**
|
|
6364
|
-
* Colores predeterminados para posiciones long
|
|
6365
|
-
*/
|
|
6366
6271
|
longColors?: {
|
|
6367
6272
|
entry?: string;
|
|
6368
6273
|
exit?: string;
|
|
6369
6274
|
};
|
|
6370
|
-
/**
|
|
6371
|
-
* Colores predeterminados para posiciones short
|
|
6372
|
-
*/
|
|
6373
6275
|
shortColors?: {
|
|
6374
6276
|
entry?: string;
|
|
6375
6277
|
exit?: string;
|
|
6376
6278
|
};
|
|
6377
|
-
/**
|
|
6378
|
-
* Tamaño predeterminado de las flechas
|
|
6379
|
-
*/
|
|
6380
6279
|
defaultSize?: number;
|
|
6381
|
-
/**
|
|
6382
|
-
* Offset vertical para las flechas de entrada (en puntos de precio)
|
|
6383
|
-
* Positivo = arriba, Negativo = abajo
|
|
6384
|
-
*/
|
|
6280
|
+
/** Vertical offset of the entry arrow, in price points. Positive is up. */
|
|
6385
6281
|
entryOffset?: number;
|
|
6386
|
-
/**
|
|
6387
|
-
* Offset vertical para las flechas de salida (en puntos de precio)
|
|
6388
|
-
* Positivo = arriba, Negativo = abajo
|
|
6389
|
-
*/
|
|
6282
|
+
/** Vertical offset of the exit arrow, in price points. Positive is up. */
|
|
6390
6283
|
exitOffset?: number;
|
|
6391
6284
|
}
|
|
6392
6285
|
export interface PositionMetrics {
|
|
@@ -7556,47 +7449,26 @@ export interface TradingLineOptions {
|
|
|
7556
7449
|
*/
|
|
7557
7450
|
formatTitle?: (price: number) => string;
|
|
7558
7451
|
}
|
|
7559
|
-
/**
|
|
7560
|
-
* Representa una posición de trading con punto de entrada y salida opcional
|
|
7561
|
-
*/
|
|
7452
|
+
/** A trade, with an exit once it is closed. */
|
|
7562
7453
|
export interface TradingPosition<TimeType> {
|
|
7563
|
-
/**
|
|
7564
|
-
* Tipo de posición (long o short)
|
|
7565
|
-
*/
|
|
7566
7454
|
type: PositionType;
|
|
7567
|
-
/**
|
|
7568
|
-
* Punto de entrada
|
|
7569
|
-
*/
|
|
7570
7455
|
entry: {
|
|
7571
7456
|
time: TimeType;
|
|
7572
7457
|
price: number;
|
|
7573
7458
|
};
|
|
7574
|
-
/**
|
|
7575
|
-
* Punto de salida (opcional - para posiciones abiertas)
|
|
7576
|
-
*/
|
|
7459
|
+
/** Absent while the position is still open. */
|
|
7577
7460
|
exit?: {
|
|
7578
7461
|
time: TimeType;
|
|
7579
7462
|
price: number;
|
|
7580
7463
|
};
|
|
7581
|
-
/**
|
|
7582
|
-
* ID opcional para identificar la posición
|
|
7583
|
-
*/
|
|
7584
7464
|
id?: string;
|
|
7585
|
-
/**
|
|
7586
|
-
* Color personalizado para las flechas (opcional)
|
|
7587
|
-
* Si no se especifica, se usarán colores predeterminados según el tipo
|
|
7588
|
-
*/
|
|
7465
|
+
/** Overrides the colours the position type would otherwise pick. */
|
|
7589
7466
|
color?: {
|
|
7590
7467
|
entry?: string;
|
|
7591
7468
|
exit?: string;
|
|
7592
7469
|
};
|
|
7593
|
-
/**
|
|
7594
|
-
* Tamaño de las flechas (opcional, por defecto 1)
|
|
7595
|
-
*/
|
|
7470
|
+
/** @defaultValue 1 */
|
|
7596
7471
|
size?: number;
|
|
7597
|
-
/**
|
|
7598
|
-
* Texto opcional para las flechas
|
|
7599
|
-
*/
|
|
7600
7472
|
text?: {
|
|
7601
7473
|
entry?: string;
|
|
7602
7474
|
exit?: string;
|
|
@@ -8062,9 +7934,6 @@ export type PositionLineLevel = "entry" | "takeProfit" | "stopLoss";
|
|
|
8062
7934
|
* The parts of a level that respond to the pointer.
|
|
8063
7935
|
*/
|
|
8064
7936
|
export type PositionLinePart = "line" | "body" | "close";
|
|
8065
|
-
/**
|
|
8066
|
-
* Tipo de posición de trading
|
|
8067
|
-
*/
|
|
8068
7937
|
export type PositionType = "long" | "short";
|
|
8069
7938
|
/**
|
|
8070
7939
|
* Represents information used to format prices.
|