lightweight-charts-indicators 0.15.1 → 0.15.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/index.cjs CHANGED
@@ -1528,6 +1528,7 @@ __export(src_exports, {
1528
1528
  UptrickVolatilityReversionBands: () => UptrickVolatilityReversionBands,
1529
1529
  UserDefinedRangeSelector: () => UserDefinedRangeSelector,
1530
1530
  UtBotTrendVolume: () => UtBotTrendVolume,
1531
+ VALUE_FORMATS: () => VALUE_FORMATS,
1531
1532
  VPCI: () => VPCI,
1532
1533
  VWAP: () => VWAP,
1533
1534
  VWMA: () => VWMA,
@@ -48527,6 +48528,68 @@ function withReferenceNames(entry) {
48527
48528
  return { ...entry, name: title, shortName: shortTitle, metadata: { ...entry.metadata, title, shortTitle } };
48528
48529
  }
48529
48530
 
48531
+ // src/value-formats.ts
48532
+ var VALUE_FORMATS = {
48533
+ "24-hour-volume": { type: "volume" },
48534
+ "accumulation-distribution": { type: "volume" },
48535
+ "adr-bars": { type: "price", precision: 2 },
48536
+ "adx": { type: "price", precision: 2 },
48537
+ "aroon": { type: "percent", precision: 2 },
48538
+ "auto-key-levels": { type: "volume" },
48539
+ "bb-bandwidth": { type: "price", precision: 2 },
48540
+ "bb-percent-b": { type: "price", precision: 2 },
48541
+ "bop": { type: "price", precision: 2 },
48542
+ "cci": { type: "price", precision: 2 },
48543
+ "chaikin-mf": { type: "price", precision: 2 },
48544
+ "chaikin-osc": { type: "volume" },
48545
+ "chande-mo": { type: "price", precision: 2 },
48546
+ "chop-zone": { type: "price", precision: 0 },
48547
+ "choppiness": { type: "price", precision: 2 },
48548
+ "connors-rsi": { type: "price", precision: 2 },
48549
+ "correlation-coefficient": { type: "price", precision: 2 },
48550
+ "cvd": { type: "volume" },
48551
+ "dmi": { type: "price", precision: 4 },
48552
+ "dpo": { type: "price", precision: 2 },
48553
+ "elder-force": { type: "volume" },
48554
+ "eom": { type: "volume" },
48555
+ "fisher-transform": { type: "price", precision: 2 },
48556
+ "hist-volatility": { type: "price", precision: 2 },
48557
+ "klinger": { type: "volume" },
48558
+ "kst": { type: "price", precision: 4 },
48559
+ "mass-index": { type: "price", precision: 2 },
48560
+ "mfi": { type: "price", precision: 2 },
48561
+ "net-volume": { type: "volume" },
48562
+ "obv": { type: "volume" },
48563
+ "price-oscillator": { type: "percent", precision: 2 },
48564
+ "pvt": { type: "volume" },
48565
+ "rci": { type: "price", precision: 2 },
48566
+ "rci-ribbon": { type: "price", precision: 2 },
48567
+ "roc": { type: "price", precision: 2 },
48568
+ "rsi": { type: "price", precision: 2 },
48569
+ "rsi-divergence-indicator": { type: "price" },
48570
+ "rvi": { type: "price", precision: 4 },
48571
+ "rvol": { type: "price", precision: 2 },
48572
+ "smi-ergodic": { type: "price", precision: 4 },
48573
+ "smi-ergodic-osc": { type: "price", precision: 4 },
48574
+ "stoch": { type: "price", precision: 2 },
48575
+ "stoch-rsi": { type: "price", precision: 2 },
48576
+ "technicals": { type: "price", precision: 2 },
48577
+ "trend-strength": { type: "price", precision: 2 },
48578
+ "trix": { type: "price", precision: 2 },
48579
+ "tsi": { type: "price", precision: 4 },
48580
+ "ultimate-osc": { type: "price", precision: 2 },
48581
+ "up-down-volume": { type: "volume" },
48582
+ "volume-delta": { type: "volume" },
48583
+ "volume-osc": { type: "percent", precision: 2 },
48584
+ "vortex": { type: "price", precision: 4 },
48585
+ "williams-fractals": { type: "price", precision: 0 },
48586
+ "williams-r": { type: "price", precision: 2 }
48587
+ };
48588
+ function withValueFormat(entry) {
48589
+ const f = VALUE_FORMATS[entry.id];
48590
+ return f && !entry.format ? { ...entry, format: f } : entry;
48591
+ }
48592
+
48530
48593
  // src/standard/aroon-oscillator.ts
48531
48594
  var defaultInputs403 = {
48532
48595
  length: 14
@@ -49107,7 +49170,7 @@ function calculate410(bars, inputs = {}, chart) {
49107
49170
  var outputs4 = [
49108
49171
  { kind: "plot", id: "plot0" },
49109
49172
  { kind: "plot", id: "plot1" },
49110
- { kind: "char", id: "delta", title: "Chars" }
49173
+ { kind: "char", id: "delta", title: "delta" }
49111
49174
  ];
49112
49175
  var UpDownVolume = {
49113
49176
  calculate: calculate410,
@@ -325386,5 +325449,5 @@ var registryPart11 = [
325386
325449
  calculate: calculate435
325387
325450
  }
325388
325451
  ];
325389
- var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10].map(withReferenceNames);
325390
- var version = "0.15.1";
325452
+ var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10].map(withReferenceNames).map(withValueFormat);
325453
+ var version = "0.15.3";
package/dist/index.d.ts CHANGED
@@ -729,6 +729,7 @@ export type { RealtimeVolumeBarsInputs } from './community/realtime-volume-bars'
729
729
  export type { VolumaticSRLevelsInputs } from './community/volumatic-sr-levels';
730
730
  export type { VwapMvwapEmaCrossoverInputs } from './community/vwap-mvwap-ema-crossover';
731
731
  export type { VolumeFootprintInputs } from './community/volume-footprint';
732
+ export { VALUE_FORMATS, type StudyFormat } from './value-formats';
732
733
  export { REFERENCE_NAMES } from './reference-names';
733
734
  export { candlestickPortIndicators, candlestickPortEntries, candlestickPortAllPatterns } from './candlestick-port/adapter';
734
735
  export declare const Hammer: import("./candlestick-port/adapter").PortIndicator;
@@ -3343,6 +3344,8 @@ export interface IndicatorRegistryEntry {
3343
3344
  * the result's `outputValues`. Unset: its line plots in plotConfig order.
3344
3345
  */
3345
3346
  outputs?: import('./types').OutputDecl[];
3347
+ /** Format of its values (reference metaInfo format); unset: the symbol's price format. */
3348
+ format?: import('./value-formats').StudyFormat;
3346
3349
  defaultInputs: Record<string, unknown>;
3347
3350
  /**
3348
3351
  * True when the output depends on the bars visible on the chart (`leftVisibleBarTime` / `rightVisibleBarTime` of
@@ -3377,5 +3380,5 @@ export type { ChartContext, VisibleRange, SymbolRequest, SymbolInfo } from './ch
3377
3380
  export { MissingSymbolDataError, symbolBarsOf } from './chart-context';
3378
3381
  export { mintickOf, timezoneOf, tickeridOf, tickerOf, symbolTypeOf, currencyOf, basecurrencyOf, rootOf, foregroundColorOf, backgroundColorOf, lastBarConfirmedOf, nowOf, visibleRangeOf, } from './chart-context';
3379
3382
  export { securityOther, securityOtherValues, securityLowerTf, otherSymbolChart, spreadSymbols, spreadBars, spreadOptions, type OtherSymbolOptions, type OtherSymbolChart, type SymbolCalendar, } from './other-symbol';
3380
- export declare const version = "0.15.1";
3383
+ export declare const version = "0.15.3";
3381
3384
  //# sourceMappingURL=index.d.ts.map