oakscriptjs 0.9.6 → 0.10.0
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 +1 -1
- package/dist/cjs/array/index.d.ts +9 -23
- package/dist/cjs/array/index.d.ts.map +1 -1
- package/dist/cjs/array/index.js +4 -0
- package/dist/cjs/array/index.js.map +2 -2
- package/dist/cjs/drawing/bar-time.d.ts +24 -0
- package/dist/cjs/drawing/bar-time.d.ts.map +1 -0
- package/dist/cjs/drawing/bar-time.js +47 -0
- package/dist/cjs/drawing/bar-time.js.map +7 -0
- package/dist/cjs/drawing/output.d.ts +32 -0
- package/dist/cjs/drawing/output.d.ts.map +1 -0
- package/dist/cjs/drawing/output.js +184 -0
- package/dist/cjs/drawing/output.js.map +7 -0
- package/dist/cjs/drawing/registry.d.ts +5 -4
- package/dist/cjs/drawing/registry.d.ts.map +1 -1
- package/dist/cjs/drawing/registry.js +11 -2
- package/dist/cjs/drawing/registry.js.map +2 -2
- package/dist/cjs/index.d.ts +6 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/polyline/index.d.ts +3 -5
- package/dist/cjs/polyline/index.d.ts.map +1 -1
- package/dist/cjs/polyline/index.js +0 -5
- package/dist/cjs/polyline/index.js.map +2 -2
- package/dist/cjs/runtime/types.d.ts +22 -0
- package/dist/cjs/runtime/types.d.ts.map +1 -1
- package/dist/cjs/runtime/types.js.map +1 -1
- package/dist/cjs/script/index.d.ts +82 -5
- package/dist/cjs/script/index.d.ts.map +1 -1
- package/dist/cjs/script/index.js +141 -26
- package/dist/cjs/script/index.js.map +3 -3
- package/dist/cjs/table/index.d.ts +87 -0
- package/dist/cjs/table/index.d.ts.map +1 -0
- package/dist/cjs/table/index.js +150 -0
- package/dist/cjs/table/index.js.map +7 -0
- package/dist/cjs/text/index.d.ts +17 -2
- package/dist/cjs/text/index.d.ts.map +1 -1
- package/dist/cjs/text/index.js +15 -1
- package/dist/cjs/text/index.js.map +2 -2
- package/dist/cjs/types/index.d.ts +30 -1
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +12 -0
- package/dist/cjs/types/index.js.map +2 -2
- package/dist/cjs/types/metadata.d.ts +258 -26
- package/dist/cjs/types/metadata.d.ts.map +1 -1
- package/dist/cjs/types/metadata.js.map +1 -1
- package/dist/esm/array/index.d.ts +9 -23
- package/dist/esm/array/index.d.ts.map +1 -1
- package/dist/esm/array/index.js +10 -22
- package/dist/esm/array/index.js.map +1 -1
- package/dist/esm/drawing/bar-time.d.ts +24 -0
- package/dist/esm/drawing/bar-time.d.ts.map +1 -0
- package/dist/esm/drawing/bar-time.js +44 -0
- package/dist/esm/drawing/bar-time.js.map +1 -0
- package/dist/esm/drawing/output.d.ts +32 -0
- package/dist/esm/drawing/output.d.ts.map +1 -0
- package/dist/esm/drawing/output.js +190 -0
- package/dist/esm/drawing/output.js.map +1 -0
- package/dist/esm/drawing/registry.d.ts +5 -4
- package/dist/esm/drawing/registry.d.ts.map +1 -1
- package/dist/esm/drawing/registry.js +12 -2
- package/dist/esm/drawing/registry.js.map +1 -1
- package/dist/esm/index.d.ts +6 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +7 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/polyline/index.d.ts +3 -5
- package/dist/esm/polyline/index.d.ts.map +1 -1
- package/dist/esm/polyline/index.js +3 -9
- package/dist/esm/polyline/index.js.map +1 -1
- package/dist/esm/runtime/types.d.ts +22 -0
- package/dist/esm/runtime/types.d.ts.map +1 -1
- package/dist/esm/script/index.d.ts +82 -5
- package/dist/esm/script/index.d.ts.map +1 -1
- package/dist/esm/script/index.js +167 -21
- package/dist/esm/script/index.js.map +1 -1
- package/dist/esm/table/index.d.ts +87 -0
- package/dist/esm/table/index.d.ts.map +1 -0
- package/dist/esm/table/index.js +169 -0
- package/dist/esm/table/index.js.map +1 -0
- package/dist/esm/text/index.d.ts +17 -2
- package/dist/esm/text/index.d.ts.map +1 -1
- package/dist/esm/text/index.js +17 -2
- package/dist/esm/text/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +30 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +14 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/metadata.d.ts +258 -26
- package/dist/esm/types/metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/array/index.ts +12 -23
- package/src/drawing/bar-time.ts +42 -0
- package/src/drawing/output.ts +214 -0
- package/src/drawing/registry.ts +16 -6
- package/src/index.ts +9 -3
- package/src/polyline/index.ts +3 -12
- package/src/runtime/types.ts +23 -0
- package/src/script/index.ts +254 -24
- package/src/table/index.ts +221 -0
- package/src/text/index.ts +18 -2
- package/src/types/index.ts +32 -1
- package/src/types/metadata.ts +325 -26
package/src/types/index.ts
CHANGED
|
@@ -217,8 +217,22 @@ export interface Table {
|
|
|
217
217
|
border_width?: number;
|
|
218
218
|
/** Table background color */
|
|
219
219
|
bgcolor?: color;
|
|
220
|
-
/**
|
|
220
|
+
/** Display on the main chart pane (PineScript force_overlay) */
|
|
221
|
+
force_overlay?: boolean;
|
|
222
|
+
/** Cells by "column,row" */
|
|
221
223
|
cells?: Map<string, TableCell>;
|
|
224
|
+
/** Merged cell ranges (PineScript table.merge_cells) */
|
|
225
|
+
merges?: TableMerge[];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Merged cell range of a table
|
|
230
|
+
*/
|
|
231
|
+
export interface TableMerge {
|
|
232
|
+
start_column: number;
|
|
233
|
+
start_row: number;
|
|
234
|
+
end_column: number;
|
|
235
|
+
end_row: number;
|
|
222
236
|
}
|
|
223
237
|
|
|
224
238
|
/**
|
|
@@ -245,6 +259,8 @@ export interface TableCell {
|
|
|
245
259
|
tooltip?: string;
|
|
246
260
|
/** Text font family */
|
|
247
261
|
text_font_family?: 'default' | 'monospace';
|
|
262
|
+
/** Text formatting flags: 0 none, 1 bold, 2 italic, 3 bold + italic (PineScript text.format_*) */
|
|
263
|
+
text_formatting?: number;
|
|
248
264
|
}
|
|
249
265
|
|
|
250
266
|
// Series types for drawing objects
|
|
@@ -349,6 +365,21 @@ export const xloc = {
|
|
|
349
365
|
bar_time: 'bar_time' as const,
|
|
350
366
|
};
|
|
351
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Table position constants (PineScript `position.*`), for `table.new` and `table.set_position`
|
|
370
|
+
*/
|
|
371
|
+
export const position = {
|
|
372
|
+
top_left: 'top_left' as const,
|
|
373
|
+
top_center: 'top_center' as const,
|
|
374
|
+
top_right: 'top_right' as const,
|
|
375
|
+
middle_left: 'middle_left' as const,
|
|
376
|
+
middle_center: 'middle_center' as const,
|
|
377
|
+
middle_right: 'middle_right' as const,
|
|
378
|
+
bottom_left: 'bottom_left' as const,
|
|
379
|
+
bottom_center: 'bottom_center' as const,
|
|
380
|
+
bottom_right: 'bottom_right' as const,
|
|
381
|
+
};
|
|
382
|
+
|
|
352
383
|
/**
|
|
353
384
|
* ChartPoint interface - Represents a point on the chart
|
|
354
385
|
* @remarks
|
package/src/types/metadata.ts
CHANGED
|
@@ -223,14 +223,19 @@ export interface FillGradient {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
|
-
* Marker location on the chart (PineScript plotshape/plotchar
|
|
226
|
+
* Marker location on the chart (PineScript plotshape/plotchar `location.*`)
|
|
227
227
|
*/
|
|
228
228
|
export type MarkerLocation = 'abovebar' | 'belowbar' | 'top' | 'bottom' | 'absolute';
|
|
229
229
|
|
|
230
|
+
/**
|
|
231
|
+
* PineScript size constant (`size.auto`, `size.tiny`, ...)
|
|
232
|
+
*/
|
|
233
|
+
export type PineSize = 'auto' | 'tiny' | 'small' | 'normal' | 'large' | 'huge';
|
|
234
|
+
|
|
230
235
|
/**
|
|
231
236
|
* Marker size (PineScript size.* constants)
|
|
232
237
|
*/
|
|
233
|
-
export type MarkerSize =
|
|
238
|
+
export type MarkerSize = PineSize;
|
|
234
239
|
|
|
235
240
|
/**
|
|
236
241
|
* Shape style (PineScript shape.* constants)
|
|
@@ -250,31 +255,76 @@ export type ShapeStyle =
|
|
|
250
255
|
| 'diamond';
|
|
251
256
|
|
|
252
257
|
/**
|
|
253
|
-
*
|
|
258
|
+
* Position of a marker:
|
|
259
|
+
* - aboveBar / belowBar / inBar: next to the bar (PineScript location.abovebar / location.belowbar)
|
|
260
|
+
* - atPriceTop / atPriceBottom / atPriceMiddle: at `price` (PineScript location.absolute), with the meaning of the
|
|
261
|
+
* lightweight-charts price positions: atPriceTop has the shape above the price, its bottom (the tip of a label) on
|
|
262
|
+
* the price (shape.labeldown); atPriceBottom has the shape below the price, its top on the price (shape.labelup);
|
|
263
|
+
* atPriceMiddle centres the shape on the price (other shapes)
|
|
264
|
+
* - top / bottom: at the top / bottom edge of the pane of the indicator (PineScript location.top / location.bottom),
|
|
265
|
+
* the price pane for an overlay indicator or with forceOverlay
|
|
266
|
+
*/
|
|
267
|
+
export type MarkerPosition =
|
|
268
|
+
| 'aboveBar'
|
|
269
|
+
| 'belowBar'
|
|
270
|
+
| 'inBar'
|
|
271
|
+
| 'atPriceTop'
|
|
272
|
+
| 'atPriceBottom'
|
|
273
|
+
| 'atPriceMiddle'
|
|
274
|
+
| 'top'
|
|
275
|
+
| 'bottom';
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Marker shape (PineScript shape.* in the lightweight-charts spelling)
|
|
279
|
+
*/
|
|
280
|
+
export type MarkerShape =
|
|
281
|
+
| 'arrowUp'
|
|
282
|
+
| 'arrowDown'
|
|
283
|
+
| 'circle'
|
|
284
|
+
| 'square'
|
|
285
|
+
| 'labelUp'
|
|
286
|
+
| 'labelDown'
|
|
287
|
+
| 'triangleUp'
|
|
288
|
+
| 'triangleDown'
|
|
289
|
+
| 'cross'
|
|
290
|
+
| 'xcross'
|
|
291
|
+
| 'diamond'
|
|
292
|
+
| 'flag';
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* One marker: a plotshape()/plotchar() marker on a bar where the condition held, or a marker of a built-in indicator
|
|
254
296
|
*/
|
|
255
297
|
export interface MarkerData {
|
|
256
298
|
/** Time of the bar the marker is displayed on (offset already applied) */
|
|
257
|
-
time:
|
|
258
|
-
/**
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
|
|
262
|
-
/** Shape
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
299
|
+
time: number;
|
|
300
|
+
/** Where the marker is drawn */
|
|
301
|
+
position: MarkerPosition;
|
|
302
|
+
/** Price of the atPrice* positions (required with them) */
|
|
303
|
+
price?: number;
|
|
304
|
+
/** Shape. A plotchar marker also has `char`: the character is drawn in place of the shape */
|
|
305
|
+
shape: MarkerShape;
|
|
306
|
+
/**
|
|
307
|
+
* Shape colour (the character colour of a plotchar marker). A fully transparent colour ('transparent',
|
|
308
|
+
* '#rrggbb00', 'rgba(r, g, b, 0)') draws no shape, as PineScript `color = na`; the text is still drawn
|
|
309
|
+
*/
|
|
310
|
+
color: string;
|
|
311
|
+
/** Text; a line feed starts a new line */
|
|
269
312
|
text?: string;
|
|
270
|
-
/**
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
313
|
+
/**
|
|
314
|
+
* Text colour (PineScript textcolor). When omitted: white inside label shapes (labelUp / labelDown), the shape
|
|
315
|
+
* colour for the other shapes
|
|
316
|
+
*/
|
|
317
|
+
textColor?: string;
|
|
318
|
+
/** Size multiplier (1 = default size) or a PineScript size */
|
|
319
|
+
size?: number | PineSize;
|
|
320
|
+
/** PineScript force_overlay = true: the marker of a non-overlay indicator is drawn on the price pane */
|
|
321
|
+
forceOverlay?: boolean;
|
|
322
|
+
/** Id of the plotshape/plotchar declaration that produced it (script markers) */
|
|
323
|
+
id?: string;
|
|
324
|
+
/** plotchar character, drawn in place of the shape */
|
|
325
|
+
char?: string;
|
|
326
|
+
/** Hover tooltip */
|
|
275
327
|
tooltip?: string;
|
|
276
|
-
/** Price for location 'absolute' (the series value on that bar) */
|
|
277
|
-
price?: number;
|
|
278
328
|
}
|
|
279
329
|
|
|
280
330
|
/**
|
|
@@ -292,15 +342,248 @@ export interface ArrowData {
|
|
|
292
342
|
}
|
|
293
343
|
|
|
294
344
|
/**
|
|
295
|
-
* Per-bar color
|
|
345
|
+
* Per-bar candle color (barcolor() output)
|
|
296
346
|
*/
|
|
297
347
|
export interface BarColorData {
|
|
298
348
|
/** Time of the colored bar (offset already applied) */
|
|
299
|
-
time:
|
|
349
|
+
time: number;
|
|
300
350
|
/** Color */
|
|
301
351
|
color: string;
|
|
302
352
|
}
|
|
303
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Per-bar background color (bgcolor() output)
|
|
356
|
+
*/
|
|
357
|
+
export interface BgColorData {
|
|
358
|
+
/** Time of the colored bar (offset already applied) */
|
|
359
|
+
time: number;
|
|
360
|
+
/** Color (with its transparency) */
|
|
361
|
+
color: string;
|
|
362
|
+
/** PineScript bgcolor(..., force_overlay = true): drawn on the price pane even for a non-overlay indicator */
|
|
363
|
+
forceOverlay?: boolean;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* One candle of plotcandle() (or of a built-in indicator that draws candles)
|
|
368
|
+
*/
|
|
369
|
+
export interface PlotCandleData {
|
|
370
|
+
time: number;
|
|
371
|
+
open: number;
|
|
372
|
+
high: number;
|
|
373
|
+
low: number;
|
|
374
|
+
close: number;
|
|
375
|
+
/** Body colour */
|
|
376
|
+
color?: string;
|
|
377
|
+
borderColor?: string;
|
|
378
|
+
wickColor?: string;
|
|
379
|
+
/** PineScript force_overlay = true: the candles of a non-overlay indicator are drawn on the price pane */
|
|
380
|
+
forceOverlay?: boolean;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* One bar of plotbar(): an OHLC bar (a vertical line from low to high, the open tick on the left, the close tick on
|
|
385
|
+
* the right)
|
|
386
|
+
*/
|
|
387
|
+
export interface PlotBarData {
|
|
388
|
+
time: number;
|
|
389
|
+
open: number;
|
|
390
|
+
high: number;
|
|
391
|
+
low: number;
|
|
392
|
+
close: number;
|
|
393
|
+
color?: string;
|
|
394
|
+
/** PineScript force_overlay = true: the bars of a non-overlay indicator are drawn on the price pane */
|
|
395
|
+
forceOverlay?: boolean;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/** PineScript label style (`label.style_*` without the prefix) */
|
|
399
|
+
export type LabelStyle =
|
|
400
|
+
| 'none'
|
|
401
|
+
| 'xcross'
|
|
402
|
+
| 'cross'
|
|
403
|
+
| 'triangleup'
|
|
404
|
+
| 'triangledown'
|
|
405
|
+
| 'flag'
|
|
406
|
+
| 'circle'
|
|
407
|
+
| 'arrowup'
|
|
408
|
+
| 'arrowdown'
|
|
409
|
+
| 'label_up'
|
|
410
|
+
| 'label_down'
|
|
411
|
+
| 'label_left'
|
|
412
|
+
| 'label_right'
|
|
413
|
+
| 'label_lower_left'
|
|
414
|
+
| 'label_lower_right'
|
|
415
|
+
| 'label_upper_left'
|
|
416
|
+
| 'label_upper_right'
|
|
417
|
+
| 'label_center'
|
|
418
|
+
| 'square'
|
|
419
|
+
| 'diamond'
|
|
420
|
+
| 'text_outline';
|
|
421
|
+
|
|
422
|
+
// Drawing outputs (labels, lines, boxes, linefills, polylines, tables). A field the script did not set is omitted and
|
|
423
|
+
// the renderer uses the PineScript default; a colour set to na is 'transparent'. A point on a bar after the last bar
|
|
424
|
+
// (PineScript bar_index + k) has the time of that future bar (see barTime). The same applies to markers and plots.
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* A label (PineScript label.new)
|
|
428
|
+
*/
|
|
429
|
+
export interface LabelData {
|
|
430
|
+
time: number;
|
|
431
|
+
/** Price; not used with yloc 'abovebar' / 'belowbar' */
|
|
432
|
+
price: number;
|
|
433
|
+
text: string;
|
|
434
|
+
/** Background, border and arrow colour */
|
|
435
|
+
color?: string;
|
|
436
|
+
textColor?: string;
|
|
437
|
+
/** 'none': text only, no background (PineScript label.style_none) */
|
|
438
|
+
style?: LabelStyle;
|
|
439
|
+
size?: PineSize | number;
|
|
440
|
+
/**
|
|
441
|
+
* PineScript yloc: 'price' (default) places the label at `price`; 'abovebar' / 'belowbar' place it above the bar
|
|
442
|
+
* high / below the bar low and ignore `price` (the renderer reads the bar at `time`).
|
|
443
|
+
*/
|
|
444
|
+
yloc?: 'price' | 'abovebar' | 'belowbar';
|
|
445
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
446
|
+
tooltip?: string;
|
|
447
|
+
fontFamily?: 'default' | 'monospace';
|
|
448
|
+
/** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */
|
|
449
|
+
textFormatting?: number;
|
|
450
|
+
/** PineScript force_overlay = true: the label of a non-overlay indicator is drawn on the price pane */
|
|
451
|
+
forceOverlay?: boolean;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* A line (PineScript line.new)
|
|
456
|
+
*/
|
|
457
|
+
export interface LineDrawingData {
|
|
458
|
+
time1: number;
|
|
459
|
+
price1: number;
|
|
460
|
+
time2: number;
|
|
461
|
+
price2: number;
|
|
462
|
+
color?: string;
|
|
463
|
+
width?: number;
|
|
464
|
+
style?: 'solid' | 'dashed' | 'dotted' | 'arrow_left' | 'arrow_right' | 'arrow_both';
|
|
465
|
+
extend?: 'none' | 'left' | 'right' | 'both';
|
|
466
|
+
/** PineScript force_overlay = true: the line of a non-overlay indicator is drawn on the price pane */
|
|
467
|
+
forceOverlay?: boolean;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* A rectangle (PineScript box.new): time1 / price1 are the left / top, time2 / price2 the right / bottom
|
|
472
|
+
*/
|
|
473
|
+
export interface BoxData {
|
|
474
|
+
time1: number;
|
|
475
|
+
price1: number;
|
|
476
|
+
time2: number;
|
|
477
|
+
price2: number;
|
|
478
|
+
bgColor?: string;
|
|
479
|
+
borderColor?: string;
|
|
480
|
+
borderWidth?: number;
|
|
481
|
+
borderStyle?: 'solid' | 'dashed' | 'dotted';
|
|
482
|
+
text?: string;
|
|
483
|
+
textColor?: string;
|
|
484
|
+
textSize?: PineSize | number;
|
|
485
|
+
textHAlign?: 'left' | 'center' | 'right';
|
|
486
|
+
textVAlign?: 'top' | 'center' | 'bottom';
|
|
487
|
+
textWrap?: 'none' | 'auto';
|
|
488
|
+
fontFamily?: 'default' | 'monospace';
|
|
489
|
+
/** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */
|
|
490
|
+
textFormatting?: number;
|
|
491
|
+
/** PineScript box extend: the box continues to the left / right edge of the chart */
|
|
492
|
+
extend?: 'none' | 'left' | 'right' | 'both';
|
|
493
|
+
/** PineScript force_overlay = true: the box of a non-overlay indicator is drawn on the price pane */
|
|
494
|
+
forceOverlay?: boolean;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* The area between two lines (PineScript linefill.new), with the two lines as drawn (their extend included)
|
|
499
|
+
*/
|
|
500
|
+
export interface LinefillData {
|
|
501
|
+
line1: LineDrawingData;
|
|
502
|
+
line2: LineDrawingData;
|
|
503
|
+
color?: string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* A polyline (PineScript polyline.new)
|
|
508
|
+
*/
|
|
509
|
+
export interface PolylineData {
|
|
510
|
+
points: Array<{ time: number; price: number }>;
|
|
511
|
+
/** Curved segments between the points */
|
|
512
|
+
curved?: boolean;
|
|
513
|
+
/** The last point is connected to the first */
|
|
514
|
+
closed?: boolean;
|
|
515
|
+
lineColor?: string;
|
|
516
|
+
/** Fill of the area inside the polyline */
|
|
517
|
+
fillColor?: string;
|
|
518
|
+
lineStyle?: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';
|
|
519
|
+
lineWidth?: number;
|
|
520
|
+
/** PineScript force_overlay = true: the polyline of a non-overlay indicator is drawn on the price pane */
|
|
521
|
+
forceOverlay?: boolean;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/** Table position (PineScript position.*) */
|
|
525
|
+
export type TablePosition =
|
|
526
|
+
| 'top_left'
|
|
527
|
+
| 'top_center'
|
|
528
|
+
| 'top_right'
|
|
529
|
+
| 'middle_left'
|
|
530
|
+
| 'middle_center'
|
|
531
|
+
| 'middle_right'
|
|
532
|
+
| 'bottom_left'
|
|
533
|
+
| 'bottom_center'
|
|
534
|
+
| 'bottom_right';
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* A table cell (PineScript table.cell)
|
|
538
|
+
*/
|
|
539
|
+
export interface TableCellData {
|
|
540
|
+
row: number;
|
|
541
|
+
column: number;
|
|
542
|
+
text: string;
|
|
543
|
+
bgColor?: string;
|
|
544
|
+
textColor?: string;
|
|
545
|
+
textSize?: PineSize | number;
|
|
546
|
+
/** Width in % of the chart width; 0 fits the text */
|
|
547
|
+
width?: number;
|
|
548
|
+
/** Height in % of the chart height; 0 fits the text */
|
|
549
|
+
height?: number;
|
|
550
|
+
textHAlign?: 'left' | 'center' | 'right';
|
|
551
|
+
textVAlign?: 'top' | 'center' | 'bottom';
|
|
552
|
+
tooltip?: string;
|
|
553
|
+
fontFamily?: 'default' | 'monospace';
|
|
554
|
+
/** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */
|
|
555
|
+
textFormatting?: number;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Merged cells of a table (PineScript table.merge_cells): the cell at the start column / row covers the range and
|
|
560
|
+
* gives its content
|
|
561
|
+
*/
|
|
562
|
+
export interface TableMergeData {
|
|
563
|
+
startColumn: number;
|
|
564
|
+
startRow: number;
|
|
565
|
+
endColumn: number;
|
|
566
|
+
endRow: number;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* A table (PineScript table.new)
|
|
571
|
+
*/
|
|
572
|
+
export interface TableData {
|
|
573
|
+
position: TablePosition;
|
|
574
|
+
columns: number;
|
|
575
|
+
rows: number;
|
|
576
|
+
cells: TableCellData[];
|
|
577
|
+
merges?: TableMergeData[];
|
|
578
|
+
bgColor?: string;
|
|
579
|
+
frameColor?: string;
|
|
580
|
+
frameWidth?: number;
|
|
581
|
+
borderColor?: string;
|
|
582
|
+
borderWidth?: number;
|
|
583
|
+
/** PineScript force_overlay = true: the table of a non-overlay indicator is drawn on the price pane */
|
|
584
|
+
forceOverlay?: boolean;
|
|
585
|
+
}
|
|
586
|
+
|
|
304
587
|
/**
|
|
305
588
|
* Complete indicator calculation result
|
|
306
589
|
*/
|
|
@@ -318,9 +601,25 @@ export interface IndicatorResult {
|
|
|
318
601
|
/** Arrows from plotarrow() */
|
|
319
602
|
arrows?: ArrowData[];
|
|
320
603
|
/** Background colors from bgcolor() */
|
|
321
|
-
|
|
604
|
+
bgColors?: BgColorData[];
|
|
322
605
|
/** Bar colors from barcolor() */
|
|
323
|
-
|
|
606
|
+
barColors?: BarColorData[];
|
|
607
|
+
/** Candles from plotcandle(), keyed by plotcandle id */
|
|
608
|
+
plotCandles?: Record<string, PlotCandleData[]>;
|
|
609
|
+
/** OHLC bars from plotbar(), keyed by plotbar id */
|
|
610
|
+
plotBars?: Record<string, PlotBarData[]>;
|
|
611
|
+
/** Labels alive after the last bar */
|
|
612
|
+
labels?: LabelData[];
|
|
613
|
+
/** Lines alive after the last bar */
|
|
614
|
+
lines?: LineDrawingData[];
|
|
615
|
+
/** Boxes alive after the last bar */
|
|
616
|
+
boxes?: BoxData[];
|
|
617
|
+
/** Linefills alive after the last bar */
|
|
618
|
+
linefills?: LinefillData[];
|
|
619
|
+
/** Polylines alive after the last bar */
|
|
620
|
+
polylines?: PolylineData[];
|
|
621
|
+
/** Tables alive after the last bar */
|
|
622
|
+
tables?: TableData[];
|
|
324
623
|
}
|
|
325
624
|
|
|
326
625
|
/**
|