@363045841yyt/klinechart 0.6.10 → 0.7.1
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/favicon.ico +0 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +20330 -8582
- package/dist/klinechart.css +1 -1
- package/dist/mock-stock-data.json +1 -0
- package/dist/src/components/IndicatorSelector.vue.d.ts +0 -1
- package/dist/src/components/KLineChart.vue.d.ts +1 -1
- package/dist/src/config/chartSettings.d.ts +6 -0
- package/dist/src/core/chart.d.ts +208 -11
- package/dist/src/core/draw/pixelAlign.d.ts +7 -7
- package/dist/src/core/drawing/plugin.d.ts +19 -0
- package/dist/src/core/indicators/calculators.d.ts +129 -0
- package/dist/src/core/indicators/chaikinVolState.d.ts +18 -0
- package/dist/src/core/indicators/cmfState.d.ts +16 -0
- package/dist/src/core/indicators/fibState.d.ts +26 -0
- package/dist/src/core/indicators/hvState.d.ts +18 -0
- package/dist/src/core/indicators/ichimokuState.d.ts +44 -0
- package/dist/src/core/indicators/indicatorDefinitionRegistry.d.ts +30 -0
- package/dist/src/core/indicators/indicatorMetadata.d.ts +81 -0
- package/dist/src/core/indicators/indicatorRegistry.d.ts +57 -0
- package/dist/src/core/indicators/indicatorRuntime.d.ts +35 -0
- package/dist/src/core/indicators/mfiState.d.ts +16 -0
- package/dist/src/core/indicators/obvState.d.ts +14 -0
- package/dist/src/core/indicators/parkinsonState.d.ts +18 -0
- package/dist/src/core/indicators/pivotState.d.ts +29 -0
- package/dist/src/core/indicators/pvtState.d.ts +14 -0
- package/dist/src/core/indicators/rocState.d.ts +16 -0
- package/dist/src/core/indicators/rsiState.d.ts +4 -0
- package/dist/src/core/indicators/scheduler.d.ts +82 -3
- package/dist/src/core/indicators/stateComposer.d.ts +51 -0
- package/dist/src/core/indicators/structureState.d.ts +43 -0
- package/dist/src/core/indicators/trixState.d.ts +20 -0
- package/dist/src/core/indicators/vmaState.d.ts +16 -0
- package/dist/src/core/indicators/volumeProfileState.d.ts +34 -0
- package/dist/src/core/indicators/vwapState.d.ts +16 -0
- package/dist/src/core/indicators/workerProtocol.d.ts +198 -1
- package/dist/src/core/indicators/zonesState.d.ts +26 -0
- package/dist/src/core/renderers/Indicator/cci.d.ts +2 -1
- package/dist/src/core/renderers/Indicator/chaikinVol.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/cmf.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/ene.d.ts +0 -8
- package/dist/src/core/renderers/Indicator/fastk.d.ts +2 -1
- package/dist/src/core/renderers/Indicator/fib.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/hv.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/ichimoku.d.ts +5 -0
- package/dist/src/core/renderers/Indicator/index.d.ts +27 -1
- package/dist/src/core/renderers/Indicator/kst.d.ts +2 -1
- package/dist/src/core/renderers/Indicator/macd.d.ts +2 -1
- package/dist/src/core/renderers/Indicator/mfi.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/mom.d.ts +2 -1
- package/dist/src/core/renderers/Indicator/obv.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/parkinson.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/pivot.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/pvt.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/roc.d.ts +5 -0
- package/dist/src/core/renderers/Indicator/rsi.d.ts +3 -2
- package/dist/src/core/renderers/Indicator/scale/indicator_scale.d.ts +4 -1
- package/dist/src/core/renderers/Indicator/stoch.d.ts +2 -1
- package/dist/src/core/renderers/Indicator/structure.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/subPaneConfig.d.ts +2 -2
- package/dist/src/core/renderers/Indicator/trix.d.ts +5 -0
- package/dist/src/core/renderers/Indicator/vma.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/volumeProfile.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/vwap.d.ts +4 -0
- package/dist/src/core/renderers/Indicator/wmsr.d.ts +2 -1
- package/dist/src/core/renderers/Indicator/zones.d.ts +4 -0
- package/dist/src/core/renderers/candle.d.ts +2 -1
- package/dist/src/core/theme/colors.d.ts +207 -228
- package/dist/src/plugin/PluginHost.d.ts +3 -0
- package/dist/src/plugin/types.d.ts +6 -0
- package/dist/src/semantic/types.d.ts +59 -0
- package/dist/src/utils/kLineDraw/MA.d.ts +5 -10
- package/dist/src/utils/kLineDraw/axis.d.ts +7 -7
- package/dist/src/utils/kLineDraw/grid.d.ts +2 -2
- package/dist/src/utils/kLineDraw/kLine.d.ts +1 -1
- package/dist/src/utils/kline/format.d.ts +4 -7
- package/package.json +111 -103
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KLineData } from '../../types/price';
|
|
2
|
-
import { MAFlags, BOLLPoint, EXPMAPoint, ENEPoint, STOCHPoint, KSTPoint, MACDPoint, SARPoint, SuperTrendPoint, KeltnerPoint, DonchianPoint } from './calculators';
|
|
2
|
+
import { MAFlags, BOLLPoint, EXPMAPoint, ENEPoint, STOCHPoint, KSTPoint, MACDPoint, SARPoint, SuperTrendPoint, KeltnerPoint, DonchianPoint, IchimokuPoint, PivotPoint, FibPoint, StructureSnapshot, Zone, VolumeProfileResult } from './calculators';
|
|
3
3
|
export interface BOLLSchedulerConfig {
|
|
4
4
|
period: number;
|
|
5
5
|
multiplier: number;
|
|
@@ -113,6 +113,100 @@ export interface DonchianSchedulerConfig {
|
|
|
113
113
|
showMiddle: boolean;
|
|
114
114
|
showLower: boolean;
|
|
115
115
|
}
|
|
116
|
+
export interface IchimokuSchedulerConfig {
|
|
117
|
+
tenkanPeriod: number;
|
|
118
|
+
kijunPeriod: number;
|
|
119
|
+
spanBPeriod: number;
|
|
120
|
+
displacement: number;
|
|
121
|
+
showTenkan: boolean;
|
|
122
|
+
showKijun: boolean;
|
|
123
|
+
showSpanA: boolean;
|
|
124
|
+
showSpanB: boolean;
|
|
125
|
+
showCloud: boolean;
|
|
126
|
+
showChikou: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface ROCSchedulerConfig {
|
|
129
|
+
period: number;
|
|
130
|
+
showROC: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface TRIXSchedulerConfig {
|
|
133
|
+
period: number;
|
|
134
|
+
signalPeriod: number;
|
|
135
|
+
showTRIX: boolean;
|
|
136
|
+
showSignal: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface HVSchedulerConfig {
|
|
139
|
+
period: number;
|
|
140
|
+
annualizationFactor: number;
|
|
141
|
+
showHV: boolean;
|
|
142
|
+
}
|
|
143
|
+
export interface ParkinsonSchedulerConfig {
|
|
144
|
+
period: number;
|
|
145
|
+
annualizationFactor: number;
|
|
146
|
+
showParkinson: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface ChaikinVolSchedulerConfig {
|
|
149
|
+
emaPeriod: number;
|
|
150
|
+
rocPeriod: number;
|
|
151
|
+
showChaikinVol: boolean;
|
|
152
|
+
}
|
|
153
|
+
export interface VMASchedulerConfig {
|
|
154
|
+
period: number;
|
|
155
|
+
showVMA: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface OBVSchedulerConfig {
|
|
158
|
+
showOBV: boolean;
|
|
159
|
+
}
|
|
160
|
+
export interface PVTSchedulerConfig {
|
|
161
|
+
showPVT: boolean;
|
|
162
|
+
}
|
|
163
|
+
export interface VWAPSchedulerConfig {
|
|
164
|
+
sessionResetGapMs: number;
|
|
165
|
+
showVWAP: boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface CMFSchedulerConfig {
|
|
168
|
+
period: number;
|
|
169
|
+
showCMF: boolean;
|
|
170
|
+
}
|
|
171
|
+
export interface MFISchedulerConfig {
|
|
172
|
+
period: number;
|
|
173
|
+
showMFI: boolean;
|
|
174
|
+
}
|
|
175
|
+
export interface PivotSchedulerConfig {
|
|
176
|
+
showPP: boolean;
|
|
177
|
+
showR1: boolean;
|
|
178
|
+
showR2: boolean;
|
|
179
|
+
showR3: boolean;
|
|
180
|
+
showS1: boolean;
|
|
181
|
+
showS2: boolean;
|
|
182
|
+
showS3: boolean;
|
|
183
|
+
}
|
|
184
|
+
export interface FibSchedulerConfig {
|
|
185
|
+
period: number;
|
|
186
|
+
showLevels: boolean;
|
|
187
|
+
}
|
|
188
|
+
export interface StructureSchedulerConfig {
|
|
189
|
+
leftWindow: number;
|
|
190
|
+
rightWindow: number;
|
|
191
|
+
breakoutSource: 'close' | 'wick';
|
|
192
|
+
showSwingLabels: boolean;
|
|
193
|
+
showBOS: boolean;
|
|
194
|
+
showCHOCH: boolean;
|
|
195
|
+
showProvisional: boolean;
|
|
196
|
+
}
|
|
197
|
+
export interface ZonesSchedulerConfig {
|
|
198
|
+
showFVG: boolean;
|
|
199
|
+
showOB: boolean;
|
|
200
|
+
showFilledZones: boolean;
|
|
201
|
+
obLookback: number;
|
|
202
|
+
}
|
|
203
|
+
export interface VolumeProfileSchedulerConfig {
|
|
204
|
+
bins: number;
|
|
205
|
+
lookback: number;
|
|
206
|
+
valueAreaPercent: number;
|
|
207
|
+
showPOC: boolean;
|
|
208
|
+
showValueArea: boolean;
|
|
209
|
+
}
|
|
116
210
|
export interface InitRequest {
|
|
117
211
|
type: 'init';
|
|
118
212
|
protocolVersion: number;
|
|
@@ -183,6 +277,23 @@ export interface IndicatorConfigSnapshot {
|
|
|
183
277
|
supertrend: SuperTrendSchedulerConfig;
|
|
184
278
|
keltner: KeltnerSchedulerConfig;
|
|
185
279
|
donchian: DonchianSchedulerConfig;
|
|
280
|
+
ichimoku: IchimokuSchedulerConfig;
|
|
281
|
+
roc: ROCSchedulerConfig;
|
|
282
|
+
trix: TRIXSchedulerConfig;
|
|
283
|
+
hv: HVSchedulerConfig;
|
|
284
|
+
parkinson: ParkinsonSchedulerConfig;
|
|
285
|
+
chaikinVol: ChaikinVolSchedulerConfig;
|
|
286
|
+
vma: VMASchedulerConfig;
|
|
287
|
+
obv: OBVSchedulerConfig;
|
|
288
|
+
pvt: PVTSchedulerConfig;
|
|
289
|
+
vwap: VWAPSchedulerConfig;
|
|
290
|
+
cmf: CMFSchedulerConfig;
|
|
291
|
+
mfi: MFISchedulerConfig;
|
|
292
|
+
pivot: PivotSchedulerConfig;
|
|
293
|
+
fib: FibSchedulerConfig;
|
|
294
|
+
structure: StructureSchedulerConfig;
|
|
295
|
+
zones: ZonesSchedulerConfig;
|
|
296
|
+
volumeProfile: VolumeProfileSchedulerConfig;
|
|
186
297
|
rsiPaneId: string;
|
|
187
298
|
cciPaneId: string;
|
|
188
299
|
stochPaneId: string;
|
|
@@ -201,6 +312,23 @@ export interface IndicatorConfigSnapshot {
|
|
|
201
312
|
supertrendPaneId: string;
|
|
202
313
|
keltnerPaneId: string;
|
|
203
314
|
donchianPaneId: string;
|
|
315
|
+
ichimokuPaneId: string;
|
|
316
|
+
rocPaneId: string;
|
|
317
|
+
trixPaneId: string;
|
|
318
|
+
hvPaneId: string;
|
|
319
|
+
parkinsonPaneId: string;
|
|
320
|
+
chaikinVolPaneId: string;
|
|
321
|
+
vmaPaneId: string;
|
|
322
|
+
obvPaneId: string;
|
|
323
|
+
pvtPaneId: string;
|
|
324
|
+
vwapPaneId: string;
|
|
325
|
+
cmfPaneId: string;
|
|
326
|
+
mfiPaneId: string;
|
|
327
|
+
pivotPaneId: string;
|
|
328
|
+
fibPaneId: string;
|
|
329
|
+
structurePaneId: string;
|
|
330
|
+
zonesPaneId: string;
|
|
331
|
+
volumeProfilePaneId: string;
|
|
204
332
|
}
|
|
205
333
|
export interface IndicatorSeriesBundle {
|
|
206
334
|
ma: {
|
|
@@ -292,6 +420,75 @@ export interface IndicatorSeriesBundle {
|
|
|
292
420
|
series: (DonchianPoint | undefined)[];
|
|
293
421
|
params: DonchianSchedulerConfig;
|
|
294
422
|
};
|
|
423
|
+
ichimoku: {
|
|
424
|
+
series: (IchimokuPoint | undefined)[];
|
|
425
|
+
params: IchimokuSchedulerConfig;
|
|
426
|
+
};
|
|
427
|
+
roc: {
|
|
428
|
+
series: (number | undefined)[];
|
|
429
|
+
params: ROCSchedulerConfig;
|
|
430
|
+
};
|
|
431
|
+
trix: {
|
|
432
|
+
series: (number | undefined)[];
|
|
433
|
+
signalSeries: (number | undefined)[];
|
|
434
|
+
params: TRIXSchedulerConfig;
|
|
435
|
+
};
|
|
436
|
+
hv: {
|
|
437
|
+
series: (number | undefined)[];
|
|
438
|
+
params: HVSchedulerConfig;
|
|
439
|
+
};
|
|
440
|
+
parkinson: {
|
|
441
|
+
series: (number | undefined)[];
|
|
442
|
+
params: ParkinsonSchedulerConfig;
|
|
443
|
+
};
|
|
444
|
+
chaikinVol: {
|
|
445
|
+
series: (number | undefined)[];
|
|
446
|
+
params: ChaikinVolSchedulerConfig;
|
|
447
|
+
};
|
|
448
|
+
vma: {
|
|
449
|
+
series: (number | undefined)[];
|
|
450
|
+
params: VMASchedulerConfig;
|
|
451
|
+
};
|
|
452
|
+
obv: {
|
|
453
|
+
series: (number | undefined)[];
|
|
454
|
+
params: OBVSchedulerConfig;
|
|
455
|
+
};
|
|
456
|
+
pvt: {
|
|
457
|
+
series: (number | undefined)[];
|
|
458
|
+
params: PVTSchedulerConfig;
|
|
459
|
+
};
|
|
460
|
+
vwap: {
|
|
461
|
+
series: (number | undefined)[];
|
|
462
|
+
params: VWAPSchedulerConfig;
|
|
463
|
+
};
|
|
464
|
+
cmf: {
|
|
465
|
+
series: (number | undefined)[];
|
|
466
|
+
params: CMFSchedulerConfig;
|
|
467
|
+
};
|
|
468
|
+
mfi: {
|
|
469
|
+
series: (number | undefined)[];
|
|
470
|
+
params: MFISchedulerConfig;
|
|
471
|
+
};
|
|
472
|
+
pivot: {
|
|
473
|
+
series: (PivotPoint | undefined)[];
|
|
474
|
+
params: PivotSchedulerConfig;
|
|
475
|
+
};
|
|
476
|
+
fib: {
|
|
477
|
+
series: (FibPoint | undefined)[];
|
|
478
|
+
params: FibSchedulerConfig;
|
|
479
|
+
};
|
|
480
|
+
structure: {
|
|
481
|
+
series: StructureSnapshot;
|
|
482
|
+
params: StructureSchedulerConfig;
|
|
483
|
+
};
|
|
484
|
+
zones: {
|
|
485
|
+
series: Zone[];
|
|
486
|
+
params: ZonesSchedulerConfig;
|
|
487
|
+
};
|
|
488
|
+
volumeProfile: {
|
|
489
|
+
series: VolumeProfileResult;
|
|
490
|
+
params: VolumeProfileSchedulerConfig;
|
|
491
|
+
};
|
|
295
492
|
/** 本次计算中实际变更的指标列表 */
|
|
296
493
|
_changed: string[];
|
|
297
494
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseIndicatorState } from '../../plugin';
|
|
2
|
+
export type ZoneKind = 'FVG_BULL' | 'FVG_BEAR' | 'OB_BULL' | 'OB_BEAR';
|
|
3
|
+
export interface Zone {
|
|
4
|
+
kind: ZoneKind;
|
|
5
|
+
startIndex: number;
|
|
6
|
+
endIndex?: number;
|
|
7
|
+
high: number;
|
|
8
|
+
low: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ZonesRenderState extends BaseIndicatorState {
|
|
11
|
+
timestamp: number;
|
|
12
|
+
series: Zone[];
|
|
13
|
+
params: {
|
|
14
|
+
showFVG: boolean;
|
|
15
|
+
showOB: boolean;
|
|
16
|
+
showFilledZones: boolean;
|
|
17
|
+
obLookback: number;
|
|
18
|
+
};
|
|
19
|
+
valueMin: number;
|
|
20
|
+
valueMax: number;
|
|
21
|
+
visibleMin: number;
|
|
22
|
+
visibleMax: number;
|
|
23
|
+
}
|
|
24
|
+
export declare const createZonesStateKey: (paneId: string) => `indicator:${string}:${string}`;
|
|
25
|
+
export declare const DEFAULT_ZONES_OB_LOOKBACK = 5;
|
|
26
|
+
export declare const EMPTY_ZONES_STATE: ZonesRenderState;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
|
+
import { ChartTheme } from '../../theme/colors';
|
|
2
3
|
export interface CCIRendererOptions {
|
|
3
4
|
/** 目标 pane ID(默认 'sub') */
|
|
4
5
|
paneId?: string;
|
|
@@ -10,7 +11,7 @@ export declare function createCCIRendererPlugin(options?: CCIRendererOptions): R
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取 CCI 标题信息(供 paneTitle 使用)
|
|
12
13
|
*/
|
|
13
|
-
export declare function getCCITitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string): {
|
|
14
|
+
export declare function getCCITitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
14
15
|
name: string;
|
|
15
16
|
params: number[];
|
|
16
17
|
values: Array<{
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { RendererPluginWithHost } from '../../../plugin';
|
|
2
|
-
/** 创建 ENE(轨道线)渲染器插件(无状态版本)
|
|
3
|
-
*
|
|
4
|
-
* 设计原则:
|
|
5
|
-
* 1. 不持有任何计算缓存或配置状态
|
|
6
|
-
* 2. 所有数据从 StateStore 读取(通过 ENE_STATE_KEY)
|
|
7
|
-
* 3. 配置变更通过外部 IndicatorScheduler 处理
|
|
8
|
-
* 4. 纯绘制函数,无副作用
|
|
9
|
-
*/
|
|
10
2
|
export declare function createENERendererPlugin(): RendererPluginWithHost;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
|
+
import { ChartTheme } from '../../theme/colors';
|
|
2
3
|
export interface FASTKRendererOptions {
|
|
3
4
|
/** 目标 pane ID(默认 'sub') */
|
|
4
5
|
paneId?: string;
|
|
@@ -10,7 +11,7 @@ export declare function createFASTKRendererPlugin(options?: FASTKRendererOptions
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取 FASTK 标题信息(供 paneTitle 使用)
|
|
12
13
|
*/
|
|
13
|
-
export declare function getFASTKTitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string): {
|
|
14
|
+
export declare function getFASTKTitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
14
15
|
name: string;
|
|
15
16
|
params: number[];
|
|
16
17
|
values: Array<{
|
|
@@ -14,10 +14,36 @@ export { createWMSRRendererPlugin, type WMSRRendererOptions, getWMSRTitleInfo }
|
|
|
14
14
|
export { createKSTRendererPlugin, type KSTRendererOptions, getKSTTitleInfo } from './kst';
|
|
15
15
|
export { createFASTKRendererPlugin, type FASTKRendererOptions, getFASTKTitleInfo } from './fastk';
|
|
16
16
|
export { createATRRendererPlugin, type ATRRendererOptions, getATRTitleInfo } from './atr';
|
|
17
|
+
export { createWMARendererPlugin } from './wma';
|
|
18
|
+
export { createDEMARendererPlugin } from './dema';
|
|
19
|
+
export { createTEMARendererPlugin } from './tema';
|
|
20
|
+
export { createHMARendererPlugin } from './hma';
|
|
21
|
+
export { createKAMARendererPlugin } from './kama';
|
|
22
|
+
export { createSARRendererPlugin } from './sar';
|
|
23
|
+
export { createSuperTrendRendererPlugin } from './supertrend';
|
|
24
|
+
export { createKeltnerRendererPlugin } from './keltner';
|
|
25
|
+
export { createDonchianRendererPlugin } from './donchian';
|
|
26
|
+
export { createIchimokuRendererPlugin } from './ichimoku';
|
|
27
|
+
export { createROCRendererPlugin } from './roc';
|
|
28
|
+
export { createTRIXRendererPlugin } from './trix';
|
|
29
|
+
export { createHVRendererPlugin } from './hv';
|
|
30
|
+
export { createParkinsonRendererPlugin } from './parkinson';
|
|
31
|
+
export { createChaikinVolRendererPlugin } from './chaikinVol';
|
|
32
|
+
export { createVMARendererPlugin } from './vma';
|
|
33
|
+
export { createOBVRendererPlugin } from './obv';
|
|
34
|
+
export { createPVTRendererPlugin } from './pvt';
|
|
35
|
+
export { createVWAPRendererPlugin } from './vwap';
|
|
36
|
+
export { createCMFRendererPlugin } from './cmf';
|
|
37
|
+
export { createMFIRendererPlugin } from './mfi';
|
|
38
|
+
export { createPivotRendererPlugin } from './pivot';
|
|
39
|
+
export { createFibRendererPlugin } from './fib';
|
|
40
|
+
export { createStructureRendererPlugin } from './structure';
|
|
41
|
+
export { createZonesRendererPlugin } from './zones';
|
|
42
|
+
export { createVolumeProfileRendererPlugin } from './volumeProfile';
|
|
17
43
|
/**
|
|
18
44
|
* 副图指标类型
|
|
19
45
|
*/
|
|
20
|
-
export type SubIndicatorType = 'VOLUME' | 'MACD' | 'RSI' | 'CCI' | 'STOCH' | 'MOM' | 'WMSR' | 'KST' | 'FASTK' | 'ATR';
|
|
46
|
+
export type SubIndicatorType = 'VOLUME' | 'MACD' | 'RSI' | 'CCI' | 'STOCH' | 'MOM' | 'WMSR' | 'KST' | 'FASTK' | 'ATR' | 'WMA' | 'DEMA' | 'TEMA' | 'HMA' | 'KAMA' | 'SAR' | 'SUPERTREND' | 'KELTNER' | 'DONCHIAN' | 'ICHIMOKU' | 'ROC' | 'TRIX' | 'HV' | 'PARKINSON' | 'CHAIKIN_VOL' | 'VMA' | 'OBV' | 'PVT' | 'VWAP' | 'CMF' | 'MFI' | 'PIVOT' | 'FIB' | 'STRUCTURE' | 'ZONES' | 'VOLUME_PROFILE';
|
|
21
47
|
/**
|
|
22
48
|
* 渲染器工厂选项
|
|
23
49
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
|
+
import { ChartTheme } from '../../theme/colors';
|
|
2
3
|
export interface KSTRendererOptions {
|
|
3
4
|
/** 目标 pane ID(默认 'sub') */
|
|
4
5
|
paneId?: string;
|
|
@@ -10,7 +11,7 @@ export declare function createKSTRendererPlugin(options?: KSTRendererOptions): R
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取 KST 标题信息(供 paneTitle 使用)
|
|
12
13
|
*/
|
|
13
|
-
export declare function getKSTTitleInfo(index: number, roc1: number, roc2: number, roc3: number, roc4: number, signalPeriod: number, pluginHost: PluginHost, paneId?: string): {
|
|
14
|
+
export declare function getKSTTitleInfo(index: number, roc1: number, roc2: number, roc3: number, roc4: number, signalPeriod: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
14
15
|
name: string;
|
|
15
16
|
params: number[];
|
|
16
17
|
values: Array<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
2
|
import { KLineData } from '../../../types/price';
|
|
3
|
+
import { ChartTheme } from '../../theme/colors';
|
|
3
4
|
export interface MACDConfig {
|
|
4
5
|
/** 快线周期(默认 12) */
|
|
5
6
|
fastPeriod?: number;
|
|
@@ -38,7 +39,7 @@ export declare function calcMACDAtIndex(data: KLineData[], index: number, fastPe
|
|
|
38
39
|
* 获取 MACD 标题信息(供 paneTitle 使用)
|
|
39
40
|
* 从 pluginHost 获取已计算好的数据,避免重复计算
|
|
40
41
|
*/
|
|
41
|
-
export declare function getMACDTitleInfo(index: number, fastPeriod: number, slowPeriod: number, signalPeriod: number, pluginHost: PluginHost, paneId?: string): {
|
|
42
|
+
export declare function getMACDTitleInfo(index: number, fastPeriod: number, slowPeriod: number, signalPeriod: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
42
43
|
name: string;
|
|
43
44
|
params: number[];
|
|
44
45
|
values: Array<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
|
+
import { ChartTheme } from '../../theme/colors';
|
|
2
3
|
export interface MOMRendererOptions {
|
|
3
4
|
/** 目标 pane ID(默认 'sub') */
|
|
4
5
|
paneId?: string;
|
|
@@ -10,7 +11,7 @@ export declare function createMOMRendererPlugin(options?: MOMRendererOptions): R
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取 MOM 标题信息(供 paneTitle 使用)
|
|
12
13
|
*/
|
|
13
|
-
export declare function getMOMTitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string): {
|
|
14
|
+
export declare function getMOMTitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
14
15
|
name: string;
|
|
15
16
|
params: number[];
|
|
16
17
|
values: Array<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
|
+
import { ThemeColors, ChartTheme } from '../../theme/colors';
|
|
2
3
|
type LinePoint = {
|
|
3
4
|
x: number;
|
|
4
5
|
y: number;
|
|
@@ -19,8 +20,8 @@ export declare function drawRSILinesWithCanvas2D(ctx: CanvasRenderingContext2D,
|
|
|
19
20
|
showRSI1: boolean;
|
|
20
21
|
showRSI2: boolean;
|
|
21
22
|
showRSI3: boolean;
|
|
22
|
-
}): void;
|
|
23
|
-
export declare function getRSITitleInfo(index: number, period1: number, period2: number, period3: number, pluginHost: PluginHost, paneId?: string): {
|
|
23
|
+
}, colors: ThemeColors): void;
|
|
24
|
+
export declare function getRSITitleInfo(index: number, period1: number, period2: number, period3: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
24
25
|
name: string;
|
|
25
26
|
params: number[];
|
|
26
27
|
values: Array<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost } from '../../../../plugin';
|
|
2
|
+
import { ThemeColors } from '../../../theme/colors';
|
|
2
3
|
import { ScaleType } from '../../../utils/tickPosition';
|
|
3
4
|
export interface IndicatorScaleRendererOptions {
|
|
4
5
|
axisWidth: number;
|
|
@@ -31,5 +32,7 @@ export interface DrawScaleTicksOptions {
|
|
|
31
32
|
scaleType?: ScaleType;
|
|
32
33
|
formatLabel?: (value: number) => string;
|
|
33
34
|
}
|
|
34
|
-
export declare function drawScaleTicks(options: DrawScaleTicksOptions
|
|
35
|
+
export declare function drawScaleTicks(options: DrawScaleTicksOptions & {
|
|
36
|
+
colors: ThemeColors;
|
|
37
|
+
}): void;
|
|
35
38
|
export declare function createIndicatorScaleRendererPlugin(options: IndicatorScaleRendererOptions): RendererPluginWithHost;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
|
+
import { ChartTheme } from '../../theme/colors';
|
|
2
3
|
export interface STOCHRendererOptions {
|
|
3
4
|
/** 目标 pane ID(默认 'sub') */
|
|
4
5
|
paneId?: string;
|
|
@@ -10,7 +11,7 @@ export declare function createSTOCHRendererPlugin(options?: STOCHRendererOptions
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取 STOCH 标题信息(供 paneTitle 使用)
|
|
12
13
|
*/
|
|
13
|
-
export declare function getSTOCHTitleInfo(index: number, n: number, m: number, pluginHost: PluginHost, paneId?: string): {
|
|
14
|
+
export declare function getSTOCHTitleInfo(index: number, n: number, m: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
14
15
|
name: string;
|
|
15
16
|
params: number[];
|
|
16
17
|
values: Array<{
|
|
@@ -2,8 +2,8 @@ import { TitleInfo } from '../paneTitle';
|
|
|
2
2
|
import { PluginHost } from '../../../plugin';
|
|
3
3
|
import { SubIndicatorType } from '.';
|
|
4
4
|
export interface SubPaneIndicatorConfig {
|
|
5
|
-
defaultParams: Record<string, number | boolean>;
|
|
6
|
-
getTitleInfo: (data: any[], index: number | null, params: Record<string, number | boolean>, pluginHost: PluginHost, paneId: string) => TitleInfo | null;
|
|
5
|
+
defaultParams: Record<string, number | boolean | string>;
|
|
6
|
+
getTitleInfo: (data: any[], index: number | null, params: Record<string, number | boolean | string>, pluginHost: PluginHost, paneId: string) => TitleInfo | null;
|
|
7
7
|
}
|
|
8
8
|
export declare const SUB_PANE_INDICATOR_CONFIGS: Record<SubIndicatorType, SubPaneIndicatorConfig>;
|
|
9
9
|
export declare const SUB_PANE_INDICATORS: SubIndicatorType[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPluginWithHost, PluginHost } from '../../../plugin';
|
|
2
|
+
import { ChartTheme } from '../../theme/colors';
|
|
2
3
|
export interface WMSRRendererOptions {
|
|
3
4
|
/** 目标 pane ID(默认 'sub') */
|
|
4
5
|
paneId?: string;
|
|
@@ -10,7 +11,7 @@ export declare function createWMSRRendererPlugin(options?: WMSRRendererOptions):
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取 WMSR 标题信息(供 paneTitle 使用)
|
|
12
13
|
*/
|
|
13
|
-
export declare function getWMSRTitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string): {
|
|
14
|
+
export declare function getWMSRTitleInfo(index: number, period: number, pluginHost: PluginHost, paneId?: string, theme?: ChartTheme): {
|
|
14
15
|
name: string;
|
|
15
16
|
params: number[];
|
|
16
17
|
values: Array<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RendererPlugin } from '../../plugin';
|
|
2
|
+
import { VolumePriceColors } from '../theme/colors';
|
|
2
3
|
import { VolumePriceRelation } from '../../types/volumePrice';
|
|
3
4
|
import { MarkerManager } from '../marker/registry';
|
|
4
5
|
/**
|
|
@@ -17,4 +18,4 @@ export declare function createCandleRenderer(): RendererPlugin;
|
|
|
17
18
|
* @param gap - 三角形与K线的间距,默认为4
|
|
18
19
|
* @param dpr - 设备像素比
|
|
19
20
|
*/
|
|
20
|
-
export declare function drawVolumePriceMarker(ctx: CanvasRenderingContext2D, x: number, y: number, relation: VolumePriceRelation, kIndex: number, kWidth: number, gap: number | undefined, markerManager: MarkerManager, dpr: number): void;
|
|
21
|
+
export declare function drawVolumePriceMarker(ctx: CanvasRenderingContext2D, x: number, y: number, relation: VolumePriceRelation, kIndex: number, kWidth: number, gap: number | undefined, markerManager: MarkerManager, dpr: number, volumePriceColors: VolumePriceColors): void;
|