@363045841yyt/klinechart 0.5.5-alpha.0 → 0.5.6

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.
@@ -1,259 +0,0 @@
1
- declare const _default: {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://kmap.dev/schemas/semantic-chart-config/1.0.0",
4
- "title": "SemanticChartConfig",
5
- "description": "Agent 语义化图表配置",
6
- "type": "object",
7
- "required": ["version", "data"],
8
- "additionalProperties": false,
9
- "properties": {
10
- "version": {
11
- "type": "string",
12
- "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
13
- "description": "semver 版本号"
14
- },
15
- "data": { "$ref": "#/$defs/DataConfig" },
16
- "indicators": { "$ref": "#/$defs/IndicatorsConfig" },
17
- "markers": { "$ref": "#/$defs/MarkersConfig" },
18
- "chart": { "$ref": "#/$defs/ChartOptions" },
19
- "theme": { "$ref": "#/$defs/ThemeConfig" }
20
- },
21
- "$defs": {
22
- "DataConfig": {
23
- "type": "object",
24
- "required": ["source", "symbol", "startDate", "endDate", "period", "adjust"],
25
- "additionalProperties": false,
26
- "properties": {
27
- "source": { "type": "string", "enum": ["baostock", "dongcai"] },
28
- "symbol": { "type": "string", "pattern": "^[0-9]{6}$" },
29
- "exchange": { "type": "string", "enum": ["SH", "SZ", "BJ"] },
30
- "startDate": { "type": "string", "format": "date" },
31
- "endDate": { "type": "string", "format": "date" },
32
- "period": {
33
- "type": "string",
34
- "enum": ["daily", "weekly", "monthly", "5min", "15min", "30min", "60min"]
35
- },
36
- "adjust": { "type": "string", "enum": ["qfq", "hfq", "none"] }
37
- }
38
- },
39
- "IndicatorsConfig": {
40
- "type": "object",
41
- "additionalProperties": false,
42
- "properties": {
43
- "main": {
44
- "type": "array",
45
- "items": { "$ref": "#/$defs/MainIndicatorConfig" },
46
- "maxItems": 5
47
- },
48
- "sub": {
49
- "type": "array",
50
- "items": { "$ref": "#/$defs/SubIndicatorConfig" },
51
- "maxItems": 5
52
- }
53
- }
54
- },
55
- "MainIndicatorConfig": {
56
- "type": "object",
57
- "required": ["type", "enabled"],
58
- "additionalProperties": false,
59
- "properties": {
60
- "type": { "type": "string", "enum": ["MA", "BOLL"] },
61
- "enabled": { "type": "boolean" },
62
- "params": { "type": "object" }
63
- },
64
- "allOf": [
65
- {
66
- "if": {
67
- "properties": { "type": { "const": "MA" } },
68
- "required": ["type"]
69
- },
70
- "then": {
71
- "properties": {
72
- "params": {
73
- "type": "object",
74
- "additionalProperties": false,
75
- "properties": {
76
- "periods": {
77
- "type": "array",
78
- "items": { "type": "integer", "minimum": 1, "maximum": 250 },
79
- "minItems": 1,
80
- "maxItems": 5
81
- }
82
- }
83
- }
84
- }
85
- },
86
- "else": {
87
- "properties": {
88
- "params": {
89
- "type": "object",
90
- "additionalProperties": false,
91
- "properties": {
92
- "period": { "type": "integer", "minimum": 1, "maximum": 100 },
93
- "multiplier": { "type": "number", "minimum": 0.1, "maximum": 5 }
94
- }
95
- }
96
- }
97
- }
98
- }
99
- ]
100
- },
101
- "SubIndicatorConfig": {
102
- "type": "object",
103
- "required": ["type", "enabled"],
104
- "additionalProperties": false,
105
- "properties": {
106
- "type": {
107
- "type": "string",
108
- "enum": ["VOLUME", "MACD", "RSI", "CCI", "STOCH", "MOM", "WMSR", "KST", "FASTK"]
109
- },
110
- "enabled": { "type": "boolean" },
111
- "params": { "type": "object" }
112
- },
113
- "allOf": [
114
- {
115
- "if": { "properties": { "type": { "const": "MACD" } } },
116
- "then": {
117
- "properties": {
118
- "params": {
119
- "type": "object",
120
- "additionalProperties": false,
121
- "properties": {
122
- "fast": { "type": "integer", "minimum": 1, "maximum": 50 },
123
- "slow": { "type": "integer", "minimum": 1, "maximum": 100 },
124
- "signal": { "type": "integer", "minimum": 1, "maximum": 50 }
125
- }
126
- }
127
- }
128
- }
129
- },
130
- {
131
- "if": { "properties": { "type": { "const": "RSI" } } },
132
- "then": {
133
- "properties": {
134
- "params": {
135
- "type": "object",
136
- "additionalProperties": false,
137
- "properties": {
138
- "period1": { "type": "integer", "minimum": 1, "maximum": 100 },
139
- "period2": { "type": "integer", "minimum": 1, "maximum": 100 },
140
- "period3": { "type": "integer", "minimum": 1, "maximum": 100 }
141
- }
142
- }
143
- }
144
- }
145
- }
146
- ]
147
- },
148
- "MarkersConfig": {
149
- "type": "object",
150
- "additionalProperties": false,
151
- "properties": {
152
- "showVolumePriceMarkers": { "type": "boolean" },
153
- "showExtremaMarkers": { "type": "boolean" },
154
- "customMarkers": {
155
- "type": "array",
156
- "items": { "$ref": "#/$defs/CustomMarker" },
157
- "maxItems": 100
158
- },
159
- "legend": { "$ref": "#/$defs/LegendConfig" }
160
- }
161
- },
162
- "CustomMarker": {
163
- "type": "object",
164
- "required": ["id", "date", "shape"],
165
- "additionalProperties": false,
166
- "properties": {
167
- "id": { "type": "string", "maxLength": 64 },
168
- "date": {
169
- "type": "string",
170
- "description": "日期时间字符串,日K用 YYYY-MM-DD,分钟K用 YYYY-MM-DD HH:mm",
171
- "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}( [0-9]{2}:[0-9]{2})?$"
172
- },
173
- "shape": {
174
- "type": "string",
175
- "enum": ["arrow_up", "arrow_down", "flag", "circle", "rectangle", "diamond"]
176
- },
177
- "groupKey": { "type": "string", "maxLength": 32 },
178
- "offset": {
179
- "type": "object",
180
- "additionalProperties": false,
181
- "properties": {
182
- "x": { "type": "number", "minimum": -500, "maximum": 500 },
183
- "y": { "type": "number", "minimum": -500, "maximum": 500 }
184
- }
185
- },
186
- "style": { "$ref": "#/$defs/MarkerStyle" },
187
- "label": { "$ref": "#/$defs/MarkerLabel" },
188
- "metadata": {
189
- "type": "object",
190
- "maxProperties": 20,
191
- "additionalProperties": {
192
- "type": ["string", "number", "boolean", "null"],
193
- "maxLength": 200
194
- }
195
- }
196
- }
197
- },
198
- "MarkerStyle": {
199
- "type": "object",
200
- "additionalProperties": false,
201
- "properties": {
202
- "fillColor": { "type": "string", "pattern": "^(#[0-9a-fA-F]{3,8}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)|rgba\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*[\\d.]+\\s*\\))$" },
203
- "strokeColor": { "type": "string", "pattern": "^(#[0-9a-fA-F]{3,8}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)|rgba\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*[\\d.]+\\s*\\))$" },
204
- "textColor": { "type": "string", "pattern": "^(#[0-9a-fA-F]{3,8}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\)|rgba\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*[\\d.]+\\s*\\))$" },
205
- "size": { "type": "number", "minimum": 4, "maximum": 50 },
206
- "lineWidth": { "type": "number", "minimum": 0.5, "maximum": 10 },
207
- "opacity": { "type": "number", "minimum": 0, "maximum": 1 }
208
- }
209
- },
210
- "MarkerLabel": {
211
- "type": "object",
212
- "required": ["text"],
213
- "additionalProperties": false,
214
- "properties": {
215
- "text": { "type": "string", "maxLength": 50 },
216
- "position": { "type": "string", "enum": ["left", "right", "top", "bottom", "inside"] },
217
- "align": { "type": "string", "enum": ["start", "center", "end"] },
218
- "fontSize": { "type": "number", "minimum": 8, "maximum": 24 },
219
- "offset": {
220
- "type": "object",
221
- "additionalProperties": false,
222
- "properties": {
223
- "x": { "type": "number", "minimum": -500, "maximum": 500 },
224
- "y": { "type": "number", "minimum": -500, "maximum": 500 }
225
- }
226
- }
227
- }
228
- },
229
- "LegendConfig": {
230
- "type": "object",
231
- "additionalProperties": false,
232
- "properties": {
233
- "enabled": { "type": "boolean" },
234
- "position": { "type": "string", "enum": ["bottom-right", "bottom-left", "top-right", "top-left"] },
235
- "onClick": { "type": "string", "enum": ["highlight", "toggle", "none"] }
236
- }
237
- },
238
- "ChartOptions": {
239
- "type": "object",
240
- "additionalProperties": false,
241
- "properties": {
242
- "kWidth": { "type": "number", "minimum": 2, "maximum": 50 },
243
- "kGap": { "type": "number", "minimum": 0, "maximum": 20 },
244
- "autoScrollToRight": { "type": "boolean" }
245
- }
246
- },
247
- "ThemeConfig": {
248
- "type": "object",
249
- "additionalProperties": false,
250
- "properties": {
251
- "priceUpColor": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
252
- "priceDownColor": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" }
253
- }
254
- }
255
- }
256
- }
257
- ;
258
-
259
- export default _default;