@363045841yyt/klinechart 0.6.10 → 0.7.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.
Files changed (53) hide show
  1. package/dist/favicon.ico +0 -0
  2. package/dist/index.cjs +5 -5
  3. package/dist/index.js +8404 -3629
  4. package/dist/klinechart.css +1 -1
  5. package/dist/mock-stock-data.json +1 -0
  6. package/dist/src/components/IndicatorSelector.vue.d.ts +0 -1
  7. package/dist/src/components/KLineChart.vue.d.ts +1 -1
  8. package/dist/src/config/chartSettings.d.ts +6 -0
  9. package/dist/src/core/chart.d.ts +7 -7
  10. package/dist/src/core/drawing/plugin.d.ts +19 -0
  11. package/dist/src/core/indicators/calculators.d.ts +129 -0
  12. package/dist/src/core/indicators/chaikinVolState.d.ts +18 -0
  13. package/dist/src/core/indicators/cmfState.d.ts +16 -0
  14. package/dist/src/core/indicators/fibState.d.ts +26 -0
  15. package/dist/src/core/indicators/hvState.d.ts +18 -0
  16. package/dist/src/core/indicators/ichimokuState.d.ts +44 -0
  17. package/dist/src/core/indicators/indicatorRuntime.d.ts +35 -0
  18. package/dist/src/core/indicators/mfiState.d.ts +16 -0
  19. package/dist/src/core/indicators/obvState.d.ts +14 -0
  20. package/dist/src/core/indicators/parkinsonState.d.ts +18 -0
  21. package/dist/src/core/indicators/pivotState.d.ts +29 -0
  22. package/dist/src/core/indicators/pvtState.d.ts +14 -0
  23. package/dist/src/core/indicators/rocState.d.ts +16 -0
  24. package/dist/src/core/indicators/scheduler.d.ts +56 -2
  25. package/dist/src/core/indicators/stateComposer.d.ts +51 -0
  26. package/dist/src/core/indicators/structureState.d.ts +43 -0
  27. package/dist/src/core/indicators/trixState.d.ts +20 -0
  28. package/dist/src/core/indicators/vmaState.d.ts +16 -0
  29. package/dist/src/core/indicators/volumeProfileState.d.ts +34 -0
  30. package/dist/src/core/indicators/vwapState.d.ts +16 -0
  31. package/dist/src/core/indicators/workerProtocol.d.ts +198 -1
  32. package/dist/src/core/indicators/zonesState.d.ts +26 -0
  33. package/dist/src/core/renderers/Indicator/chaikinVol.d.ts +4 -0
  34. package/dist/src/core/renderers/Indicator/cmf.d.ts +4 -0
  35. package/dist/src/core/renderers/Indicator/fib.d.ts +4 -0
  36. package/dist/src/core/renderers/Indicator/hv.d.ts +4 -0
  37. package/dist/src/core/renderers/Indicator/ichimoku.d.ts +5 -0
  38. package/dist/src/core/renderers/Indicator/index.d.ts +27 -1
  39. package/dist/src/core/renderers/Indicator/mfi.d.ts +4 -0
  40. package/dist/src/core/renderers/Indicator/obv.d.ts +4 -0
  41. package/dist/src/core/renderers/Indicator/parkinson.d.ts +4 -0
  42. package/dist/src/core/renderers/Indicator/pivot.d.ts +4 -0
  43. package/dist/src/core/renderers/Indicator/pvt.d.ts +4 -0
  44. package/dist/src/core/renderers/Indicator/roc.d.ts +5 -0
  45. package/dist/src/core/renderers/Indicator/structure.d.ts +4 -0
  46. package/dist/src/core/renderers/Indicator/subPaneConfig.d.ts +2 -2
  47. package/dist/src/core/renderers/Indicator/trix.d.ts +5 -0
  48. package/dist/src/core/renderers/Indicator/vma.d.ts +4 -0
  49. package/dist/src/core/renderers/Indicator/volumeProfile.d.ts +4 -0
  50. package/dist/src/core/renderers/Indicator/vwap.d.ts +4 -0
  51. package/dist/src/core/renderers/Indicator/zones.d.ts +4 -0
  52. package/dist/src/semantic/types.d.ts +59 -0
  53. package/package.json +1 -1
@@ -334,3 +334,132 @@ export interface DonchianPoint {
334
334
  export declare const DEFAULT_DONCHIAN_PERIOD = 20;
335
335
  export declare function calcDonchianData(data: KLineData[], period: number): (DonchianPoint | undefined)[];
336
336
  export declare function calcDonchianDataSoA(layout: KLineSoALayout, period: number): (DonchianPoint | undefined)[];
337
+ export interface IchimokuPoint {
338
+ tenkan?: number;
339
+ kijun?: number;
340
+ spanA?: number;
341
+ spanB?: number;
342
+ chikou?: number;
343
+ }
344
+ export declare const DEFAULT_ICHIMOKU_TENKAN = 9;
345
+ export declare const DEFAULT_ICHIMOKU_KIJUN = 26;
346
+ export declare const DEFAULT_ICHIMOKU_SPAN_B = 52;
347
+ export declare const DEFAULT_ICHIMOKU_DISPLACEMENT = 26;
348
+ export declare function calcIchimokuData(data: KLineData[], tenkanPeriod: number, kijunPeriod: number, spanBPeriod: number, displacement: number): (IchimokuPoint | undefined)[];
349
+ export declare function calcIchimokuDataSoA(layout: KLineSoALayout, tenkanPeriod: number, kijunPeriod: number, spanBPeriod: number, displacement: number): (IchimokuPoint | undefined)[];
350
+ export declare const DEFAULT_ROC_PERIOD = 12;
351
+ export declare function calcROCData(data: KLineData[], period: number): (number | undefined)[];
352
+ export declare function calcROCDataSoA(layout: KLineSoALayout, period: number): (number | undefined)[];
353
+ export interface TRIXResult {
354
+ series: (number | undefined)[];
355
+ signalSeries: (number | undefined)[];
356
+ }
357
+ export declare const DEFAULT_TRIX_PERIOD = 15;
358
+ export declare const DEFAULT_TRIX_SIGNAL_PERIOD = 9;
359
+ export declare function calcTRIXData(data: KLineData[], period: number, signalPeriod: number): TRIXResult;
360
+ export declare function calcTRIXDataSoA(layout: KLineSoALayout, period: number, signalPeriod: number): TRIXResult;
361
+ export declare const DEFAULT_HV_PERIOD = 20;
362
+ export declare const DEFAULT_HV_ANNUALIZATION = 252;
363
+ export declare function calcHVData(data: KLineData[], period: number, annualizationFactor: number): (number | undefined)[];
364
+ export declare function calcHVDataSoA(layout: KLineSoALayout, period: number, annualizationFactor: number): (number | undefined)[];
365
+ export declare const DEFAULT_PARKINSON_PERIOD = 20;
366
+ export declare const DEFAULT_PARKINSON_ANNUALIZATION = 252;
367
+ export declare function calcParkinsonData(data: KLineData[], period: number, annualizationFactor: number): (number | undefined)[];
368
+ export declare function calcParkinsonDataSoA(layout: KLineSoALayout, period: number, annualizationFactor: number): (number | undefined)[];
369
+ export declare const DEFAULT_CHAIKIN_VOL_EMA_PERIOD = 10;
370
+ export declare const DEFAULT_CHAIKIN_VOL_ROC_PERIOD = 10;
371
+ export declare function calcChaikinVolData(data: KLineData[], emaPeriod: number, rocPeriod: number): (number | undefined)[];
372
+ export declare function calcChaikinVolDataSoA(layout: KLineSoALayout, emaPeriod: number, rocPeriod: number): (number | undefined)[];
373
+ export declare const DEFAULT_VMA_PERIOD = 5;
374
+ export declare function calcVMAData(data: KLineData[], period: number): (number | undefined)[];
375
+ export declare function calcVMADataSoA(layout: KLineSoALayout, period: number): (number | undefined)[];
376
+ export declare function calcOBVData(data: KLineData[]): (number | undefined)[];
377
+ export declare function calcOBVDataSoA(layout: KLineSoALayout): (number | undefined)[];
378
+ export declare function calcPVTData(data: KLineData[]): (number | undefined)[];
379
+ export declare function calcPVTDataSoA(layout: KLineSoALayout): (number | undefined)[];
380
+ export declare const DEFAULT_VWAP_SESSION_GAP_MS = 0;
381
+ export declare function calcVWAPData(data: KLineData[], sessionResetGapMs: number): (number | undefined)[];
382
+ export declare function calcVWAPDataSoA(layout: KLineSoALayout, sessionResetGapMs: number): (number | undefined)[];
383
+ export declare const DEFAULT_CMF_PERIOD = 20;
384
+ export declare function calcCMFData(data: KLineData[], period: number): (number | undefined)[];
385
+ export declare function calcCMFDataSoA(layout: KLineSoALayout, period: number): (number | undefined)[];
386
+ export declare const DEFAULT_MFI_PERIOD = 14;
387
+ export declare function calcMFIData(data: KLineData[], period: number): (number | undefined)[];
388
+ export declare function calcMFIDataSoA(layout: KLineSoALayout, period: number): (number | undefined)[];
389
+ export interface PivotPoint {
390
+ pp: number;
391
+ r1: number;
392
+ r2: number;
393
+ r3: number;
394
+ s1: number;
395
+ s2: number;
396
+ s3: number;
397
+ }
398
+ export declare function calcPivotData(data: KLineData[]): (PivotPoint | undefined)[];
399
+ export declare function calcPivotDataSoA(layout: KLineSoALayout): (PivotPoint | undefined)[];
400
+ export interface FibPoint {
401
+ high: number;
402
+ low: number;
403
+ direction: 'up' | 'down';
404
+ level236: number;
405
+ level382: number;
406
+ level500: number;
407
+ level618: number;
408
+ level786: number;
409
+ }
410
+ export declare const DEFAULT_FIB_PERIOD = 50;
411
+ export declare function calcFibData(data: KLineData[], period: number): (FibPoint | undefined)[];
412
+ export declare function calcFibDataSoA(layout: KLineSoALayout, period: number): (FibPoint | undefined)[];
413
+ export interface SwingPoint {
414
+ index: number;
415
+ price: number;
416
+ kind: 'high' | 'low';
417
+ label: 'HH' | 'HL' | 'LH' | 'LL';
418
+ confirmed: boolean;
419
+ }
420
+ export type StructureEventKind = 'BOS' | 'CHOCH';
421
+ export interface StructureEvent {
422
+ kind: StructureEventKind;
423
+ index: number;
424
+ triggerPrice: number;
425
+ brokenLevel: number;
426
+ brokenSwingIndex: number;
427
+ direction: 'up' | 'down';
428
+ }
429
+ export interface StructureSnapshot {
430
+ swings: SwingPoint[];
431
+ events: StructureEvent[];
432
+ trend: 'up' | 'down' | 'range';
433
+ }
434
+ export declare const DEFAULT_STRUCTURE_LEFT = 2;
435
+ export declare const DEFAULT_STRUCTURE_RIGHT = 2;
436
+ export declare function calcStructureData(data: KLineData[], leftWindow: number, rightWindow: number, breakoutSource: 'close' | 'wick'): StructureSnapshot;
437
+ export declare function calcStructureDataSoA(layout: KLineSoALayout, leftWindow: number, rightWindow: number, breakoutSource: 'close' | 'wick'): StructureSnapshot;
438
+ export type ZoneKind = 'FVG_BULL' | 'FVG_BEAR' | 'OB_BULL' | 'OB_BEAR';
439
+ export interface Zone {
440
+ kind: ZoneKind;
441
+ startIndex: number;
442
+ endIndex?: number;
443
+ high: number;
444
+ low: number;
445
+ }
446
+ export declare const DEFAULT_ZONES_OB_LOOKBACK = 5;
447
+ export declare function calcZonesData(data: KLineData[], obLookback: number, structureLeftWindow: number, structureRightWindow: number, breakoutSource: 'close' | 'wick'): Zone[];
448
+ export declare function calcZonesDataSoA(layout: KLineSoALayout, obLookback: number, structureLeftWindow: number, structureRightWindow: number, breakoutSource: 'close' | 'wick'): Zone[];
449
+ export interface VolumeProfileBin {
450
+ priceLow: number;
451
+ priceHigh: number;
452
+ volume: number;
453
+ }
454
+ export interface VolumeProfileResult {
455
+ bins: VolumeProfileBin[];
456
+ poc: number;
457
+ vah: number;
458
+ val: number;
459
+ totalVolume: number;
460
+ }
461
+ export declare const DEFAULT_VP_BINS = 24;
462
+ export declare const DEFAULT_VP_LOOKBACK = 0;
463
+ export declare const DEFAULT_VP_VALUE_AREA = 0.7;
464
+ export declare function calcVolumeProfileData(data: KLineData[], bins: number, lookback: number, valueAreaPercent: number): VolumeProfileResult;
465
+ export declare function calcVolumeProfileDataSoA(layout: KLineSoALayout, bins: number, lookback: number, valueAreaPercent: number): VolumeProfileResult;
@@ -0,0 +1,18 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface ChaikinVolRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ emaPeriod: number;
7
+ rocPeriod: number;
8
+ showChaikinVol: boolean;
9
+ };
10
+ valueMin: number;
11
+ valueMax: number;
12
+ visibleMin: number;
13
+ visibleMax: number;
14
+ }
15
+ export declare const createChaikinVolStateKey: (paneId: string) => `indicator:${string}:${string}`;
16
+ export declare const DEFAULT_CHAIKIN_VOL_EMA_PERIOD = 10;
17
+ export declare const DEFAULT_CHAIKIN_VOL_ROC_PERIOD = 10;
18
+ export declare const EMPTY_CHAIKIN_VOL_STATE: ChaikinVolRenderState;
@@ -0,0 +1,16 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface CMFRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ period: number;
7
+ showCMF: boolean;
8
+ };
9
+ valueMin: number;
10
+ valueMax: number;
11
+ visibleMin: number;
12
+ visibleMax: number;
13
+ }
14
+ export declare const createCMFStateKey: (paneId: string) => `indicator:${string}:${string}`;
15
+ export declare const DEFAULT_CMF_PERIOD = 20;
16
+ export declare const EMPTY_CMF_STATE: CMFRenderState;
@@ -0,0 +1,26 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface FibPoint {
3
+ high: number;
4
+ low: number;
5
+ direction: 'up' | 'down';
6
+ level236: number;
7
+ level382: number;
8
+ level500: number;
9
+ level618: number;
10
+ level786: number;
11
+ }
12
+ export interface FibRenderState extends BaseIndicatorState {
13
+ timestamp: number;
14
+ series: (FibPoint | undefined)[];
15
+ params: {
16
+ period: number;
17
+ showLevels: boolean;
18
+ };
19
+ valueMin: number;
20
+ valueMax: number;
21
+ visibleMin: number;
22
+ visibleMax: number;
23
+ }
24
+ export declare const createFibStateKey: (paneId: string) => `indicator:${string}:${string}`;
25
+ export declare const DEFAULT_FIB_PERIOD = 50;
26
+ export declare const EMPTY_FIB_STATE: FibRenderState;
@@ -0,0 +1,18 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface HVRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ period: number;
7
+ annualizationFactor: number;
8
+ showHV: boolean;
9
+ };
10
+ valueMin: number;
11
+ valueMax: number;
12
+ visibleMin: number;
13
+ visibleMax: number;
14
+ }
15
+ export declare const createHVStateKey: (paneId: string) => `indicator:${string}:${string}`;
16
+ export declare const DEFAULT_HV_PERIOD = 20;
17
+ export declare const DEFAULT_HV_ANNUALIZATION = 252;
18
+ export declare const EMPTY_HV_STATE: HVRenderState;
@@ -0,0 +1,44 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ /**
3
+ * 一目均衡表数据点:5 条线在同一根 K 线槽位
4
+ * - tenkan (转换线) = (HH9 + LL9) / 2,当根 K 线计算
5
+ * - kijun (基准线) = (HH26 + LL26) / 2,当根 K 线计算
6
+ * - spanA (先行带 A) = (tenkan[t-displacement] + kijun[t-displacement]) / 2,前置位移
7
+ * - spanB (先行带 B) = (HH52[t-displacement] + LL52[t-displacement]) / 2,前置位移
8
+ * - chikou (迟行线) = close[t+displacement],后置位移
9
+ *
10
+ * 任一字段都可能 undefined(数据不足或位移外)。
11
+ */
12
+ export interface IchimokuPoint {
13
+ tenkan?: number;
14
+ kijun?: number;
15
+ spanA?: number;
16
+ spanB?: number;
17
+ chikou?: number;
18
+ }
19
+ export interface IchimokuRenderState extends BaseIndicatorState {
20
+ timestamp: number;
21
+ series: (IchimokuPoint | undefined)[];
22
+ params: {
23
+ tenkanPeriod: number;
24
+ kijunPeriod: number;
25
+ spanBPeriod: number;
26
+ displacement: number;
27
+ showTenkan: boolean;
28
+ showKijun: boolean;
29
+ showSpanA: boolean;
30
+ showSpanB: boolean;
31
+ showCloud: boolean;
32
+ showChikou: boolean;
33
+ };
34
+ valueMin: number;
35
+ valueMax: number;
36
+ visibleMin: number;
37
+ visibleMax: number;
38
+ }
39
+ export declare const createIchimokuStateKey: (paneId: string) => `indicator:${string}:${string}`;
40
+ export declare const DEFAULT_ICHIMOKU_TENKAN = 9;
41
+ export declare const DEFAULT_ICHIMOKU_KIJUN = 26;
42
+ export declare const DEFAULT_ICHIMOKU_SPAN_B = 52;
43
+ export declare const DEFAULT_ICHIMOKU_DISPLACEMENT = 26;
44
+ export declare const EMPTY_ICHIMOKU_STATE: IchimokuRenderState;
@@ -31,6 +31,24 @@ export declare class IndicatorRuntime {
31
31
  private cachedSupertrendSeries;
32
32
  private cachedKeltnerSeries;
33
33
  private cachedDonchianSeries;
34
+ private cachedIchimokuSeries;
35
+ private cachedRocSeries;
36
+ private cachedTrixSeries;
37
+ private cachedTrixSignalSeries;
38
+ private cachedHvSeries;
39
+ private cachedParkinsonSeries;
40
+ private cachedChaikinVolSeries;
41
+ private cachedVmaSeries;
42
+ private cachedObvSeries;
43
+ private cachedPvtSeries;
44
+ private cachedVwapSeries;
45
+ private cachedCmfSeries;
46
+ private cachedMfiSeries;
47
+ private cachedPivotSeries;
48
+ private cachedFibSeries;
49
+ private cachedStructureSeries;
50
+ private cachedZonesSeries;
51
+ private cachedVolumeProfileSeries;
34
52
  private dirtyData;
35
53
  private dirtyMAConfig;
36
54
  private dirtyBollConfig;
@@ -54,6 +72,23 @@ export declare class IndicatorRuntime {
54
72
  private dirtySupertrendConfig;
55
73
  private dirtyKeltnerConfig;
56
74
  private dirtyDonchianConfig;
75
+ private dirtyIchimokuConfig;
76
+ private dirtyRocConfig;
77
+ private dirtyTrixConfig;
78
+ private dirtyHvConfig;
79
+ private dirtyParkinsonConfig;
80
+ private dirtyChaikinVolConfig;
81
+ private dirtyVmaConfig;
82
+ private dirtyObvConfig;
83
+ private dirtyPvtConfig;
84
+ private dirtyVwapConfig;
85
+ private dirtyCmfConfig;
86
+ private dirtyMfiConfig;
87
+ private dirtyPivotConfig;
88
+ private dirtyFibConfig;
89
+ private dirtyStructureConfig;
90
+ private dirtyZonesConfig;
91
+ private dirtyVolumeProfileConfig;
57
92
  private getDefaultConfig;
58
93
  /**
59
94
  * 更新数据
@@ -0,0 +1,16 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface MFIRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ period: number;
7
+ showMFI: boolean;
8
+ };
9
+ valueMin: number;
10
+ valueMax: number;
11
+ visibleMin: number;
12
+ visibleMax: number;
13
+ }
14
+ export declare const createMFIStateKey: (paneId: string) => `indicator:${string}:${string}`;
15
+ export declare const DEFAULT_MFI_PERIOD = 14;
16
+ export declare const EMPTY_MFI_STATE: MFIRenderState;
@@ -0,0 +1,14 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface OBVRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ showOBV: boolean;
7
+ };
8
+ valueMin: number;
9
+ valueMax: number;
10
+ visibleMin: number;
11
+ visibleMax: number;
12
+ }
13
+ export declare const createOBVStateKey: (paneId: string) => `indicator:${string}:${string}`;
14
+ export declare const EMPTY_OBV_STATE: OBVRenderState;
@@ -0,0 +1,18 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface ParkinsonRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ period: number;
7
+ annualizationFactor: number;
8
+ showParkinson: boolean;
9
+ };
10
+ valueMin: number;
11
+ valueMax: number;
12
+ visibleMin: number;
13
+ visibleMax: number;
14
+ }
15
+ export declare const createParkinsonStateKey: (paneId: string) => `indicator:${string}:${string}`;
16
+ export declare const DEFAULT_PARKINSON_PERIOD = 20;
17
+ export declare const DEFAULT_PARKINSON_ANNUALIZATION = 252;
18
+ export declare const EMPTY_PARKINSON_STATE: ParkinsonRenderState;
@@ -0,0 +1,29 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface PivotPoint {
3
+ pp: number;
4
+ r1: number;
5
+ r2: number;
6
+ r3: number;
7
+ s1: number;
8
+ s2: number;
9
+ s3: number;
10
+ }
11
+ export interface PivotRenderState extends BaseIndicatorState {
12
+ timestamp: number;
13
+ series: (PivotPoint | undefined)[];
14
+ params: {
15
+ showPP: boolean;
16
+ showR1: boolean;
17
+ showR2: boolean;
18
+ showR3: boolean;
19
+ showS1: boolean;
20
+ showS2: boolean;
21
+ showS3: boolean;
22
+ };
23
+ valueMin: number;
24
+ valueMax: number;
25
+ visibleMin: number;
26
+ visibleMax: number;
27
+ }
28
+ export declare const createPivotStateKey: (paneId: string) => `indicator:${string}:${string}`;
29
+ export declare const EMPTY_PIVOT_STATE: PivotRenderState;
@@ -0,0 +1,14 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface PVTRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ showPVT: boolean;
7
+ };
8
+ valueMin: number;
9
+ valueMax: number;
10
+ visibleMin: number;
11
+ visibleMax: number;
12
+ }
13
+ export declare const createPVTStateKey: (paneId: string) => `indicator:${string}:${string}`;
14
+ export declare const EMPTY_PVT_STATE: PVTRenderState;
@@ -0,0 +1,16 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface ROCRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ period: number;
7
+ showROC: boolean;
8
+ };
9
+ valueMin: number;
10
+ valueMax: number;
11
+ visibleMin: number;
12
+ visibleMax: number;
13
+ }
14
+ export declare const createROCStateKey: (paneId: string) => `indicator:${string}:${string}`;
15
+ export declare const DEFAULT_ROC_PERIOD = 12;
16
+ export declare const EMPTY_ROC_STATE: ROCRenderState;
@@ -1,6 +1,6 @@
1
1
  import { PluginHost } from '../../plugin';
2
2
  import { KLineData } from '../../types/price';
3
- import { BOLLSchedulerConfig, EXPMASchedulerConfig, ENESchedulerConfig, RSISchedulerConfig, CCISchedulerConfig, STOCHSchedulerConfig, MOMSchedulerConfig, WMSRSchedulerConfig, KSTSchedulerConfig, FASTKSchedulerConfig, MACDSchedulerConfig, ATRSchedulerConfig, WMASchedulerConfig, DEMASchedulerConfig, TEMASchedulerConfig, HMASchedulerConfig, KAMASchedulerConfig, SARSchedulerConfig, SuperTrendSchedulerConfig, KeltnerSchedulerConfig, DonchianSchedulerConfig } from './workerProtocol';
3
+ import { BOLLSchedulerConfig, EXPMASchedulerConfig, ENESchedulerConfig, RSISchedulerConfig, CCISchedulerConfig, STOCHSchedulerConfig, MOMSchedulerConfig, WMSRSchedulerConfig, KSTSchedulerConfig, FASTKSchedulerConfig, MACDSchedulerConfig, ATRSchedulerConfig, WMASchedulerConfig, DEMASchedulerConfig, TEMASchedulerConfig, HMASchedulerConfig, KAMASchedulerConfig, SARSchedulerConfig, SuperTrendSchedulerConfig, KeltnerSchedulerConfig, DonchianSchedulerConfig, IchimokuSchedulerConfig, ROCSchedulerConfig, TRIXSchedulerConfig, HVSchedulerConfig, ParkinsonSchedulerConfig, ChaikinVolSchedulerConfig, VMASchedulerConfig, OBVSchedulerConfig, PVTSchedulerConfig, VWAPSchedulerConfig, CMFSchedulerConfig, MFISchedulerConfig, PivotSchedulerConfig, FibSchedulerConfig, StructureSchedulerConfig, ZonesSchedulerConfig, VolumeProfileSchedulerConfig } from './workerProtocol';
4
4
  import { MAFlags } from './calculators';
5
5
  /**
6
6
  * 可见范围
@@ -9,7 +9,7 @@ interface VisibleRange {
9
9
  start: number;
10
10
  end: number;
11
11
  }
12
- export type { BOLLSchedulerConfig, EXPMASchedulerConfig, ENESchedulerConfig, RSISchedulerConfig, CCISchedulerConfig, STOCHSchedulerConfig, MOMSchedulerConfig, WMSRSchedulerConfig, KSTSchedulerConfig, FASTKSchedulerConfig, MACDSchedulerConfig, ATRSchedulerConfig, WMASchedulerConfig, DEMASchedulerConfig, TEMASchedulerConfig, HMASchedulerConfig, KAMASchedulerConfig, SARSchedulerConfig, SuperTrendSchedulerConfig, KeltnerSchedulerConfig, DonchianSchedulerConfig, };
12
+ export type { BOLLSchedulerConfig, EXPMASchedulerConfig, ENESchedulerConfig, RSISchedulerConfig, CCISchedulerConfig, STOCHSchedulerConfig, MOMSchedulerConfig, WMSRSchedulerConfig, KSTSchedulerConfig, FASTKSchedulerConfig, MACDSchedulerConfig, ATRSchedulerConfig, WMASchedulerConfig, DEMASchedulerConfig, TEMASchedulerConfig, HMASchedulerConfig, KAMASchedulerConfig, SARSchedulerConfig, SuperTrendSchedulerConfig, KeltnerSchedulerConfig, DonchianSchedulerConfig, IchimokuSchedulerConfig, ROCSchedulerConfig, TRIXSchedulerConfig, HVSchedulerConfig, ParkinsonSchedulerConfig, ChaikinVolSchedulerConfig, VMASchedulerConfig, OBVSchedulerConfig, PVTSchedulerConfig, VWAPSchedulerConfig, CMFSchedulerConfig, MFISchedulerConfig, PivotSchedulerConfig, FibSchedulerConfig, StructureSchedulerConfig, ZonesSchedulerConfig, VolumeProfileSchedulerConfig, };
13
13
  /**
14
14
  * IndicatorScheduler - 主线程 facade
15
15
  */
@@ -162,6 +162,60 @@ export declare class IndicatorScheduler {
162
162
  * Donchian 配置变更
163
163
  */
164
164
  updateDonchianConfig(config: Partial<DonchianSchedulerConfig>, paneId?: string): void;
165
+ /**
166
+ * Ichimoku 配置变更
167
+ */
168
+ updateIchimokuConfig(config: Partial<IchimokuSchedulerConfig>, paneId?: string): void;
169
+ /**
170
+ * ROC 配置变更
171
+ */
172
+ updateROCConfig(config: Partial<ROCSchedulerConfig>, paneId?: string): void;
173
+ /**
174
+ * TRIX 配置变更
175
+ */
176
+ updateTRIXConfig(config: Partial<TRIXSchedulerConfig>, paneId?: string): void;
177
+ /**
178
+ * HV 配置变更
179
+ */
180
+ updateHVConfig(config: Partial<HVSchedulerConfig>, paneId?: string): void;
181
+ /**
182
+ * Parkinson 配置变更
183
+ */
184
+ updateParkinsonConfig(config: Partial<ParkinsonSchedulerConfig>, paneId?: string): void;
185
+ /**
186
+ * ChaikinVol 配置变更
187
+ */
188
+ updateChaikinVolConfig(config: Partial<ChaikinVolSchedulerConfig>, paneId?: string): void;
189
+ /**
190
+ * VMA 配置变更
191
+ */
192
+ updateVMAConfig(config: Partial<VMASchedulerConfig>, paneId?: string): void;
193
+ /**
194
+ * OBV 配置变更
195
+ */
196
+ updateOBVConfig(config: Partial<OBVSchedulerConfig>, paneId?: string): void;
197
+ /**
198
+ * PVT 配置变更
199
+ */
200
+ updatePVTConfig(config: Partial<PVTSchedulerConfig>, paneId?: string): void;
201
+ /**
202
+ * VWAP 配置变更
203
+ */
204
+ updateVWAPConfig(config: Partial<VWAPSchedulerConfig>, paneId?: string): void;
205
+ /** CMF 配置变更 */
206
+ updateCMFConfig(config: Partial<CMFSchedulerConfig>, paneId?: string): void;
207
+ /** MFI 配置变更 */
208
+ updateMFIConfig(config: Partial<MFISchedulerConfig>, paneId?: string): void;
209
+ /** Pivot 配置变更 */
210
+ updatePivotConfig(config: Partial<PivotSchedulerConfig>, paneId?: string): void;
211
+ /** Fib 配置变更 */
212
+ updateFibConfig(config: Partial<FibSchedulerConfig>, paneId?: string): void;
213
+ /** Structure 配置变更 */
214
+ updateStructureConfig(config: Partial<StructureSchedulerConfig>, paneId?: string): void;
215
+ /** Zones 配置变更 */
216
+ updateZonesConfig(config: Partial<ZonesSchedulerConfig>, paneId?: string): void;
217
+ /** Volume Profile 配置变更 */
218
+ updateVolumeProfileConfig(config: Partial<VolumeProfileSchedulerConfig>, paneId?: string): void;
165
219
  /**
166
220
  * 设置当前激活的主图指标
167
221
  */
@@ -20,6 +20,23 @@ import { SARRenderState } from './sarState';
20
20
  import { SuperTrendRenderState } from './supertrendState';
21
21
  import { KeltnerRenderState } from './keltnerState';
22
22
  import { DonchianRenderState } from './donchianState';
23
+ import { IchimokuRenderState } from './ichimokuState';
24
+ import { ROCRenderState } from './rocState';
25
+ import { TRIXRenderState } from './trixState';
26
+ import { HVRenderState } from './hvState';
27
+ import { ParkinsonRenderState } from './parkinsonState';
28
+ import { ChaikinVolRenderState } from './chaikinVolState';
29
+ import { VMARenderState } from './vmaState';
30
+ import { OBVRenderState } from './obvState';
31
+ import { PVTRenderState } from './pvtState';
32
+ import { VWAPRenderState } from './vwapState';
33
+ import { CMFRenderState } from './cmfState';
34
+ import { MFIRenderState } from './mfiState';
35
+ import { PivotRenderState } from './pivotState';
36
+ import { FibRenderState } from './fibState';
37
+ import { StructureRenderState } from './structureState';
38
+ import { ZonesRenderState } from './zonesState';
39
+ import { VolumeProfileRenderState } from './volumeProfileState';
23
40
  import { IndicatorSeriesBundle } from './workerProtocol';
24
41
  /**
25
42
  * 可见范围
@@ -47,6 +64,23 @@ type VisibleSubIndicatorStates = {
47
64
  supertrend: SuperTrendRenderState;
48
65
  keltner: KeltnerRenderState;
49
66
  donchian: DonchianRenderState;
67
+ ichimoku: IchimokuRenderState;
68
+ roc: ROCRenderState;
69
+ trix: TRIXRenderState;
70
+ hv: HVRenderState;
71
+ parkinson: ParkinsonRenderState;
72
+ chaikinVol: ChaikinVolRenderState;
73
+ vma: VMARenderState;
74
+ obv: OBVRenderState;
75
+ pvt: PVTRenderState;
76
+ vwap: VWAPRenderState;
77
+ cmf: CMFRenderState;
78
+ mfi: MFIRenderState;
79
+ pivot: PivotRenderState;
80
+ fib: FibRenderState;
81
+ structure: StructureRenderState;
82
+ zones: ZonesRenderState;
83
+ volumeProfile: VolumeProfileRenderState;
50
84
  };
51
85
  type VisibleSubIndicatorMask = {
52
86
  rsi?: boolean;
@@ -67,6 +101,23 @@ type VisibleSubIndicatorMask = {
67
101
  supertrend?: boolean;
68
102
  keltner?: boolean;
69
103
  donchian?: boolean;
104
+ ichimoku?: boolean;
105
+ roc?: boolean;
106
+ trix?: boolean;
107
+ hv?: boolean;
108
+ parkinson?: boolean;
109
+ chaikinVol?: boolean;
110
+ vma?: boolean;
111
+ obv?: boolean;
112
+ pvt?: boolean;
113
+ vwap?: boolean;
114
+ cmf?: boolean;
115
+ mfi?: boolean;
116
+ pivot?: boolean;
117
+ fib?: boolean;
118
+ structure?: boolean;
119
+ zones?: boolean;
120
+ volumeProfile?: boolean;
70
121
  };
71
122
  type ComposedRenderStates = VisibleSubIndicatorStates & {
72
123
  ma: MARenderState;
@@ -0,0 +1,43 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface SwingPoint {
3
+ index: number;
4
+ price: number;
5
+ kind: 'high' | 'low';
6
+ label: 'HH' | 'HL' | 'LH' | 'LL';
7
+ confirmed: boolean;
8
+ }
9
+ export type StructureEventKind = 'BOS' | 'CHOCH';
10
+ export interface StructureEvent {
11
+ kind: StructureEventKind;
12
+ index: number;
13
+ triggerPrice: number;
14
+ brokenLevel: number;
15
+ brokenSwingIndex: number;
16
+ direction: 'up' | 'down';
17
+ }
18
+ export interface StructureSnapshot {
19
+ swings: SwingPoint[];
20
+ events: StructureEvent[];
21
+ trend: 'up' | 'down' | 'range';
22
+ }
23
+ export interface StructureRenderState extends BaseIndicatorState {
24
+ timestamp: number;
25
+ series: StructureSnapshot;
26
+ params: {
27
+ leftWindow: number;
28
+ rightWindow: number;
29
+ breakoutSource: 'close' | 'wick';
30
+ showSwingLabels: boolean;
31
+ showBOS: boolean;
32
+ showCHOCH: boolean;
33
+ showProvisional: boolean;
34
+ };
35
+ valueMin: number;
36
+ valueMax: number;
37
+ visibleMin: number;
38
+ visibleMax: number;
39
+ }
40
+ export declare const createStructureStateKey: (paneId: string) => `indicator:${string}:${string}`;
41
+ export declare const DEFAULT_STRUCTURE_LEFT = 2;
42
+ export declare const DEFAULT_STRUCTURE_RIGHT = 2;
43
+ export declare const EMPTY_STRUCTURE_STATE: StructureRenderState;
@@ -0,0 +1,20 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface TRIXRenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ period: number;
7
+ signalPeriod: number;
8
+ showTRIX: boolean;
9
+ showSignal: boolean;
10
+ };
11
+ signalSeries: (number | undefined)[];
12
+ valueMin: number;
13
+ valueMax: number;
14
+ visibleMin: number;
15
+ visibleMax: number;
16
+ }
17
+ export declare const createTRIXStateKey: (paneId: string) => `indicator:${string}:${string}`;
18
+ export declare const DEFAULT_TRIX_PERIOD = 15;
19
+ export declare const DEFAULT_TRIX_SIGNAL_PERIOD = 9;
20
+ export declare const EMPTY_TRIX_STATE: TRIXRenderState;
@@ -0,0 +1,16 @@
1
+ import { BaseIndicatorState } from '../../plugin';
2
+ export interface VMARenderState extends BaseIndicatorState {
3
+ timestamp: number;
4
+ series: (number | undefined)[];
5
+ params: {
6
+ period: number;
7
+ showVMA: boolean;
8
+ };
9
+ valueMin: number;
10
+ valueMax: number;
11
+ visibleMin: number;
12
+ visibleMax: number;
13
+ }
14
+ export declare const createVMAStateKey: (paneId: string) => `indicator:${string}:${string}`;
15
+ export declare const DEFAULT_VMA_PERIOD = 5;
16
+ export declare const EMPTY_VMA_STATE: VMARenderState;