@upbit-official/upbit-sdk 1.0.0 → 1.1.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 (190) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +21 -0
  3. package/client.d.mts +10 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +10 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +23 -5
  8. package/client.js.map +1 -1
  9. package/client.mjs +23 -5
  10. package/client.mjs.map +1 -1
  11. package/index.d.mts +3 -1
  12. package/index.d.mts.map +1 -1
  13. package/index.d.ts +3 -1
  14. package/index.d.ts.map +1 -1
  15. package/index.js +2 -1
  16. package/index.js.map +1 -1
  17. package/index.mjs +1 -1
  18. package/index.mjs.map +1 -1
  19. package/internal/ws-parser.d.mts +40 -0
  20. package/internal/ws-parser.d.mts.map +1 -0
  21. package/internal/ws-parser.d.ts +40 -0
  22. package/internal/ws-parser.d.ts.map +1 -0
  23. package/internal/ws-parser.js +125 -0
  24. package/internal/ws-parser.js.map +1 -0
  25. package/internal/ws-parser.mjs +118 -0
  26. package/internal/ws-parser.mjs.map +1 -0
  27. package/internal/ws-simple-types.d.mts +8 -0
  28. package/internal/ws-simple-types.d.mts.map +1 -0
  29. package/internal/ws-simple-types.d.ts +8 -0
  30. package/internal/ws-simple-types.d.ts.map +1 -0
  31. package/internal/ws-simple-types.js +3 -0
  32. package/internal/ws-simple-types.js.map +1 -0
  33. package/internal/ws-simple-types.mjs +2 -0
  34. package/internal/ws-simple-types.mjs.map +1 -0
  35. package/internal/ws.d.mts +1 -0
  36. package/internal/ws.d.mts.map +1 -1
  37. package/internal/ws.d.ts +1 -0
  38. package/internal/ws.d.ts.map +1 -1
  39. package/internal/ws.js.map +1 -1
  40. package/internal/ws.mjs.map +1 -1
  41. package/lib/index.d.mts +4 -2
  42. package/lib/index.d.mts.map +1 -1
  43. package/lib/index.d.ts +4 -2
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +2 -1
  46. package/lib/index.js.map +1 -1
  47. package/lib/index.mjs +1 -1
  48. package/lib/index.mjs.map +1 -1
  49. package/lib/jsonParseFloat.d.mts +5 -5
  50. package/lib/jsonParseFloat.d.mts.map +1 -1
  51. package/lib/jsonParseFloat.d.ts +5 -5
  52. package/lib/jsonParseFloat.d.ts.map +1 -1
  53. package/lib/jsonParseFloat.js +30 -12
  54. package/lib/jsonParseFloat.js.map +1 -1
  55. package/lib/jsonParseFloat.mjs +30 -12
  56. package/lib/jsonParseFloat.mjs.map +1 -1
  57. package/lib/ws.d.mts +102 -15
  58. package/lib/ws.d.mts.map +1 -1
  59. package/lib/ws.d.ts +102 -15
  60. package/lib/ws.d.ts.map +1 -1
  61. package/lib/ws.js +208 -34
  62. package/lib/ws.js.map +1 -1
  63. package/lib/ws.mjs +204 -33
  64. package/lib/ws.mjs.map +1 -1
  65. package/package.json +1 -1
  66. package/resources/index.d.mts +3 -2
  67. package/resources/index.d.mts.map +1 -1
  68. package/resources/index.d.ts +3 -2
  69. package/resources/index.d.ts.map +1 -1
  70. package/resources/index.js +3 -1
  71. package/resources/index.js.map +1 -1
  72. package/resources/index.mjs +3 -2
  73. package/resources/index.mjs.map +1 -1
  74. package/resources/ws-info/index.d.mts +6 -0
  75. package/resources/ws-info/index.d.mts.map +1 -0
  76. package/resources/ws-info/index.d.ts +6 -0
  77. package/resources/ws-info/index.d.ts.map +1 -0
  78. package/resources/ws-info/index.js +6 -0
  79. package/resources/ws-info/index.js.map +1 -0
  80. package/resources/ws-info/index.mjs +2 -0
  81. package/resources/ws-info/index.mjs.map +1 -0
  82. package/resources/ws-info/internal-base.d.mts +63 -0
  83. package/resources/ws-info/internal-base.d.mts.map +1 -0
  84. package/resources/ws-info/internal-base.d.ts +63 -0
  85. package/resources/ws-info/internal-base.d.ts.map +1 -0
  86. package/resources/ws-info/internal-base.js +47 -0
  87. package/resources/ws-info/internal-base.js.map +1 -0
  88. package/resources/ws-info/internal-base.mjs +41 -0
  89. package/resources/ws-info/internal-base.mjs.map +1 -0
  90. package/resources/ws-info/ws-info.d.mts +1180 -0
  91. package/resources/ws-info/ws-info.d.mts.map +1 -0
  92. package/resources/ws-info/ws-info.d.ts +1180 -0
  93. package/resources/ws-info/ws-info.d.ts.map +1 -0
  94. package/resources/ws-info/ws-info.js +8 -0
  95. package/resources/ws-info/ws-info.js.map +1 -0
  96. package/resources/ws-info/ws-info.mjs +4 -0
  97. package/resources/ws-info/ws-info.mjs.map +1 -0
  98. package/resources/ws-info/ws.d.mts +91 -0
  99. package/resources/ws-info/ws.d.mts.map +1 -0
  100. package/resources/ws-info/ws.d.ts +91 -0
  101. package/resources/ws-info/ws.d.ts.map +1 -0
  102. package/resources/ws-info/ws.js +463 -0
  103. package/resources/ws-info/ws.js.map +1 -0
  104. package/resources/ws-info/ws.mjs +458 -0
  105. package/resources/ws-info/ws.mjs.map +1 -0
  106. package/resources/ws-info.d.mts +2 -0
  107. package/resources/ws-info.d.mts.map +1 -0
  108. package/resources/ws-info.d.ts +2 -0
  109. package/resources/ws-info.d.ts.map +1 -0
  110. package/resources/ws-info.js +5 -0
  111. package/resources/ws-info.js.map +1 -0
  112. package/resources/ws-info.mjs +2 -0
  113. package/resources/ws-info.mjs.map +1 -0
  114. package/resources/ws-private/index.d.mts +3 -1
  115. package/resources/ws-private/index.d.mts.map +1 -1
  116. package/resources/ws-private/index.d.ts +3 -1
  117. package/resources/ws-private/index.d.ts.map +1 -1
  118. package/resources/ws-private/index.js.map +1 -1
  119. package/resources/ws-private/index.mjs +1 -1
  120. package/resources/ws-private/index.mjs.map +1 -1
  121. package/resources/ws-private/internal-base.d.mts.map +1 -1
  122. package/resources/ws-private/internal-base.d.ts.map +1 -1
  123. package/resources/ws-private/internal-base.js.map +1 -1
  124. package/resources/ws-private/internal-base.mjs.map +1 -1
  125. package/resources/ws-private/ws-private.d.mts +301 -9
  126. package/resources/ws-private/ws-private.d.mts.map +1 -1
  127. package/resources/ws-private/ws-private.d.ts +301 -9
  128. package/resources/ws-private/ws-private.d.ts.map +1 -1
  129. package/resources/ws-private/ws-private.js.map +1 -1
  130. package/resources/ws-private/ws-private.mjs.map +1 -1
  131. package/resources/ws-private/ws.d.mts +2 -2
  132. package/resources/ws-private/ws.d.mts.map +1 -1
  133. package/resources/ws-private/ws.d.ts +2 -2
  134. package/resources/ws-private/ws.d.ts.map +1 -1
  135. package/resources/ws-private/ws.js +15 -20
  136. package/resources/ws-private/ws.js.map +1 -1
  137. package/resources/ws-private/ws.mjs +15 -20
  138. package/resources/ws-private/ws.mjs.map +1 -1
  139. package/resources/ws-public/index.d.mts +3 -1
  140. package/resources/ws-public/index.d.mts.map +1 -1
  141. package/resources/ws-public/index.d.ts +3 -1
  142. package/resources/ws-public/index.d.ts.map +1 -1
  143. package/resources/ws-public/index.js.map +1 -1
  144. package/resources/ws-public/index.mjs +1 -1
  145. package/resources/ws-public/index.mjs.map +1 -1
  146. package/resources/ws-public/internal-base.d.mts.map +1 -1
  147. package/resources/ws-public/internal-base.d.ts.map +1 -1
  148. package/resources/ws-public/internal-base.js.map +1 -1
  149. package/resources/ws-public/internal-base.mjs.map +1 -1
  150. package/resources/ws-public/ws-public.d.mts +355 -5
  151. package/resources/ws-public/ws-public.d.mts.map +1 -1
  152. package/resources/ws-public/ws-public.d.ts +355 -5
  153. package/resources/ws-public/ws-public.d.ts.map +1 -1
  154. package/resources/ws-public/ws.d.mts +2 -2
  155. package/resources/ws-public/ws.d.mts.map +1 -1
  156. package/resources/ws-public/ws.d.ts +2 -2
  157. package/resources/ws-public/ws.d.ts.map +1 -1
  158. package/resources/ws-public/ws.js +15 -20
  159. package/resources/ws-public/ws.js.map +1 -1
  160. package/resources/ws-public/ws.mjs +15 -20
  161. package/resources/ws-public/ws.mjs.map +1 -1
  162. package/src/client.ts +92 -5
  163. package/src/index.ts +24 -1
  164. package/src/internal/ws-parser.ts +164 -0
  165. package/src/internal/ws-simple-types.ts +34 -0
  166. package/src/internal/ws.ts +1 -0
  167. package/src/lib/index.ts +17 -2
  168. package/src/lib/jsonParseFloat.ts +37 -12
  169. package/src/lib/ws.ts +367 -55
  170. package/src/resources/index.ts +42 -2
  171. package/src/resources/ws-info/index.ts +44 -0
  172. package/src/resources/ws-info/internal-base.ts +96 -0
  173. package/src/resources/ws-info/ws-info.ts +1855 -0
  174. package/src/resources/ws-info/ws.ts +574 -0
  175. package/src/resources/ws-info.ts +1 -0
  176. package/src/resources/ws-private/index.ts +12 -1
  177. package/src/resources/ws-private/internal-base.ts +0 -1
  178. package/src/resources/ws-private/ws-private.ts +420 -18
  179. package/src/resources/ws-private/ws.ts +16 -23
  180. package/src/resources/ws-public/index.ts +16 -1
  181. package/src/resources/ws-public/internal-base.ts +0 -1
  182. package/src/resources/ws-public/ws-public.ts +459 -4
  183. package/src/resources/ws-public/ws.ts +16 -23
  184. package/src/version.ts +1 -1
  185. package/version.d.mts +1 -1
  186. package/version.d.ts +1 -1
  187. package/version.js +1 -1
  188. package/version.js.map +1 -1
  189. package/version.mjs +1 -1
  190. package/version.mjs.map +1 -1
@@ -0,0 +1,1855 @@
1
+ import { APIResource } from '../../core/resource';
2
+
3
+ import * as WsInfoAPI from './ws-info';
4
+
5
+ export class WsInfo extends APIResource {}
6
+
7
+ export interface BollingerBandsIndicator {
8
+ candle_date_time_utc: string;
9
+
10
+ code: string;
11
+
12
+ indicator: 'bollinger_bands';
13
+
14
+ params: BollingerBandsIndicator.Params;
15
+
16
+ stream_type: 'REALTIME';
17
+
18
+ /**
19
+ * Candle timeframe used to calculate an indicator
20
+ */
21
+ timeframe: IndicatorTimeframe;
22
+
23
+ timestamp: number;
24
+
25
+ type: 'indicator';
26
+
27
+ value: BollingerBandsIndicator.Value;
28
+ }
29
+
30
+ export namespace BollingerBandsIndicator {
31
+ export interface Params {
32
+ multiplier: 1 | 1.5 | 2 | 2.5 | 3;
33
+
34
+ period: 10 | 20 | 50;
35
+ }
36
+
37
+ export interface Value {
38
+ bb_lower: string;
39
+
40
+ bb_middle: string;
41
+
42
+ bb_upper: string;
43
+ }
44
+ }
45
+
46
+ export interface BollingerBandsIndicatorSignal {
47
+ candle_date_time_utc: string;
48
+
49
+ code: string;
50
+
51
+ /**
52
+ * Empty condition parameters for a trigger without event parameters
53
+ */
54
+ event_params: BollingerBandsIndicatorSignal.EventParams;
55
+
56
+ indicator: 'bollinger_bands';
57
+
58
+ params: BollingerBandsIndicatorSignal.Params;
59
+
60
+ stream_type: 'REALTIME';
61
+
62
+ /**
63
+ * Candle timeframe used to calculate an indicator
64
+ */
65
+ timeframe: IndicatorTimeframe;
66
+
67
+ timestamp: number;
68
+
69
+ trigger: 'price_cross_above' | 'price_cross_below';
70
+
71
+ type: 'indicator_signal';
72
+
73
+ value: BollingerBandsIndicatorSignal.Value;
74
+ }
75
+
76
+ export namespace BollingerBandsIndicatorSignal {
77
+ /**
78
+ * Empty condition parameters for a trigger without event parameters
79
+ */
80
+ export interface EventParams {}
81
+
82
+ export interface Params {
83
+ multiplier: 1.5 | 2 | 2.5;
84
+
85
+ period: 20;
86
+ }
87
+
88
+ export interface Value {
89
+ bb_lower: string;
90
+
91
+ bb_middle: string;
92
+
93
+ bb_upper: string;
94
+ }
95
+ }
96
+
97
+ export type Indicator =
98
+ | VolumeIndicator
99
+ | RsiIndicator
100
+ | MovingAverageIndicator
101
+ | MaCrossoverIndicator
102
+ | BollingerBandsIndicator
103
+ | MacdIndicator;
104
+
105
+ export type IndicatorSignal =
106
+ | VolumeIndicatorSignal
107
+ | RsiOverboughtIndicatorSignal
108
+ | RsiOversoldIndicatorSignal
109
+ | MovingAverageIndicatorSignal
110
+ | MaCrossoverIndicatorSignal
111
+ | BollingerBandsIndicatorSignal
112
+ | MacdIndicatorSignal;
113
+
114
+ export type IndicatorTimeframe = '5m' | '15m' | '60m' | '240m' | '1d';
115
+
116
+ export type IndicatorType = 'volume' | 'rsi' | 'moving_average' | 'ma_crossover' | 'bollinger_bands' | 'macd';
117
+
118
+ export interface MaCrossoverIndicator {
119
+ candle_date_time_utc: string;
120
+
121
+ code: string;
122
+
123
+ indicator: 'ma_crossover';
124
+
125
+ params:
126
+ | MaCrossoverIndicator.WsMaCrossoverIndicatorParams5_20
127
+ | MaCrossoverIndicator.WsMaCrossoverIndicatorParams20_60
128
+ | MaCrossoverIndicator.WsMaCrossoverIndicatorParams30_90
129
+ | MaCrossoverIndicator.WsMaCrossoverIndicatorParams50_200;
130
+
131
+ stream_type: 'REALTIME';
132
+
133
+ /**
134
+ * Candle timeframe used to calculate an indicator
135
+ */
136
+ timeframe: IndicatorTimeframe;
137
+
138
+ timestamp: number;
139
+
140
+ type: 'indicator';
141
+
142
+ value: MaCrossoverIndicator.Value;
143
+ }
144
+
145
+ export namespace MaCrossoverIndicator {
146
+ export interface WsMaCrossoverIndicatorParams5_20 {
147
+ long_period: 20;
148
+
149
+ short_period: 5;
150
+
151
+ /**
152
+ * Moving average calculation type
153
+ */
154
+ type: 'SMA' | 'EMA';
155
+ }
156
+
157
+ export interface WsMaCrossoverIndicatorParams20_60 {
158
+ long_period: 60;
159
+
160
+ short_period: 20;
161
+
162
+ /**
163
+ * Moving average calculation type
164
+ */
165
+ type: 'SMA' | 'EMA';
166
+ }
167
+
168
+ export interface WsMaCrossoverIndicatorParams30_90 {
169
+ long_period: 90;
170
+
171
+ short_period: 30;
172
+
173
+ /**
174
+ * Moving average calculation type
175
+ */
176
+ type: 'SMA' | 'EMA';
177
+ }
178
+
179
+ export interface WsMaCrossoverIndicatorParams50_200 {
180
+ long_period: 200;
181
+
182
+ short_period: 50;
183
+
184
+ /**
185
+ * Moving average calculation type
186
+ */
187
+ type: 'SMA' | 'EMA';
188
+ }
189
+
190
+ export interface Value {
191
+ ma_long: string;
192
+
193
+ ma_short: string;
194
+ }
195
+ }
196
+
197
+ export interface MaCrossoverIndicatorSignal {
198
+ candle_date_time_utc: string;
199
+
200
+ code: string;
201
+
202
+ /**
203
+ * Empty condition parameters for a trigger without event parameters
204
+ */
205
+ event_params: MaCrossoverIndicatorSignal.EventParams;
206
+
207
+ indicator: 'ma_crossover';
208
+
209
+ params:
210
+ | MaCrossoverIndicatorSignal.WsIndicatorSignalMaCrossoverParams5_20
211
+ | MaCrossoverIndicatorSignal.WsIndicatorSignalMaCrossoverParams20_60
212
+ | MaCrossoverIndicatorSignal.WsIndicatorSignalMaCrossoverParams30_90
213
+ | MaCrossoverIndicatorSignal.WsIndicatorSignalMaCrossoverParams50_200;
214
+
215
+ stream_type: 'REALTIME';
216
+
217
+ /**
218
+ * Candle timeframe used to calculate an indicator
219
+ */
220
+ timeframe: IndicatorTimeframe;
221
+
222
+ timestamp: number;
223
+
224
+ trigger: 'golden_cross' | 'dead_cross';
225
+
226
+ type: 'indicator_signal';
227
+
228
+ value: MaCrossoverIndicatorSignal.Value;
229
+ }
230
+
231
+ export namespace MaCrossoverIndicatorSignal {
232
+ /**
233
+ * Empty condition parameters for a trigger without event parameters
234
+ */
235
+ export interface EventParams {}
236
+
237
+ export interface WsIndicatorSignalMaCrossoverParams5_20 {
238
+ long_period: 20;
239
+
240
+ short_period: 5;
241
+
242
+ /**
243
+ * Moving average calculation type
244
+ */
245
+ type: 'SMA' | 'EMA';
246
+ }
247
+
248
+ export interface WsIndicatorSignalMaCrossoverParams20_60 {
249
+ long_period: 60;
250
+
251
+ short_period: 20;
252
+
253
+ /**
254
+ * Moving average calculation type
255
+ */
256
+ type: 'SMA' | 'EMA';
257
+ }
258
+
259
+ export interface WsIndicatorSignalMaCrossoverParams30_90 {
260
+ long_period: 90;
261
+
262
+ short_period: 30;
263
+
264
+ /**
265
+ * Moving average calculation type
266
+ */
267
+ type: 'SMA' | 'EMA';
268
+ }
269
+
270
+ export interface WsIndicatorSignalMaCrossoverParams50_200 {
271
+ long_period: 200;
272
+
273
+ short_period: 50;
274
+
275
+ /**
276
+ * Moving average calculation type
277
+ */
278
+ type: 'SMA' | 'EMA';
279
+ }
280
+
281
+ export interface Value {
282
+ ma_long: string;
283
+
284
+ ma_short: string;
285
+ }
286
+ }
287
+
288
+ export interface MacdIndicator {
289
+ candle_date_time_utc: string;
290
+
291
+ code: string;
292
+
293
+ indicator: 'macd';
294
+
295
+ params:
296
+ | MacdIndicator.WsMacdIndicatorParams12_26_9
297
+ | MacdIndicator.WsMacdIndicatorParams8_17_9
298
+ | MacdIndicator.WsMacdIndicatorParams5_35_5;
299
+
300
+ stream_type: 'REALTIME';
301
+
302
+ /**
303
+ * Candle timeframe used to calculate an indicator
304
+ */
305
+ timeframe: IndicatorTimeframe;
306
+
307
+ timestamp: number;
308
+
309
+ type: 'indicator';
310
+
311
+ value: MacdIndicator.Value;
312
+ }
313
+
314
+ export namespace MacdIndicator {
315
+ export interface WsMacdIndicatorParams12_26_9 {
316
+ fast: 12;
317
+
318
+ signal_period: 9;
319
+
320
+ slow: 26;
321
+ }
322
+
323
+ export interface WsMacdIndicatorParams8_17_9 {
324
+ fast: 8;
325
+
326
+ signal_period: 9;
327
+
328
+ slow: 17;
329
+ }
330
+
331
+ export interface WsMacdIndicatorParams5_35_5 {
332
+ fast: 5;
333
+
334
+ signal_period: 5;
335
+
336
+ slow: 35;
337
+ }
338
+
339
+ export interface Value {
340
+ histogram: string;
341
+
342
+ macd: string;
343
+
344
+ macd_signal: string;
345
+ }
346
+ }
347
+
348
+ export interface MacdIndicatorSignal {
349
+ candle_date_time_utc: string;
350
+
351
+ code: string;
352
+
353
+ /**
354
+ * Empty condition parameters for a trigger without event parameters
355
+ */
356
+ event_params: MacdIndicatorSignal.EventParams;
357
+
358
+ indicator: 'macd';
359
+
360
+ params:
361
+ | MacdIndicatorSignal.WsIndicatorSignalMacdParams12_26_9
362
+ | MacdIndicatorSignal.WsIndicatorSignalMacdParams8_17_9
363
+ | MacdIndicatorSignal.WsIndicatorSignalMacdParams5_35_5;
364
+
365
+ stream_type: 'REALTIME';
366
+
367
+ /**
368
+ * Candle timeframe used to calculate an indicator
369
+ */
370
+ timeframe: IndicatorTimeframe;
371
+
372
+ timestamp: number;
373
+
374
+ trigger: 'golden_cross' | 'dead_cross' | 'zero_cross_above' | 'zero_cross_below';
375
+
376
+ type: 'indicator_signal';
377
+
378
+ value: MacdIndicatorSignal.Value;
379
+ }
380
+
381
+ export namespace MacdIndicatorSignal {
382
+ /**
383
+ * Empty condition parameters for a trigger without event parameters
384
+ */
385
+ export interface EventParams {}
386
+
387
+ export interface WsIndicatorSignalMacdParams12_26_9 {
388
+ fast: 12;
389
+
390
+ signal_period: 9;
391
+
392
+ slow: 26;
393
+ }
394
+
395
+ export interface WsIndicatorSignalMacdParams8_17_9 {
396
+ fast: 8;
397
+
398
+ signal_period: 9;
399
+
400
+ slow: 17;
401
+ }
402
+
403
+ export interface WsIndicatorSignalMacdParams5_35_5 {
404
+ fast: 5;
405
+
406
+ signal_period: 5;
407
+
408
+ slow: 35;
409
+ }
410
+
411
+ export interface Value {
412
+ histogram: string;
413
+
414
+ macd: string;
415
+
416
+ macd_signal: string;
417
+ }
418
+ }
419
+
420
+ export interface MovingAverageIndicator {
421
+ candle_date_time_utc: string;
422
+
423
+ code: string;
424
+
425
+ indicator: 'moving_average';
426
+
427
+ params: MovingAverageIndicator.Params;
428
+
429
+ stream_type: 'REALTIME';
430
+
431
+ /**
432
+ * Candle timeframe used to calculate an indicator
433
+ */
434
+ timeframe: IndicatorTimeframe;
435
+
436
+ timestamp: number;
437
+
438
+ type: 'indicator';
439
+
440
+ value: MovingAverageIndicator.Value;
441
+ }
442
+
443
+ export namespace MovingAverageIndicator {
444
+ export interface Params {
445
+ period: 3 | 5 | 7 | 10 | 15 | 20 | 25 | 30 | 50 | 60 | 90 | 99 | 100 | 120 | 200;
446
+
447
+ /**
448
+ * Moving average calculation type
449
+ */
450
+ type: 'SMA' | 'EMA';
451
+ }
452
+
453
+ export interface Value {
454
+ value: string;
455
+ }
456
+ }
457
+
458
+ export interface MovingAverageIndicatorSignal {
459
+ candle_date_time_utc: string;
460
+
461
+ code: string;
462
+
463
+ /**
464
+ * Empty condition parameters for a trigger without event parameters
465
+ */
466
+ event_params: MovingAverageIndicatorSignal.EventParams;
467
+
468
+ indicator: 'moving_average';
469
+
470
+ params: MovingAverageIndicatorSignal.Params;
471
+
472
+ stream_type: 'REALTIME';
473
+
474
+ /**
475
+ * Candle timeframe used to calculate an indicator
476
+ */
477
+ timeframe: IndicatorTimeframe;
478
+
479
+ timestamp: number;
480
+
481
+ trigger: 'price_cross_above' | 'price_cross_below';
482
+
483
+ type: 'indicator_signal';
484
+
485
+ value: MovingAverageIndicatorSignal.Value;
486
+ }
487
+
488
+ export namespace MovingAverageIndicatorSignal {
489
+ /**
490
+ * Empty condition parameters for a trigger without event parameters
491
+ */
492
+ export interface EventParams {}
493
+
494
+ export interface Params {
495
+ period: 5 | 10 | 20 | 30 | 60 | 90 | 120 | 200;
496
+
497
+ /**
498
+ * Moving average calculation type
499
+ */
500
+ type: 'SMA' | 'EMA';
501
+ }
502
+
503
+ export interface Value {
504
+ value: string;
505
+ }
506
+ }
507
+
508
+ export interface RsiIndicator {
509
+ candle_date_time_utc: string;
510
+
511
+ code: string;
512
+
513
+ indicator: 'rsi';
514
+
515
+ params: RsiIndicator.Params;
516
+
517
+ stream_type: 'REALTIME';
518
+
519
+ /**
520
+ * Candle timeframe used to calculate an indicator
521
+ */
522
+ timeframe: IndicatorTimeframe;
523
+
524
+ timestamp: number;
525
+
526
+ type: 'indicator';
527
+
528
+ value: RsiIndicator.Value;
529
+ }
530
+
531
+ export namespace RsiIndicator {
532
+ export interface Params {
533
+ period: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 25;
534
+ }
535
+
536
+ export interface Value {
537
+ rsi: string;
538
+ }
539
+ }
540
+
541
+ export type RsiIndicatorSignal = RsiOverboughtIndicatorSignal | RsiOversoldIndicatorSignal;
542
+
543
+ export interface RsiOverboughtIndicatorSignal {
544
+ candle_date_time_utc: string;
545
+
546
+ code: string;
547
+
548
+ event_params: RsiOverboughtIndicatorSignal.EventParams;
549
+
550
+ indicator: 'rsi';
551
+
552
+ params: RsiOverboughtIndicatorSignal.Params;
553
+
554
+ stream_type: 'REALTIME';
555
+
556
+ /**
557
+ * Candle timeframe used to calculate an indicator
558
+ */
559
+ timeframe: IndicatorTimeframe;
560
+
561
+ timestamp: number;
562
+
563
+ trigger: 'overbought';
564
+
565
+ type: 'indicator_signal';
566
+
567
+ value: RsiOverboughtIndicatorSignal.Value;
568
+ }
569
+
570
+ export namespace RsiOverboughtIndicatorSignal {
571
+ export interface EventParams {
572
+ threshold: 70 | 80;
573
+ }
574
+
575
+ export interface Params {
576
+ period: 7 | 9 | 14 | 21 | 25;
577
+ }
578
+
579
+ export interface Value {
580
+ rsi: string;
581
+ }
582
+ }
583
+
584
+ export interface RsiOverboughtIndicatorSignalRequest {
585
+ event_params: RsiOverboughtIndicatorSignalRequest.EventParams;
586
+
587
+ params: RsiOverboughtIndicatorSignalRequest.Params;
588
+
589
+ trigger: 'overbought';
590
+
591
+ type: 'rsi';
592
+ }
593
+
594
+ export namespace RsiOverboughtIndicatorSignalRequest {
595
+ export interface EventParams {
596
+ threshold: 70 | 80;
597
+ }
598
+
599
+ export interface Params {
600
+ period: 7 | 9 | 14 | 21 | 25;
601
+ }
602
+ }
603
+
604
+ export interface RsiOversoldIndicatorSignal {
605
+ candle_date_time_utc: string;
606
+
607
+ code: string;
608
+
609
+ event_params: RsiOversoldIndicatorSignal.EventParams;
610
+
611
+ indicator: 'rsi';
612
+
613
+ params: RsiOversoldIndicatorSignal.Params;
614
+
615
+ stream_type: 'REALTIME';
616
+
617
+ /**
618
+ * Candle timeframe used to calculate an indicator
619
+ */
620
+ timeframe: IndicatorTimeframe;
621
+
622
+ timestamp: number;
623
+
624
+ trigger: 'oversold';
625
+
626
+ type: 'indicator_signal';
627
+
628
+ value: RsiOversoldIndicatorSignal.Value;
629
+ }
630
+
631
+ export namespace RsiOversoldIndicatorSignal {
632
+ export interface EventParams {
633
+ threshold: 20 | 30;
634
+ }
635
+
636
+ export interface Params {
637
+ period: 7 | 9 | 14 | 21 | 25;
638
+ }
639
+
640
+ export interface Value {
641
+ rsi: string;
642
+ }
643
+ }
644
+
645
+ export interface RsiOversoldIndicatorSignalRequest {
646
+ event_params: RsiOversoldIndicatorSignalRequest.EventParams;
647
+
648
+ params: RsiOversoldIndicatorSignalRequest.Params;
649
+
650
+ trigger: 'oversold';
651
+
652
+ type: 'rsi';
653
+ }
654
+
655
+ export namespace RsiOversoldIndicatorSignalRequest {
656
+ export interface EventParams {
657
+ threshold: 20 | 30;
658
+ }
659
+
660
+ export interface Params {
661
+ period: 7 | 9 | 14 | 21 | 25;
662
+ }
663
+ }
664
+
665
+ export interface SimpleBollingerBandsIndicator {
666
+ cd: string;
667
+
668
+ cdttmu: string;
669
+
670
+ ind: 'bollinger_bands';
671
+
672
+ p: SimpleBollingerBandsIndicator.P;
673
+
674
+ st: 'REALTIME';
675
+
676
+ /**
677
+ * Candle timeframe used to calculate an indicator
678
+ */
679
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
680
+
681
+ tms: number;
682
+
683
+ ty: 'indicator';
684
+
685
+ v: SimpleBollingerBandsIndicator.V;
686
+ }
687
+
688
+ export namespace SimpleBollingerBandsIndicator {
689
+ export interface P {
690
+ m: 1 | 1.5 | 2 | 2.5 | 3;
691
+
692
+ p: 10 | 20 | 50;
693
+ }
694
+
695
+ export interface V {
696
+ bbl: string;
697
+
698
+ bbm: string;
699
+
700
+ bbu: string;
701
+ }
702
+ }
703
+
704
+ export interface SimpleBollingerBandsIndicatorSignal {
705
+ cd: string;
706
+
707
+ cdttmu: string;
708
+
709
+ /**
710
+ * Empty condition parameters for a trigger without event parameters
711
+ */
712
+ ep: { [key: string]: unknown };
713
+
714
+ ind: 'bollinger_bands';
715
+
716
+ p: SimpleBollingerBandsIndicatorSignal.P;
717
+
718
+ st: 'REALTIME';
719
+
720
+ /**
721
+ * Candle timeframe used to calculate an indicator
722
+ */
723
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
724
+
725
+ tms: number;
726
+
727
+ tr: 'price_cross_above' | 'price_cross_below';
728
+
729
+ ty: 'indicator_signal';
730
+
731
+ v: SimpleBollingerBandsIndicatorSignal.V;
732
+ }
733
+
734
+ export namespace SimpleBollingerBandsIndicatorSignal {
735
+ export interface P {
736
+ m: 1.5 | 2 | 2.5;
737
+
738
+ p: 20;
739
+ }
740
+
741
+ export interface V {
742
+ bbl: string;
743
+
744
+ bbm: string;
745
+
746
+ bbu: string;
747
+ }
748
+ }
749
+
750
+ export type SimpleInfoServerEvent =
751
+ | SimpleVolumeIndicator
752
+ | SimpleRsiIndicator
753
+ | SimpleMovingAverageIndicator
754
+ | SimpleMaCrossoverIndicator
755
+ | SimpleBollingerBandsIndicator
756
+ | SimpleMacdIndicator
757
+ | SimpleVolumeIndicatorSignal
758
+ | SimpleRsiOverboughtIndicatorSignal
759
+ | SimpleRsiOversoldIndicatorSignal
760
+ | SimpleMovingAverageIndicatorSignal
761
+ | SimpleMaCrossoverIndicatorSignal
762
+ | SimpleBollingerBandsIndicatorSignal
763
+ | SimpleMacdIndicatorSignal;
764
+
765
+ export interface SimpleMaCrossoverIndicator {
766
+ cd: string;
767
+
768
+ cdttmu: string;
769
+
770
+ ind: 'ma_crossover';
771
+
772
+ p:
773
+ | SimpleMaCrossoverIndicator.WsSimpleMaCrossoverIndicatorParams5_20
774
+ | SimpleMaCrossoverIndicator.WsSimpleMaCrossoverIndicatorParams20_60
775
+ | SimpleMaCrossoverIndicator.WsSimpleMaCrossoverIndicatorParams30_90
776
+ | SimpleMaCrossoverIndicator.WsSimpleMaCrossoverIndicatorParams50_200;
777
+
778
+ st: 'REALTIME';
779
+
780
+ /**
781
+ * Candle timeframe used to calculate an indicator
782
+ */
783
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
784
+
785
+ tms: number;
786
+
787
+ ty: 'indicator';
788
+
789
+ v: SimpleMaCrossoverIndicator.V;
790
+ }
791
+
792
+ export namespace SimpleMaCrossoverIndicator {
793
+ export interface WsSimpleMaCrossoverIndicatorParams5_20 {
794
+ lop: 20;
795
+
796
+ shp: 5;
797
+
798
+ /**
799
+ * Moving average calculation type
800
+ */
801
+ t: 'SMA' | 'EMA';
802
+ }
803
+
804
+ export interface WsSimpleMaCrossoverIndicatorParams20_60 {
805
+ lop: 60;
806
+
807
+ shp: 20;
808
+
809
+ /**
810
+ * Moving average calculation type
811
+ */
812
+ t: 'SMA' | 'EMA';
813
+ }
814
+
815
+ export interface WsSimpleMaCrossoverIndicatorParams30_90 {
816
+ lop: 90;
817
+
818
+ shp: 30;
819
+
820
+ /**
821
+ * Moving average calculation type
822
+ */
823
+ t: 'SMA' | 'EMA';
824
+ }
825
+
826
+ export interface WsSimpleMaCrossoverIndicatorParams50_200 {
827
+ lop: 200;
828
+
829
+ shp: 50;
830
+
831
+ /**
832
+ * Moving average calculation type
833
+ */
834
+ t: 'SMA' | 'EMA';
835
+ }
836
+
837
+ export interface V {
838
+ mal: string;
839
+
840
+ mas: string;
841
+ }
842
+ }
843
+
844
+ export interface SimpleMaCrossoverIndicatorSignal {
845
+ cd: string;
846
+
847
+ cdttmu: string;
848
+
849
+ /**
850
+ * Empty condition parameters for a trigger without event parameters
851
+ */
852
+ ep: { [key: string]: unknown };
853
+
854
+ ind: 'ma_crossover';
855
+
856
+ p:
857
+ | SimpleMaCrossoverIndicatorSignal.WsSimpleIndicatorSignalMaCrossoverParams5_20
858
+ | SimpleMaCrossoverIndicatorSignal.WsSimpleIndicatorSignalMaCrossoverParams20_60
859
+ | SimpleMaCrossoverIndicatorSignal.WsSimpleIndicatorSignalMaCrossoverParams30_90
860
+ | SimpleMaCrossoverIndicatorSignal.WsSimpleIndicatorSignalMaCrossoverParams50_200;
861
+
862
+ st: 'REALTIME';
863
+
864
+ /**
865
+ * Candle timeframe used to calculate an indicator
866
+ */
867
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
868
+
869
+ tms: number;
870
+
871
+ tr: 'golden_cross' | 'dead_cross';
872
+
873
+ ty: 'indicator_signal';
874
+
875
+ v: SimpleMaCrossoverIndicatorSignal.V;
876
+ }
877
+
878
+ export namespace SimpleMaCrossoverIndicatorSignal {
879
+ export interface WsSimpleIndicatorSignalMaCrossoverParams5_20 {
880
+ lop: 20;
881
+
882
+ shp: 5;
883
+
884
+ /**
885
+ * Moving average calculation type
886
+ */
887
+ t: 'SMA' | 'EMA';
888
+ }
889
+
890
+ export interface WsSimpleIndicatorSignalMaCrossoverParams20_60 {
891
+ lop: 60;
892
+
893
+ shp: 20;
894
+
895
+ /**
896
+ * Moving average calculation type
897
+ */
898
+ t: 'SMA' | 'EMA';
899
+ }
900
+
901
+ export interface WsSimpleIndicatorSignalMaCrossoverParams30_90 {
902
+ lop: 90;
903
+
904
+ shp: 30;
905
+
906
+ /**
907
+ * Moving average calculation type
908
+ */
909
+ t: 'SMA' | 'EMA';
910
+ }
911
+
912
+ export interface WsSimpleIndicatorSignalMaCrossoverParams50_200 {
913
+ lop: 200;
914
+
915
+ shp: 50;
916
+
917
+ /**
918
+ * Moving average calculation type
919
+ */
920
+ t: 'SMA' | 'EMA';
921
+ }
922
+
923
+ export interface V {
924
+ mal: string;
925
+
926
+ mas: string;
927
+ }
928
+ }
929
+
930
+ export interface SimpleMacdIndicator {
931
+ cd: string;
932
+
933
+ cdttmu: string;
934
+
935
+ ind: 'macd';
936
+
937
+ p:
938
+ | SimpleMacdIndicator.WsSimpleMacdIndicatorParams12_26_9
939
+ | SimpleMacdIndicator.WsSimpleMacdIndicatorParams8_17_9
940
+ | SimpleMacdIndicator.WsSimpleMacdIndicatorParams5_35_5;
941
+
942
+ st: 'REALTIME';
943
+
944
+ /**
945
+ * Candle timeframe used to calculate an indicator
946
+ */
947
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
948
+
949
+ tms: number;
950
+
951
+ ty: 'indicator';
952
+
953
+ v: SimpleMacdIndicator.V;
954
+ }
955
+
956
+ export namespace SimpleMacdIndicator {
957
+ export interface WsSimpleMacdIndicatorParams12_26_9 {
958
+ f: 12;
959
+
960
+ s: 26;
961
+
962
+ sgp: 9;
963
+ }
964
+
965
+ export interface WsSimpleMacdIndicatorParams8_17_9 {
966
+ f: 8;
967
+
968
+ s: 17;
969
+
970
+ sgp: 9;
971
+ }
972
+
973
+ export interface WsSimpleMacdIndicatorParams5_35_5 {
974
+ f: 5;
975
+
976
+ s: 35;
977
+
978
+ sgp: 5;
979
+ }
980
+
981
+ export interface V {
982
+ hist: string;
983
+
984
+ macd: string;
985
+
986
+ macds: string;
987
+ }
988
+ }
989
+
990
+ export interface SimpleMacdIndicatorSignal {
991
+ cd: string;
992
+
993
+ cdttmu: string;
994
+
995
+ /**
996
+ * Empty condition parameters for a trigger without event parameters
997
+ */
998
+ ep: { [key: string]: unknown };
999
+
1000
+ ind: 'macd';
1001
+
1002
+ p:
1003
+ | SimpleMacdIndicatorSignal.WsSimpleIndicatorSignalMacdParams12_26_9
1004
+ | SimpleMacdIndicatorSignal.WsSimpleIndicatorSignalMacdParams8_17_9
1005
+ | SimpleMacdIndicatorSignal.WsSimpleIndicatorSignalMacdParams5_35_5;
1006
+
1007
+ st: 'REALTIME';
1008
+
1009
+ /**
1010
+ * Candle timeframe used to calculate an indicator
1011
+ */
1012
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1013
+
1014
+ tms: number;
1015
+
1016
+ tr: 'golden_cross' | 'dead_cross' | 'zero_cross_above' | 'zero_cross_below';
1017
+
1018
+ ty: 'indicator_signal';
1019
+
1020
+ v: SimpleMacdIndicatorSignal.V;
1021
+ }
1022
+
1023
+ export namespace SimpleMacdIndicatorSignal {
1024
+ export interface WsSimpleIndicatorSignalMacdParams12_26_9 {
1025
+ f: 12;
1026
+
1027
+ s: 26;
1028
+
1029
+ sgp: 9;
1030
+ }
1031
+
1032
+ export interface WsSimpleIndicatorSignalMacdParams8_17_9 {
1033
+ f: 8;
1034
+
1035
+ s: 17;
1036
+
1037
+ sgp: 9;
1038
+ }
1039
+
1040
+ export interface WsSimpleIndicatorSignalMacdParams5_35_5 {
1041
+ f: 5;
1042
+
1043
+ s: 35;
1044
+
1045
+ sgp: 5;
1046
+ }
1047
+
1048
+ export interface V {
1049
+ hist: string;
1050
+
1051
+ macd: string;
1052
+
1053
+ macds: string;
1054
+ }
1055
+ }
1056
+
1057
+ export interface SimpleMovingAverageIndicator {
1058
+ cd: string;
1059
+
1060
+ cdttmu: string;
1061
+
1062
+ ind: 'moving_average';
1063
+
1064
+ p: SimpleMovingAverageIndicator.P;
1065
+
1066
+ st: 'REALTIME';
1067
+
1068
+ /**
1069
+ * Candle timeframe used to calculate an indicator
1070
+ */
1071
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1072
+
1073
+ tms: number;
1074
+
1075
+ ty: 'indicator';
1076
+
1077
+ v: SimpleMovingAverageIndicator.V;
1078
+ }
1079
+
1080
+ export namespace SimpleMovingAverageIndicator {
1081
+ export interface P {
1082
+ p: 3 | 5 | 7 | 10 | 15 | 20 | 25 | 30 | 50 | 60 | 90 | 99 | 100 | 120 | 200;
1083
+
1084
+ /**
1085
+ * Moving average calculation type
1086
+ */
1087
+ t: 'SMA' | 'EMA';
1088
+ }
1089
+
1090
+ export interface V {
1091
+ value: string;
1092
+ }
1093
+ }
1094
+
1095
+ export interface SimpleMovingAverageIndicatorSignal {
1096
+ cd: string;
1097
+
1098
+ cdttmu: string;
1099
+
1100
+ /**
1101
+ * Empty condition parameters for a trigger without event parameters
1102
+ */
1103
+ ep: { [key: string]: unknown };
1104
+
1105
+ ind: 'moving_average';
1106
+
1107
+ p: SimpleMovingAverageIndicatorSignal.P;
1108
+
1109
+ st: 'REALTIME';
1110
+
1111
+ /**
1112
+ * Candle timeframe used to calculate an indicator
1113
+ */
1114
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1115
+
1116
+ tms: number;
1117
+
1118
+ tr: 'price_cross_above' | 'price_cross_below';
1119
+
1120
+ ty: 'indicator_signal';
1121
+
1122
+ v: SimpleMovingAverageIndicatorSignal.V;
1123
+ }
1124
+
1125
+ export namespace SimpleMovingAverageIndicatorSignal {
1126
+ export interface P {
1127
+ p: 5 | 10 | 20 | 30 | 60 | 90 | 120 | 200;
1128
+
1129
+ /**
1130
+ * Moving average calculation type
1131
+ */
1132
+ t: 'SMA' | 'EMA';
1133
+ }
1134
+
1135
+ export interface V {
1136
+ value: string;
1137
+ }
1138
+ }
1139
+
1140
+ export interface SimpleRsiIndicator {
1141
+ cd: string;
1142
+
1143
+ cdttmu: string;
1144
+
1145
+ ind: 'rsi';
1146
+
1147
+ p: SimpleRsiIndicator.P;
1148
+
1149
+ st: 'REALTIME';
1150
+
1151
+ /**
1152
+ * Candle timeframe used to calculate an indicator
1153
+ */
1154
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1155
+
1156
+ tms: number;
1157
+
1158
+ ty: 'indicator';
1159
+
1160
+ v: SimpleRsiIndicator.V;
1161
+ }
1162
+
1163
+ export namespace SimpleRsiIndicator {
1164
+ export interface P {
1165
+ p: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 25;
1166
+ }
1167
+
1168
+ export interface V {
1169
+ rsi: string;
1170
+ }
1171
+ }
1172
+
1173
+ export interface SimpleRsiOverboughtIndicatorSignal {
1174
+ cd: string;
1175
+
1176
+ cdttmu: string;
1177
+
1178
+ ep: SimpleRsiOverboughtIndicatorSignal.Ep;
1179
+
1180
+ ind: 'rsi';
1181
+
1182
+ p: SimpleRsiOverboughtIndicatorSignal.P;
1183
+
1184
+ st: 'REALTIME';
1185
+
1186
+ /**
1187
+ * Candle timeframe used to calculate an indicator
1188
+ */
1189
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1190
+
1191
+ tms: number;
1192
+
1193
+ tr: 'overbought';
1194
+
1195
+ ty: 'indicator_signal';
1196
+
1197
+ v: SimpleRsiOverboughtIndicatorSignal.V;
1198
+ }
1199
+
1200
+ export namespace SimpleRsiOverboughtIndicatorSignal {
1201
+ export interface Ep {
1202
+ th: 70 | 80;
1203
+ }
1204
+
1205
+ export interface P {
1206
+ p: 7 | 9 | 14 | 21 | 25;
1207
+ }
1208
+
1209
+ export interface V {
1210
+ rsi: string;
1211
+ }
1212
+ }
1213
+
1214
+ export interface SimpleRsiOversoldIndicatorSignal {
1215
+ cd: string;
1216
+
1217
+ cdttmu: string;
1218
+
1219
+ ep: SimpleRsiOversoldIndicatorSignal.Ep;
1220
+
1221
+ ind: 'rsi';
1222
+
1223
+ p: SimpleRsiOversoldIndicatorSignal.P;
1224
+
1225
+ st: 'REALTIME';
1226
+
1227
+ /**
1228
+ * Candle timeframe used to calculate an indicator
1229
+ */
1230
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1231
+
1232
+ tms: number;
1233
+
1234
+ tr: 'oversold';
1235
+
1236
+ ty: 'indicator_signal';
1237
+
1238
+ v: SimpleRsiOversoldIndicatorSignal.V;
1239
+ }
1240
+
1241
+ export namespace SimpleRsiOversoldIndicatorSignal {
1242
+ export interface Ep {
1243
+ th: 20 | 30;
1244
+ }
1245
+
1246
+ export interface P {
1247
+ p: 7 | 9 | 14 | 21 | 25;
1248
+ }
1249
+
1250
+ export interface V {
1251
+ rsi: string;
1252
+ }
1253
+ }
1254
+
1255
+ export interface SimpleVolumeIndicator {
1256
+ cd: string;
1257
+
1258
+ cdttmu: string;
1259
+
1260
+ ind: 'volume';
1261
+
1262
+ p: SimpleVolumeIndicator.P;
1263
+
1264
+ st: 'REALTIME';
1265
+
1266
+ /**
1267
+ * Candle timeframe used to calculate an indicator
1268
+ */
1269
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1270
+
1271
+ tms: number;
1272
+
1273
+ ty: 'indicator';
1274
+
1275
+ v: SimpleVolumeIndicator.V;
1276
+ }
1277
+
1278
+ export namespace SimpleVolumeIndicator {
1279
+ export interface P {
1280
+ p: 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50;
1281
+ }
1282
+
1283
+ export interface V {
1284
+ av: string;
1285
+
1286
+ rto: string;
1287
+
1288
+ vol: string;
1289
+ }
1290
+ }
1291
+
1292
+ export interface SimpleVolumeIndicatorSignal {
1293
+ cd: string;
1294
+
1295
+ cdttmu: string;
1296
+
1297
+ ep: SimpleVolumeIndicatorSignal.Ep;
1298
+
1299
+ ind: 'volume';
1300
+
1301
+ p: SimpleVolumeIndicatorSignal.P;
1302
+
1303
+ st: 'REALTIME';
1304
+
1305
+ /**
1306
+ * Candle timeframe used to calculate an indicator
1307
+ */
1308
+ tf: '5m' | '15m' | '60m' | '240m' | '1d';
1309
+
1310
+ tms: number;
1311
+
1312
+ tr: 'volume_spike';
1313
+
1314
+ ty: 'indicator_signal';
1315
+
1316
+ v: SimpleVolumeIndicatorSignal.V;
1317
+ }
1318
+
1319
+ export namespace SimpleVolumeIndicatorSignal {
1320
+ export interface Ep {
1321
+ mul: 2 | 3 | 5;
1322
+ }
1323
+
1324
+ export interface P {
1325
+ p: 10 | 20 | 50;
1326
+ }
1327
+
1328
+ export interface V {
1329
+ av: string;
1330
+
1331
+ rto: string;
1332
+
1333
+ vol: string;
1334
+ }
1335
+ }
1336
+
1337
+ export interface VolumeIndicator {
1338
+ candle_date_time_utc: string;
1339
+
1340
+ code: string;
1341
+
1342
+ indicator: 'volume';
1343
+
1344
+ params: VolumeIndicator.Params;
1345
+
1346
+ stream_type: 'REALTIME';
1347
+
1348
+ /**
1349
+ * Candle timeframe used to calculate an indicator
1350
+ */
1351
+ timeframe: IndicatorTimeframe;
1352
+
1353
+ timestamp: number;
1354
+
1355
+ type: 'indicator';
1356
+
1357
+ value: VolumeIndicator.Value;
1358
+ }
1359
+
1360
+ export namespace VolumeIndicator {
1361
+ export interface Params {
1362
+ period: 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50;
1363
+ }
1364
+
1365
+ export interface Value {
1366
+ avg_volume: string;
1367
+
1368
+ ratio: string;
1369
+
1370
+ volume: string;
1371
+ }
1372
+ }
1373
+
1374
+ export interface VolumeIndicatorSignal {
1375
+ candle_date_time_utc: string;
1376
+
1377
+ code: string;
1378
+
1379
+ event_params: VolumeIndicatorSignal.EventParams;
1380
+
1381
+ indicator: 'volume';
1382
+
1383
+ params: VolumeIndicatorSignal.Params;
1384
+
1385
+ stream_type: 'REALTIME';
1386
+
1387
+ /**
1388
+ * Candle timeframe used to calculate an indicator
1389
+ */
1390
+ timeframe: IndicatorTimeframe;
1391
+
1392
+ timestamp: number;
1393
+
1394
+ trigger: 'volume_spike';
1395
+
1396
+ type: 'indicator_signal';
1397
+
1398
+ value: VolumeIndicatorSignal.Value;
1399
+ }
1400
+
1401
+ export namespace VolumeIndicatorSignal {
1402
+ export interface EventParams {
1403
+ multiplier: 2 | 3 | 5;
1404
+ }
1405
+
1406
+ export interface Params {
1407
+ period: 10 | 20 | 50;
1408
+ }
1409
+
1410
+ export interface Value {
1411
+ avg_volume: string;
1412
+
1413
+ ratio: string;
1414
+
1415
+ volume: string;
1416
+ }
1417
+ }
1418
+
1419
+ export type ConnectInfoClientEvent = Array<
1420
+ | ConnectInfoClientEvent.WsTicketField
1421
+ | ConnectInfoClientEvent.WsIndicatorTypeField
1422
+ | ConnectInfoClientEvent.WsIndicatorFormatField
1423
+ | ConnectInfoClientEvent.WsIndicatorSignalTypeField
1424
+ >;
1425
+
1426
+ export namespace ConnectInfoClientEvent {
1427
+ /**
1428
+ * Ticket field that identifies the requester
1429
+ */
1430
+ export interface WsTicketField {
1431
+ /**
1432
+ * A value that uniquely identifies the requester (UUID recommended)
1433
+ */
1434
+ ticket: string;
1435
+ }
1436
+
1437
+ /**
1438
+ * Indicator subscription data type object
1439
+ */
1440
+ export interface WsIndicatorTypeField {
1441
+ /**
1442
+ * KRW market codes to subscribe to
1443
+ */
1444
+ codes: Array<string>;
1445
+
1446
+ indicators: Array<
1447
+ | WsIndicatorTypeField.Volume
1448
+ | WsIndicatorTypeField.Rsi
1449
+ | WsIndicatorTypeField.MovingAverage
1450
+ | WsIndicatorTypeField.MaCrossover
1451
+ | WsIndicatorTypeField.BollingerBands
1452
+ | WsIndicatorTypeField.Macd
1453
+ >;
1454
+
1455
+ /**
1456
+ * Candle timeframe used to calculate an indicator
1457
+ */
1458
+ timeframe: WsInfoAPI.IndicatorTimeframe;
1459
+
1460
+ type: 'indicator';
1461
+ }
1462
+
1463
+ export namespace WsIndicatorTypeField {
1464
+ export interface Volume {
1465
+ params: Volume.Params;
1466
+
1467
+ type: 'volume';
1468
+ }
1469
+
1470
+ export namespace Volume {
1471
+ export interface Params {
1472
+ period: 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50;
1473
+ }
1474
+ }
1475
+
1476
+ export interface Rsi {
1477
+ params: Rsi.Params;
1478
+
1479
+ type: 'rsi';
1480
+ }
1481
+
1482
+ export namespace Rsi {
1483
+ export interface Params {
1484
+ period: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 25;
1485
+ }
1486
+ }
1487
+
1488
+ export interface MovingAverage {
1489
+ params: MovingAverage.Params;
1490
+
1491
+ type: 'moving_average';
1492
+ }
1493
+
1494
+ export namespace MovingAverage {
1495
+ export interface Params {
1496
+ period: 3 | 5 | 7 | 10 | 15 | 20 | 25 | 30 | 50 | 60 | 90 | 99 | 100 | 120 | 200;
1497
+
1498
+ /**
1499
+ * Moving average calculation type
1500
+ */
1501
+ type: 'SMA' | 'EMA';
1502
+ }
1503
+ }
1504
+
1505
+ export interface MaCrossover {
1506
+ params:
1507
+ | MaCrossover.WsMaCrossoverIndicatorParams5_20
1508
+ | MaCrossover.WsMaCrossoverIndicatorParams20_60
1509
+ | MaCrossover.WsMaCrossoverIndicatorParams30_90
1510
+ | MaCrossover.WsMaCrossoverIndicatorParams50_200;
1511
+
1512
+ type: 'ma_crossover';
1513
+ }
1514
+
1515
+ export namespace MaCrossover {
1516
+ export interface WsMaCrossoverIndicatorParams5_20 {
1517
+ long_period: 20;
1518
+
1519
+ short_period: 5;
1520
+
1521
+ /**
1522
+ * Moving average calculation type
1523
+ */
1524
+ type: 'SMA' | 'EMA';
1525
+ }
1526
+
1527
+ export interface WsMaCrossoverIndicatorParams20_60 {
1528
+ long_period: 60;
1529
+
1530
+ short_period: 20;
1531
+
1532
+ /**
1533
+ * Moving average calculation type
1534
+ */
1535
+ type: 'SMA' | 'EMA';
1536
+ }
1537
+
1538
+ export interface WsMaCrossoverIndicatorParams30_90 {
1539
+ long_period: 90;
1540
+
1541
+ short_period: 30;
1542
+
1543
+ /**
1544
+ * Moving average calculation type
1545
+ */
1546
+ type: 'SMA' | 'EMA';
1547
+ }
1548
+
1549
+ export interface WsMaCrossoverIndicatorParams50_200 {
1550
+ long_period: 200;
1551
+
1552
+ short_period: 50;
1553
+
1554
+ /**
1555
+ * Moving average calculation type
1556
+ */
1557
+ type: 'SMA' | 'EMA';
1558
+ }
1559
+ }
1560
+
1561
+ export interface BollingerBands {
1562
+ params: BollingerBands.Params;
1563
+
1564
+ type: 'bollinger_bands';
1565
+ }
1566
+
1567
+ export namespace BollingerBands {
1568
+ export interface Params {
1569
+ multiplier: 1 | 1.5 | 2 | 2.5 | 3;
1570
+
1571
+ period: 10 | 20 | 50;
1572
+ }
1573
+ }
1574
+
1575
+ export interface Macd {
1576
+ params:
1577
+ | Macd.WsMacdIndicatorParams12_26_9
1578
+ | Macd.WsMacdIndicatorParams8_17_9
1579
+ | Macd.WsMacdIndicatorParams5_35_5;
1580
+
1581
+ type: 'macd';
1582
+ }
1583
+
1584
+ export namespace Macd {
1585
+ export interface WsMacdIndicatorParams12_26_9 {
1586
+ fast: 12;
1587
+
1588
+ signal_period: 9;
1589
+
1590
+ slow: 26;
1591
+ }
1592
+
1593
+ export interface WsMacdIndicatorParams8_17_9 {
1594
+ fast: 8;
1595
+
1596
+ signal_period: 9;
1597
+
1598
+ slow: 17;
1599
+ }
1600
+
1601
+ export interface WsMacdIndicatorParams5_35_5 {
1602
+ fast: 5;
1603
+
1604
+ signal_period: 5;
1605
+
1606
+ slow: 35;
1607
+ }
1608
+ }
1609
+ }
1610
+
1611
+ /**
1612
+ * Response format specifier for indicator streams
1613
+ */
1614
+ export interface WsIndicatorFormatField {
1615
+ /**
1616
+ * Response format selector
1617
+ */
1618
+ format: 'DEFAULT' | 'SIMPLE' | 'JSON_LIST' | 'SIMPLE_LIST';
1619
+ }
1620
+
1621
+ /**
1622
+ * Indicator signal subscription data type object
1623
+ */
1624
+ export interface WsIndicatorSignalTypeField {
1625
+ /**
1626
+ * KRW market codes to subscribe to
1627
+ */
1628
+ codes: Array<string>;
1629
+
1630
+ indicators: Array<
1631
+ | WsIndicatorSignalTypeField.Volume
1632
+ | WsInfoAPI.RsiOverboughtIndicatorSignalRequest
1633
+ | WsInfoAPI.RsiOversoldIndicatorSignalRequest
1634
+ | WsIndicatorSignalTypeField.MovingAverage
1635
+ | WsIndicatorSignalTypeField.MaCrossover
1636
+ | WsIndicatorSignalTypeField.BollingerBands
1637
+ | WsIndicatorSignalTypeField.Macd
1638
+ >;
1639
+
1640
+ /**
1641
+ * Candle timeframe used to calculate an indicator
1642
+ */
1643
+ timeframe: WsInfoAPI.IndicatorTimeframe;
1644
+
1645
+ type: 'indicator_signal';
1646
+ }
1647
+
1648
+ export namespace WsIndicatorSignalTypeField {
1649
+ export interface Volume {
1650
+ event_params: Volume.EventParams;
1651
+
1652
+ params: Volume.Params;
1653
+
1654
+ trigger: 'volume_spike';
1655
+
1656
+ type: 'volume';
1657
+ }
1658
+
1659
+ export namespace Volume {
1660
+ export interface EventParams {
1661
+ multiplier: 2 | 3 | 5;
1662
+ }
1663
+
1664
+ export interface Params {
1665
+ period: 10 | 20 | 50;
1666
+ }
1667
+ }
1668
+
1669
+ export interface MovingAverage {
1670
+ params: MovingAverage.Params;
1671
+
1672
+ trigger: 'price_cross_above' | 'price_cross_below';
1673
+
1674
+ type: 'moving_average';
1675
+ }
1676
+
1677
+ export namespace MovingAverage {
1678
+ export interface Params {
1679
+ period: 5 | 10 | 20 | 30 | 60 | 90 | 120 | 200;
1680
+
1681
+ /**
1682
+ * Moving average calculation type
1683
+ */
1684
+ type: 'SMA' | 'EMA';
1685
+ }
1686
+ }
1687
+
1688
+ export interface MaCrossover {
1689
+ params:
1690
+ | MaCrossover.WsIndicatorSignalMaCrossoverParams5_20
1691
+ | MaCrossover.WsIndicatorSignalMaCrossoverParams20_60
1692
+ | MaCrossover.WsIndicatorSignalMaCrossoverParams30_90
1693
+ | MaCrossover.WsIndicatorSignalMaCrossoverParams50_200;
1694
+
1695
+ trigger: 'golden_cross' | 'dead_cross';
1696
+
1697
+ type: 'ma_crossover';
1698
+ }
1699
+
1700
+ export namespace MaCrossover {
1701
+ export interface WsIndicatorSignalMaCrossoverParams5_20 {
1702
+ long_period: 20;
1703
+
1704
+ short_period: 5;
1705
+
1706
+ /**
1707
+ * Moving average calculation type
1708
+ */
1709
+ type: 'SMA' | 'EMA';
1710
+ }
1711
+
1712
+ export interface WsIndicatorSignalMaCrossoverParams20_60 {
1713
+ long_period: 60;
1714
+
1715
+ short_period: 20;
1716
+
1717
+ /**
1718
+ * Moving average calculation type
1719
+ */
1720
+ type: 'SMA' | 'EMA';
1721
+ }
1722
+
1723
+ export interface WsIndicatorSignalMaCrossoverParams30_90 {
1724
+ long_period: 90;
1725
+
1726
+ short_period: 30;
1727
+
1728
+ /**
1729
+ * Moving average calculation type
1730
+ */
1731
+ type: 'SMA' | 'EMA';
1732
+ }
1733
+
1734
+ export interface WsIndicatorSignalMaCrossoverParams50_200 {
1735
+ long_period: 200;
1736
+
1737
+ short_period: 50;
1738
+
1739
+ /**
1740
+ * Moving average calculation type
1741
+ */
1742
+ type: 'SMA' | 'EMA';
1743
+ }
1744
+ }
1745
+
1746
+ export interface BollingerBands {
1747
+ params: BollingerBands.Params;
1748
+
1749
+ trigger: 'price_cross_above' | 'price_cross_below';
1750
+
1751
+ type: 'bollinger_bands';
1752
+ }
1753
+
1754
+ export namespace BollingerBands {
1755
+ export interface Params {
1756
+ multiplier: 1.5 | 2 | 2.5;
1757
+
1758
+ period: 20;
1759
+ }
1760
+ }
1761
+
1762
+ export interface Macd {
1763
+ params:
1764
+ | Macd.WsIndicatorSignalMacdParams12_26_9
1765
+ | Macd.WsIndicatorSignalMacdParams8_17_9
1766
+ | Macd.WsIndicatorSignalMacdParams5_35_5;
1767
+
1768
+ trigger: 'golden_cross' | 'dead_cross' | 'zero_cross_above' | 'zero_cross_below';
1769
+
1770
+ type: 'macd';
1771
+ }
1772
+
1773
+ export namespace Macd {
1774
+ export interface WsIndicatorSignalMacdParams12_26_9 {
1775
+ fast: 12;
1776
+
1777
+ signal_period: 9;
1778
+
1779
+ slow: 26;
1780
+ }
1781
+
1782
+ export interface WsIndicatorSignalMacdParams8_17_9 {
1783
+ fast: 8;
1784
+
1785
+ signal_period: 9;
1786
+
1787
+ slow: 17;
1788
+ }
1789
+
1790
+ export interface WsIndicatorSignalMacdParams5_35_5 {
1791
+ fast: 5;
1792
+
1793
+ signal_period: 5;
1794
+
1795
+ slow: 35;
1796
+ }
1797
+ }
1798
+ }
1799
+ }
1800
+
1801
+ export type ConnectInfoServerEvent =
1802
+ | VolumeIndicator
1803
+ | RsiIndicator
1804
+ | MovingAverageIndicator
1805
+ | MaCrossoverIndicator
1806
+ | BollingerBandsIndicator
1807
+ | MacdIndicator
1808
+ | VolumeIndicatorSignal
1809
+ | RsiOverboughtIndicatorSignal
1810
+ | RsiOversoldIndicatorSignal
1811
+ | MovingAverageIndicatorSignal
1812
+ | MaCrossoverIndicatorSignal
1813
+ | BollingerBandsIndicatorSignal
1814
+ | MacdIndicatorSignal;
1815
+
1816
+ export declare namespace WsInfo {
1817
+ export {
1818
+ type BollingerBandsIndicator as BollingerBandsIndicator,
1819
+ type BollingerBandsIndicatorSignal as BollingerBandsIndicatorSignal,
1820
+ type Indicator as Indicator,
1821
+ type IndicatorSignal as IndicatorSignal,
1822
+ type IndicatorTimeframe as IndicatorTimeframe,
1823
+ type IndicatorType as IndicatorType,
1824
+ type MaCrossoverIndicator as MaCrossoverIndicator,
1825
+ type MaCrossoverIndicatorSignal as MaCrossoverIndicatorSignal,
1826
+ type MacdIndicator as MacdIndicator,
1827
+ type MacdIndicatorSignal as MacdIndicatorSignal,
1828
+ type MovingAverageIndicator as MovingAverageIndicator,
1829
+ type MovingAverageIndicatorSignal as MovingAverageIndicatorSignal,
1830
+ type RsiIndicator as RsiIndicator,
1831
+ type RsiIndicatorSignal as RsiIndicatorSignal,
1832
+ type RsiOverboughtIndicatorSignal as RsiOverboughtIndicatorSignal,
1833
+ type RsiOverboughtIndicatorSignalRequest as RsiOverboughtIndicatorSignalRequest,
1834
+ type RsiOversoldIndicatorSignal as RsiOversoldIndicatorSignal,
1835
+ type RsiOversoldIndicatorSignalRequest as RsiOversoldIndicatorSignalRequest,
1836
+ type SimpleBollingerBandsIndicator as SimpleBollingerBandsIndicator,
1837
+ type SimpleBollingerBandsIndicatorSignal as SimpleBollingerBandsIndicatorSignal,
1838
+ type SimpleInfoServerEvent as SimpleInfoServerEvent,
1839
+ type SimpleMaCrossoverIndicator as SimpleMaCrossoverIndicator,
1840
+ type SimpleMaCrossoverIndicatorSignal as SimpleMaCrossoverIndicatorSignal,
1841
+ type SimpleMacdIndicator as SimpleMacdIndicator,
1842
+ type SimpleMacdIndicatorSignal as SimpleMacdIndicatorSignal,
1843
+ type SimpleMovingAverageIndicator as SimpleMovingAverageIndicator,
1844
+ type SimpleMovingAverageIndicatorSignal as SimpleMovingAverageIndicatorSignal,
1845
+ type SimpleRsiIndicator as SimpleRsiIndicator,
1846
+ type SimpleRsiOverboughtIndicatorSignal as SimpleRsiOverboughtIndicatorSignal,
1847
+ type SimpleRsiOversoldIndicatorSignal as SimpleRsiOversoldIndicatorSignal,
1848
+ type SimpleVolumeIndicator as SimpleVolumeIndicator,
1849
+ type SimpleVolumeIndicatorSignal as SimpleVolumeIndicatorSignal,
1850
+ type VolumeIndicator as VolumeIndicator,
1851
+ type VolumeIndicatorSignal as VolumeIndicatorSignal,
1852
+ type ConnectInfoClientEvent as ConnectInfoClientEvent,
1853
+ type ConnectInfoServerEvent as ConnectInfoServerEvent,
1854
+ };
1855
+ }