ohlcv-indicators 3.4.6 → 3.4.7
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/ohlcv-indicators.min.js +715 -683
- package/index.js +40 -9
- package/package.json +1 -1
- package/src/utilities/dateUtilities.js +7 -0
- package/src/utilities/verticalToHorizontal.js +16 -8
|
@@ -130,7 +130,7 @@ var OHLCV_INDICATORS;
|
|
|
130
130
|
t.r(e),
|
|
131
131
|
// EXPORTS
|
|
132
132
|
t.d(e, {
|
|
133
|
-
default: () => /* binding */
|
|
133
|
+
default: () => /* binding */ Ir
|
|
134
134
|
});
|
|
135
135
|
var u = function(t, e) {
|
|
136
136
|
if (!Array.isArray(t)) throw new Error('Property "inputParams" must be an "Array" or "Set".');
|
|
@@ -162,7 +162,11 @@ var OHLCV_INDICATORS;
|
|
|
162
162
|
}, s = function(t, e, r) {
|
|
163
163
|
if (!Boolean(t) || "object" == !n(t)) throw new Error('Param "'.concat(e, '" must be an object in "').concat(r, '".'));
|
|
164
164
|
return !0;
|
|
165
|
-
}, f = function(t, e, r) {
|
|
165
|
+
}, f = function(t, e, r, n) {
|
|
166
|
+
if (c(t, "arrayOptions", "".concat(n, ".").concat(r, ".validateArrayOptions")),
|
|
167
|
+
!t.includes(e.toString())) throw new Error('Param "'.concat(r, '" must be any of the following values [').concat(t.join(", "), '] in "').concat(n, '".'));
|
|
168
|
+
return !0;
|
|
169
|
+
}, y = function(t, e, r) {
|
|
166
170
|
if ("boolean" != typeof t) throw new Error('Param "'.concat(e, '" must be an boolean in "').concat(r, '".'));
|
|
167
171
|
return !0;
|
|
168
172
|
}, h = function(t, e, r, n) {
|
|
@@ -175,14 +179,14 @@ var OHLCV_INDICATORS;
|
|
|
175
179
|
return !0;
|
|
176
180
|
}, // 0, 1, 2 or 3
|
|
177
181
|
// The maximum value of DP and Big.DP.
|
|
178
|
-
|
|
182
|
+
p = 1e6, // 0 to 1000000
|
|
179
183
|
// The maximum magnitude of the exponent argument to the pow method.
|
|
180
|
-
|
|
184
|
+
v = 1e6, // true or false
|
|
181
185
|
/**************************************************************************************************/
|
|
182
186
|
// Error messages.
|
|
183
|
-
|
|
187
|
+
m = "[big.js] ", d = m + "Invalid ", b = d + "decimal places", g = d + "rounding mode", w = m + "Division by zero",
|
|
184
188
|
// The shared prototype object.
|
|
185
|
-
|
|
189
|
+
S = {}, O = void 0, j = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
186
190
|
/*
|
|
187
191
|
* Round Big x to a maximum of sd significant digits using rounding mode rm.
|
|
188
192
|
*
|
|
@@ -191,10 +195,10 @@ var OHLCV_INDICATORS;
|
|
|
191
195
|
* rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
192
196
|
* [more] {boolean} Whether the result of division was truncated.
|
|
193
197
|
*/
|
|
194
|
-
function
|
|
198
|
+
function P(t, e, r, n) {
|
|
195
199
|
var o = t.c;
|
|
196
|
-
if (r ===
|
|
197
|
-
if (e < 1) n = 3 === r && (n || !!o[0]) || 0 === e && (1 === r && o[0] >= 5 || 2 === r && (o[0] > 5 || 5 === o[0] && (n || o[1] !==
|
|
200
|
+
if (r === O && (r = t.constructor.RM), 0 !== r && 1 !== r && 2 !== r && 3 !== r) throw Error(g);
|
|
201
|
+
if (e < 1) n = 3 === r && (n || !!o[0]) || 0 === e && (1 === r && o[0] >= 5 || 2 === r && (o[0] > 5 || 5 === o[0] && (n || o[1] !== O))),
|
|
198
202
|
o.length = 1, n ? (
|
|
199
203
|
// 1, 0.1, 0.01, 0.001, 0.0001 etc.
|
|
200
204
|
t.e = t.e - e + 1, o[0] = 1) :
|
|
@@ -203,7 +207,7 @@ var OHLCV_INDICATORS;
|
|
|
203
207
|
// Round up?
|
|
204
208
|
if (
|
|
205
209
|
// xc[sd] is the digit after the digit that may be rounded up.
|
|
206
|
-
n = 1 === r && o[e] >= 5 || 2 === r && (o[e] > 5 || 5 === o[e] && (n || o[e + 1] !==
|
|
210
|
+
n = 1 === r && o[e] >= 5 || 2 === r && (o[e] > 5 || 5 === o[e] && (n || o[e + 1] !== O || 1 & o[e - 1])) || 3 === r && (n || !!o[0]),
|
|
207
211
|
// Remove any digits after the required precision.
|
|
208
212
|
o.length = e, n)
|
|
209
213
|
// Rounding up may mean the previous digit has to be rounded up.
|
|
@@ -219,7 +223,7 @@ var OHLCV_INDICATORS;
|
|
|
219
223
|
/*
|
|
220
224
|
* Return a string representing the value of Big x in normal or exponential notation.
|
|
221
225
|
* Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.
|
|
222
|
-
*/ function
|
|
226
|
+
*/ function _(t, e, r) {
|
|
223
227
|
var n = t.e, o = t.c.join(""), i = o.length;
|
|
224
228
|
// Exponential notation?
|
|
225
229
|
if (e) o = o.charAt(0) + (i > 1 ? "." + o.slice(1) : "") + (n < 0 ? "e" : "e+") + n;
|
|
@@ -233,7 +237,7 @@ var OHLCV_INDICATORS;
|
|
|
233
237
|
// Prototype/instance methods
|
|
234
238
|
/*
|
|
235
239
|
* Return a new Big whose value is the absolute value of this Big.
|
|
236
|
-
*/
|
|
240
|
+
*/ S.abs = function() {
|
|
237
241
|
var t = new this.constructor(this);
|
|
238
242
|
return t.s = 1, t;
|
|
239
243
|
},
|
|
@@ -242,7 +246,7 @@ var OHLCV_INDICATORS;
|
|
|
242
246
|
* -1 if the value of this Big is less than the value of Big y, or
|
|
243
247
|
* 0 if they have the same value.
|
|
244
248
|
*/
|
|
245
|
-
|
|
249
|
+
S.cmp = function(t) {
|
|
246
250
|
var e, r = this, n = r.c, o = (t = new r.constructor(t)).c, i = r.s, a = t.s, u = r.e, l = t.e;
|
|
247
251
|
// Either zero?
|
|
248
252
|
if (!n[0] || !o[0]) return n[0] ? i : o[0] ? -a : 0;
|
|
@@ -259,28 +263,28 @@ var OHLCV_INDICATORS;
|
|
|
259
263
|
* Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,
|
|
260
264
|
* if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
|
|
261
265
|
*/
|
|
262
|
-
|
|
266
|
+
S.div = function(t) {
|
|
263
267
|
var e = this, r = e.constructor, n = e.c, // dividend
|
|
264
268
|
o = (t = new r(t)).c, // divisor
|
|
265
269
|
i = e.s == t.s ? 1 : -1, a = r.DP;
|
|
266
|
-
if (a !== ~~a || a < 0 || a >
|
|
270
|
+
if (a !== ~~a || a < 0 || a > p) throw Error(b);
|
|
267
271
|
// Divisor is zero?
|
|
268
|
-
if (!o[0]) throw Error(
|
|
272
|
+
if (!o[0]) throw Error(w);
|
|
269
273
|
// Dividend is 0? Return +-0.
|
|
270
274
|
if (!n[0]) return t.s = i, t.c = [ t.e = 0 ], t;
|
|
271
|
-
var u, l, c, s, f,
|
|
272
|
-
|
|
273
|
-
|
|
275
|
+
var u, l, c, s, f, y = o.slice(), h = u = o.length, v = n.length, m = n.slice(0, u), // remainder
|
|
276
|
+
d = m.length, g = t, // quotient
|
|
277
|
+
S = g.c = [], j = 0, _ = a + (g.e = e.e - t.e) + 1;
|
|
274
278
|
// precision of the result
|
|
275
279
|
// Add zeros to make remainder as long as divisor.
|
|
276
|
-
for (
|
|
280
|
+
for (g.s = i, i = _ < 0 ? 0 : _,
|
|
277
281
|
// Create version of divisor with leading zero.
|
|
278
|
-
|
|
282
|
+
y.unshift(0); d++ < u; ) m.push(0);
|
|
279
283
|
do {
|
|
280
284
|
// n is how many times the divisor goes into current remainder.
|
|
281
285
|
for (c = 0; c < 10; c++) {
|
|
282
286
|
// Compare divisor and remainder.
|
|
283
|
-
if (u != (
|
|
287
|
+
if (u != (d = m.length)) s = u > d ? 1 : -1; else for (f = -1, s = 0; ++f < u; ) if (o[f] != m[f]) {
|
|
284
288
|
s = o[f] > m[f] ? 1 : -1;
|
|
285
289
|
break;
|
|
286
290
|
}
|
|
@@ -288,74 +292,74 @@ var OHLCV_INDICATORS;
|
|
|
288
292
|
if (!(s < 0)) break;
|
|
289
293
|
// Remainder can't be more than 1 digit longer than divisor.
|
|
290
294
|
// Equalise lengths using divisor with extra leading zero?
|
|
291
|
-
for (l =
|
|
292
|
-
if (m[--
|
|
293
|
-
for (f =
|
|
294
|
-
--m[f], m[
|
|
295
|
+
for (l = d == u ? o : y; d; ) {
|
|
296
|
+
if (m[--d] < l[d]) {
|
|
297
|
+
for (f = d; f && !m[--f]; ) m[f] = 9;
|
|
298
|
+
--m[f], m[d] += 10;
|
|
295
299
|
}
|
|
296
|
-
m[
|
|
300
|
+
m[d] -= l[d];
|
|
297
301
|
}
|
|
298
302
|
for (;!m[0]; ) m.shift();
|
|
299
303
|
}
|
|
300
304
|
// Add the digit n to the result array.
|
|
301
|
-
|
|
305
|
+
S[j++] = s ? c : ++c,
|
|
302
306
|
// Update the remainder.
|
|
303
|
-
m[0] && s ? m[
|
|
304
|
-
} while ((
|
|
307
|
+
m[0] && s ? m[d] = n[h] || 0 : m = [ n[h] ];
|
|
308
|
+
} while ((h++ < v || m[0] !== O) && i--);
|
|
305
309
|
// Leading zero? Do not remove if result is simply zero (qi == 1).
|
|
306
|
-
return
|
|
310
|
+
return S[0] || 1 == j || (
|
|
307
311
|
// There can't be more than one zero.
|
|
308
|
-
|
|
312
|
+
S.shift(), g.e--, _--),
|
|
309
313
|
// Round?
|
|
310
|
-
|
|
314
|
+
j > _ && P(g, _, r.RM, m[0] !== O), g;
|
|
311
315
|
},
|
|
312
316
|
/*
|
|
313
317
|
* Return true if the value of this Big is equal to the value of Big y, otherwise return false.
|
|
314
318
|
*/
|
|
315
|
-
|
|
319
|
+
S.eq = function(t) {
|
|
316
320
|
return 0 === this.cmp(t);
|
|
317
321
|
},
|
|
318
322
|
/*
|
|
319
323
|
* Return true if the value of this Big is greater than the value of Big y, otherwise return
|
|
320
324
|
* false.
|
|
321
325
|
*/
|
|
322
|
-
|
|
326
|
+
S.gt = function(t) {
|
|
323
327
|
return this.cmp(t) > 0;
|
|
324
328
|
},
|
|
325
329
|
/*
|
|
326
330
|
* Return true if the value of this Big is greater than or equal to the value of Big y, otherwise
|
|
327
331
|
* return false.
|
|
328
332
|
*/
|
|
329
|
-
|
|
333
|
+
S.gte = function(t) {
|
|
330
334
|
return this.cmp(t) > -1;
|
|
331
335
|
},
|
|
332
336
|
/*
|
|
333
337
|
* Return true if the value of this Big is less than the value of Big y, otherwise return false.
|
|
334
338
|
*/
|
|
335
|
-
|
|
339
|
+
S.lt = function(t) {
|
|
336
340
|
return this.cmp(t) < 0;
|
|
337
341
|
},
|
|
338
342
|
/*
|
|
339
343
|
* Return true if the value of this Big is less than or equal to the value of Big y, otherwise
|
|
340
344
|
* return false.
|
|
341
345
|
*/
|
|
342
|
-
|
|
346
|
+
S.lte = function(t) {
|
|
343
347
|
return this.cmp(t) < 1;
|
|
344
348
|
},
|
|
345
349
|
/*
|
|
346
350
|
* Return a new Big whose value is the value of this Big minus the value of Big y.
|
|
347
351
|
*/
|
|
348
|
-
|
|
352
|
+
S.minus = S.sub = function(t) {
|
|
349
353
|
var e, r, n, o, i = this, a = i.constructor, u = i.s, l = (t = new a(t)).s;
|
|
350
354
|
// Signs differ?
|
|
351
355
|
if (u != l) return t.s = -l, i.plus(t);
|
|
352
|
-
var c = i.c.slice(), s = i.e, f = t.c,
|
|
356
|
+
var c = i.c.slice(), s = i.e, f = t.c, y = t.e;
|
|
353
357
|
// Either zero?
|
|
354
358
|
if (!c[0] || !f[0]) return f[0] ? t.s = -l : c[0] ? t = new a(i) : t.s = 1,
|
|
355
359
|
t;
|
|
356
360
|
// Determine which is the bigger number. Prepend zeros to equalise exponents.
|
|
357
|
-
if (u = s -
|
|
358
|
-
for ((o = u < 0) ? (u = -u, n = c) : (
|
|
361
|
+
if (u = s - y) {
|
|
362
|
+
for ((o = u < 0) ? (u = -u, n = c) : (y = s, n = f), n.reverse(), l = u; l--; ) n.push(0);
|
|
359
363
|
n.reverse();
|
|
360
364
|
} else for (
|
|
361
365
|
// Exponents equal. Check digit by digit.
|
|
@@ -380,33 +384,33 @@ var OHLCV_INDICATORS;
|
|
|
380
384
|
// Remove trailing zeros.
|
|
381
385
|
for (;0 === c[--l]; ) c.pop();
|
|
382
386
|
// Remove leading zeros and adjust exponent accordingly.
|
|
383
|
-
for (;0 === c[0]; ) c.shift(), --
|
|
387
|
+
for (;0 === c[0]; ) c.shift(), --y;
|
|
384
388
|
return c[0] || (
|
|
385
389
|
// n - n = +0
|
|
386
390
|
t.s = 1,
|
|
387
391
|
// Result must be zero.
|
|
388
|
-
c = [
|
|
392
|
+
c = [ y = 0 ]), t.c = c, t.e = y, t;
|
|
389
393
|
},
|
|
390
394
|
/*
|
|
391
395
|
* Return a new Big whose value is the value of this Big modulo the value of Big y.
|
|
392
396
|
*/
|
|
393
|
-
|
|
397
|
+
S.mod = function(t) {
|
|
394
398
|
var e, r = this, n = r.constructor, o = r.s, i = (t = new n(t)).s;
|
|
395
|
-
if (!t.c[0]) throw Error(
|
|
399
|
+
if (!t.c[0]) throw Error(w);
|
|
396
400
|
return r.s = t.s = 1, e = 1 == t.cmp(r), r.s = o, t.s = i, e ? new n(r) : (o = n.DP,
|
|
397
401
|
i = n.RM, n.DP = n.RM = 0, r = r.div(t), n.DP = o, n.RM = i, this.minus(r.times(t)));
|
|
398
402
|
},
|
|
399
403
|
/*
|
|
400
404
|
* Return a new Big whose value is the value of this Big negated.
|
|
401
405
|
*/
|
|
402
|
-
|
|
406
|
+
S.neg = function() {
|
|
403
407
|
var t = new this.constructor(this);
|
|
404
408
|
return t.s = -t.s, t;
|
|
405
409
|
},
|
|
406
410
|
/*
|
|
407
411
|
* Return a new Big whose value is the value of this Big plus the value of Big y.
|
|
408
412
|
*/
|
|
409
|
-
|
|
413
|
+
S.plus = S.add = function(t) {
|
|
410
414
|
var e, r, n, o = this, i = o.constructor;
|
|
411
415
|
// Signs differ?
|
|
412
416
|
if (t = new i(t), o.s != t.s) return t.s = -t.s, o.minus(t);
|
|
@@ -435,9 +439,9 @@ var OHLCV_INDICATORS;
|
|
|
435
439
|
*
|
|
436
440
|
* n {number} Integer, -MAX_POWER to MAX_POWER inclusive.
|
|
437
441
|
*/
|
|
438
|
-
|
|
442
|
+
S.pow = function(t) {
|
|
439
443
|
var e = this, r = new e.constructor("1"), n = r, o = t < 0;
|
|
440
|
-
if (t !== ~~t || t < -1e6 || t >
|
|
444
|
+
if (t !== ~~t || t < -1e6 || t > v) throw Error(d + "exponent");
|
|
441
445
|
for (o && (t = -t); 1 & t && (n = n.times(e)), t >>= 1; ) e = e.times(e);
|
|
442
446
|
return o ? r.div(n) : n;
|
|
443
447
|
},
|
|
@@ -448,9 +452,9 @@ var OHLCV_INDICATORS;
|
|
|
448
452
|
* sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
|
|
449
453
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
450
454
|
*/
|
|
451
|
-
|
|
452
|
-
if (t !== ~~t || t < 1 || t >
|
|
453
|
-
return
|
|
455
|
+
S.prec = function(t, e) {
|
|
456
|
+
if (t !== ~~t || t < 1 || t > p) throw Error(d + "precision");
|
|
457
|
+
return P(new this.constructor(this), t, e);
|
|
454
458
|
},
|
|
455
459
|
/*
|
|
456
460
|
* Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places
|
|
@@ -461,20 +465,20 @@ var OHLCV_INDICATORS;
|
|
|
461
465
|
* dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
|
|
462
466
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
463
467
|
*/
|
|
464
|
-
|
|
465
|
-
if (t ===
|
|
466
|
-
return
|
|
468
|
+
S.round = function(t, e) {
|
|
469
|
+
if (t === O) t = 0; else if (t !== ~~t || t < -p || t > p) throw Error(b);
|
|
470
|
+
return P(new this.constructor(this), t + this.e + 1, e);
|
|
467
471
|
},
|
|
468
472
|
/*
|
|
469
473
|
* Return a new Big whose value is the square root of the value of this Big, rounded, if
|
|
470
474
|
* necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
|
|
471
475
|
*/
|
|
472
|
-
|
|
476
|
+
S.sqrt = function() {
|
|
473
477
|
var t, e, r, n = this, o = n.constructor, i = n.s, a = n.e, u = new o("0.5");
|
|
474
478
|
// Zero?
|
|
475
479
|
if (!n.c[0]) return new o(n);
|
|
476
480
|
// Negative?
|
|
477
|
-
if (i < 0) throw Error(
|
|
481
|
+
if (i < 0) throw Error(m + "No square root");
|
|
478
482
|
// Estimate.
|
|
479
483
|
// Math.sqrt underflow/overflow?
|
|
480
484
|
// Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
|
|
@@ -485,12 +489,12 @@ var OHLCV_INDICATORS;
|
|
|
485
489
|
do {
|
|
486
490
|
r = t, t = u.times(r.plus(n.div(r)));
|
|
487
491
|
} while (r.c.slice(0, a).join("") !== t.c.slice(0, a).join(""));
|
|
488
|
-
return
|
|
492
|
+
return P(t, (o.DP -= 4) + t.e + 1, o.RM);
|
|
489
493
|
},
|
|
490
494
|
/*
|
|
491
495
|
* Return a new Big whose value is the value of this Big times the value of Big y.
|
|
492
496
|
*/
|
|
493
|
-
|
|
497
|
+
S.times = S.mul = function(t) {
|
|
494
498
|
var e, r = this, n = r.constructor, o = r.c, i = (t = new n(t)).c, a = o.length, u = i.length, l = r.e, c = t.e;
|
|
495
499
|
// Determine sign of result.
|
|
496
500
|
// Return signed 0 if either 0.
|
|
@@ -523,13 +527,13 @@ var OHLCV_INDICATORS;
|
|
|
523
527
|
* dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
|
|
524
528
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
525
529
|
*/
|
|
526
|
-
|
|
530
|
+
S.toExponential = function(t, e) {
|
|
527
531
|
var r = this, n = r.c[0];
|
|
528
|
-
if (t !==
|
|
529
|
-
if (t !== ~~t || t < 0 || t >
|
|
530
|
-
for (r =
|
|
532
|
+
if (t !== O) {
|
|
533
|
+
if (t !== ~~t || t < 0 || t > p) throw Error(b);
|
|
534
|
+
for (r = P(new r.constructor(r), ++t, e); r.c.length < t; ) r.c.push(0);
|
|
531
535
|
}
|
|
532
|
-
return
|
|
536
|
+
return _(r, !0, !!n);
|
|
533
537
|
},
|
|
534
538
|
/*
|
|
535
539
|
* Return a string representing the value of this Big in normal notation rounded to dp fixed
|
|
@@ -541,14 +545,14 @@ var OHLCV_INDICATORS;
|
|
|
541
545
|
* (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
|
|
542
546
|
* (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
|
|
543
547
|
*/
|
|
544
|
-
|
|
548
|
+
S.toFixed = function(t, e) {
|
|
545
549
|
var r = this, n = r.c[0];
|
|
546
|
-
if (t !==
|
|
547
|
-
if (t !== ~~t || t < 0 || t >
|
|
550
|
+
if (t !== O) {
|
|
551
|
+
if (t !== ~~t || t < 0 || t > p) throw Error(b);
|
|
548
552
|
// x.e may have changed if the value is rounded up.
|
|
549
|
-
for (t = t + (r =
|
|
553
|
+
for (t = t + (r = P(new r.constructor(r), t + r.e + 1, e)).e + 1; r.c.length < t; ) r.c.push(0);
|
|
550
554
|
}
|
|
551
|
-
return
|
|
555
|
+
return _(r, !1, !!n);
|
|
552
556
|
},
|
|
553
557
|
/*
|
|
554
558
|
* Return a string representing the value of this Big.
|
|
@@ -556,16 +560,16 @@ var OHLCV_INDICATORS;
|
|
|
556
560
|
* Big.PE, or a negative exponent equal to or less than Big.NE.
|
|
557
561
|
* Omit the sign for negative zero.
|
|
558
562
|
*/
|
|
559
|
-
|
|
563
|
+
S[Symbol.for("nodejs.util.inspect.custom")] = S.toJSON = S.toString = function() {
|
|
560
564
|
var t = this, e = t.constructor;
|
|
561
|
-
return
|
|
565
|
+
return _(t, t.e <= e.NE || t.e >= e.PE, !!t.c[0]);
|
|
562
566
|
},
|
|
563
567
|
/*
|
|
564
568
|
* Return the value of this Big as a primitve number.
|
|
565
569
|
*/
|
|
566
|
-
|
|
567
|
-
var t = Number(
|
|
568
|
-
if (!0 === this.constructor.strict && !this.eq(t.toString())) throw Error(
|
|
570
|
+
S.toNumber = function() {
|
|
571
|
+
var t = Number(_(this, !0, !0));
|
|
572
|
+
if (!0 === this.constructor.strict && !this.eq(t.toString())) throw Error(m + "Imprecise conversion");
|
|
569
573
|
return t;
|
|
570
574
|
},
|
|
571
575
|
/*
|
|
@@ -577,13 +581,13 @@ var OHLCV_INDICATORS;
|
|
|
577
581
|
* sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
|
|
578
582
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
579
583
|
*/
|
|
580
|
-
|
|
584
|
+
S.toPrecision = function(t, e) {
|
|
581
585
|
var r = this, n = r.constructor, o = r.c[0];
|
|
582
|
-
if (t !==
|
|
583
|
-
if (t !== ~~t || t < 1 || t >
|
|
584
|
-
for (r =
|
|
586
|
+
if (t !== O) {
|
|
587
|
+
if (t !== ~~t || t < 1 || t > p) throw Error(d + "precision");
|
|
588
|
+
for (r = P(new n(r), t, e); r.c.length < t; ) r.c.push(0);
|
|
585
589
|
}
|
|
586
|
-
return
|
|
590
|
+
return _(r, t <= r.e || r.e <= n.NE || r.e >= n.PE, !!o);
|
|
587
591
|
},
|
|
588
592
|
/*
|
|
589
593
|
* Return a string representing the value of this Big.
|
|
@@ -591,10 +595,10 @@ var OHLCV_INDICATORS;
|
|
|
591
595
|
* Big.PE, or a negative exponent equal to or less than Big.NE.
|
|
592
596
|
* Include the sign for negative zero.
|
|
593
597
|
*/
|
|
594
|
-
|
|
598
|
+
S.valueOf = function() {
|
|
595
599
|
var t = this, e = t.constructor;
|
|
596
|
-
if (!0 === e.strict) throw Error(
|
|
597
|
-
return
|
|
600
|
+
if (!0 === e.strict) throw Error(m + "valueOf disallowed");
|
|
601
|
+
return _(t, t.e <= e.NE || t.e >= e.PE, !0);
|
|
598
602
|
};
|
|
599
603
|
// Export
|
|
600
604
|
(
|
|
@@ -611,11 +615,11 @@ var OHLCV_INDICATORS;
|
|
|
611
615
|
function e(r) {
|
|
612
616
|
var n = this;
|
|
613
617
|
// Enable constructor usage without new.
|
|
614
|
-
if (!(n instanceof e)) return r ===
|
|
618
|
+
if (!(n instanceof e)) return r === O ? t() : new e(r);
|
|
615
619
|
// Duplicate.
|
|
616
620
|
if (r instanceof e) n.s = r.s, n.e = r.e, n.c = r.c.slice(); else {
|
|
617
621
|
if ("string" != typeof r) {
|
|
618
|
-
if (!0 === e.strict && "bigint" != typeof r) throw TypeError(
|
|
622
|
+
if (!0 === e.strict && "bigint" != typeof r) throw TypeError(d + "value");
|
|
619
623
|
// Minus zero?
|
|
620
624
|
r = 0 === r && 1 / r < 0 ? "-0" : String(r);
|
|
621
625
|
}
|
|
@@ -628,7 +632,7 @@ var OHLCV_INDICATORS;
|
|
|
628
632
|
*/
|
|
629
633
|
function(t, e) {
|
|
630
634
|
var r, n, o;
|
|
631
|
-
if (!
|
|
635
|
+
if (!j.test(e)) throw Error(d + "number");
|
|
632
636
|
// Determine sign.
|
|
633
637
|
// Decimal point?
|
|
634
638
|
t.s = "-" == e.charAt(0) ? (e = e.slice(1), -1) : 1, (r = e.indexOf(".")) > -1 && (e = e.replace(".", ""));
|
|
@@ -654,51 +658,51 @@ var OHLCV_INDICATORS;
|
|
|
654
658
|
// Shadow Big.prototype.constructor which points to Object.
|
|
655
659
|
n.constructor = e;
|
|
656
660
|
}
|
|
657
|
-
return e.prototype =
|
|
661
|
+
return e.prototype = S, e.DP = 20, e.RM = 1, e.NE = -7, e.PE = 21, e.strict = false,
|
|
658
662
|
e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
|
|
659
663
|
})();
|
|
660
664
|
/// <reference types="https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/big.js/index.d.ts" />
|
|
661
665
|
/* harmony default export */ // ./node_modules/trading-signals/dist/error/NotEnoughDataError.js
|
|
662
|
-
function
|
|
663
|
-
return
|
|
666
|
+
function N(t) {
|
|
667
|
+
return N = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
664
668
|
return typeof t;
|
|
665
669
|
} : function(t) {
|
|
666
670
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
667
|
-
},
|
|
671
|
+
}, N(t);
|
|
668
672
|
}
|
|
669
|
-
function
|
|
673
|
+
function A(t, e) {
|
|
670
674
|
for (var r = 0; r < e.length; r++) {
|
|
671
675
|
var n = e[r];
|
|
672
676
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
673
|
-
Object.defineProperty(t,
|
|
677
|
+
Object.defineProperty(t, T(n.key), n);
|
|
674
678
|
}
|
|
675
679
|
}
|
|
676
|
-
function
|
|
680
|
+
function T(t) {
|
|
677
681
|
var e = function(t, e) {
|
|
678
|
-
if ("object" !=
|
|
682
|
+
if ("object" != N(t) || !t) return t;
|
|
679
683
|
var r = t[Symbol.toPrimitive];
|
|
680
684
|
if (void 0 !== r) {
|
|
681
685
|
var n = r.call(t, e || "default");
|
|
682
|
-
if ("object" !=
|
|
686
|
+
if ("object" != N(n)) return n;
|
|
683
687
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
684
688
|
}
|
|
685
689
|
return ("string" === e ? String : Number)(t);
|
|
686
690
|
}(t, "string");
|
|
687
|
-
return "symbol" ==
|
|
691
|
+
return "symbol" == N(e) ? e : e + "";
|
|
688
692
|
}
|
|
689
|
-
function
|
|
690
|
-
return e =
|
|
691
|
-
if (e && ("object" ==
|
|
693
|
+
function E(t, e, r) {
|
|
694
|
+
return e = D(e), function(t, e) {
|
|
695
|
+
if (e && ("object" == N(e) || "function" == typeof e)) return e;
|
|
692
696
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
693
697
|
return function(t) {
|
|
694
698
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
695
699
|
return t;
|
|
696
700
|
}(t);
|
|
697
|
-
}(t, x() ? Reflect.construct(e, r || [],
|
|
701
|
+
}(t, x() ? Reflect.construct(e, r || [], D(t).constructor) : e.apply(t, r));
|
|
698
702
|
}
|
|
699
|
-
function
|
|
703
|
+
function k(t) {
|
|
700
704
|
var e = "function" == typeof Map ? new Map : void 0;
|
|
701
|
-
return
|
|
705
|
+
return k = function(t) {
|
|
702
706
|
if (null === t || !function(t) {
|
|
703
707
|
try {
|
|
704
708
|
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
@@ -717,8 +721,8 @@ var OHLCV_INDICATORS;
|
|
|
717
721
|
var n = [ null ];
|
|
718
722
|
n.push.apply(n, e);
|
|
719
723
|
var o = new (t.bind.apply(t, n));
|
|
720
|
-
return r &&
|
|
721
|
-
}(t, arguments,
|
|
724
|
+
return r && I(o, r.prototype), o;
|
|
725
|
+
}(t, arguments, D(this).constructor);
|
|
722
726
|
}
|
|
723
727
|
return r.prototype = Object.create(t.prototype, {
|
|
724
728
|
constructor: {
|
|
@@ -727,8 +731,8 @@ var OHLCV_INDICATORS;
|
|
|
727
731
|
writable: !0,
|
|
728
732
|
configurable: !0
|
|
729
733
|
}
|
|
730
|
-
}),
|
|
731
|
-
},
|
|
734
|
+
}), I(r, t);
|
|
735
|
+
}, k(t);
|
|
732
736
|
}
|
|
733
737
|
function x() {
|
|
734
738
|
try {
|
|
@@ -738,22 +742,22 @@ var OHLCV_INDICATORS;
|
|
|
738
742
|
return !!t;
|
|
739
743
|
})();
|
|
740
744
|
}
|
|
741
|
-
function
|
|
742
|
-
return
|
|
745
|
+
function I(t, e) {
|
|
746
|
+
return I = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
743
747
|
return t.__proto__ = e, t;
|
|
744
|
-
},
|
|
748
|
+
}, I(t, e);
|
|
745
749
|
}
|
|
746
|
-
function
|
|
747
|
-
return
|
|
750
|
+
function D(t) {
|
|
751
|
+
return D = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
748
752
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
749
|
-
},
|
|
753
|
+
}, D(t);
|
|
750
754
|
}
|
|
751
755
|
var M = function(t) {
|
|
752
756
|
function e() {
|
|
753
757
|
var t, r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "Not enough data";
|
|
754
758
|
return function(t, e) {
|
|
755
759
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
756
|
-
}(this, e), t =
|
|
760
|
+
}(this, e), t = E(this, e, [ r ]), Object.setPrototypeOf(t, (this instanceof e ? this.constructor : void 0).prototype),
|
|
757
761
|
t.name = "NotEnoughDataError", t;
|
|
758
762
|
}
|
|
759
763
|
return function(t, e) {
|
|
@@ -766,60 +770,60 @@ var OHLCV_INDICATORS;
|
|
|
766
770
|
}
|
|
767
771
|
}), Object.defineProperty(t, "prototype", {
|
|
768
772
|
writable: !1
|
|
769
|
-
}), e &&
|
|
770
|
-
}(e, t), r = e, n &&
|
|
773
|
+
}), e && I(t, e);
|
|
774
|
+
}(e, t), r = e, n && A(r.prototype, n), o && A(r, o), Object.defineProperty(r, "prototype", {
|
|
771
775
|
writable: !1
|
|
772
776
|
}), r;
|
|
773
777
|
var r, n, o;
|
|
774
|
-
}(
|
|
778
|
+
}( k(Error));
|
|
775
779
|
// ./node_modules/trading-signals/dist/Indicator.js
|
|
776
|
-
function
|
|
777
|
-
return
|
|
780
|
+
function R(t) {
|
|
781
|
+
return R = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
778
782
|
return typeof t;
|
|
779
783
|
} : function(t) {
|
|
780
784
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
781
|
-
},
|
|
785
|
+
}, R(t);
|
|
782
786
|
}
|
|
783
|
-
function
|
|
787
|
+
function C(t, e) {
|
|
784
788
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
785
789
|
}
|
|
786
|
-
function
|
|
790
|
+
function F(t, e) {
|
|
787
791
|
for (var r = 0; r < e.length; r++) {
|
|
788
792
|
var n = e[r];
|
|
789
793
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
790
|
-
Object.defineProperty(t,
|
|
794
|
+
Object.defineProperty(t, H(n.key), n);
|
|
791
795
|
}
|
|
792
796
|
}
|
|
793
|
-
function
|
|
794
|
-
return e &&
|
|
797
|
+
function L(t, e, r) {
|
|
798
|
+
return e && F(t.prototype, e), r && F(t, r), Object.defineProperty(t, "prototype", {
|
|
795
799
|
writable: !1
|
|
796
800
|
}), t;
|
|
797
801
|
}
|
|
798
|
-
function
|
|
799
|
-
return (e =
|
|
802
|
+
function B(t, e, r) {
|
|
803
|
+
return (e = H(e)) in t ? Object.defineProperty(t, e, {
|
|
800
804
|
value: r,
|
|
801
805
|
enumerable: !0,
|
|
802
806
|
configurable: !0,
|
|
803
807
|
writable: !0
|
|
804
808
|
}) : t[e] = r, t;
|
|
805
809
|
}
|
|
806
|
-
function
|
|
810
|
+
function H(t) {
|
|
807
811
|
var e = function(t, e) {
|
|
808
|
-
if ("object" !=
|
|
812
|
+
if ("object" != R(t) || !t) return t;
|
|
809
813
|
var r = t[Symbol.toPrimitive];
|
|
810
814
|
if (void 0 !== r) {
|
|
811
815
|
var n = r.call(t, e || "default");
|
|
812
|
-
if ("object" !=
|
|
816
|
+
if ("object" != R(n)) return n;
|
|
813
817
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
814
818
|
}
|
|
815
819
|
return ("string" === e ? String : Number)(t);
|
|
816
820
|
}(t, "string");
|
|
817
|
-
return "symbol" ==
|
|
821
|
+
return "symbol" == R(e) ? e : e + "";
|
|
818
822
|
}
|
|
819
|
-
var
|
|
820
|
-
return
|
|
821
|
-
|
|
822
|
-
|
|
823
|
+
var V = function() {
|
|
824
|
+
return L((function t() {
|
|
825
|
+
C(this, t), B(this, "previousHighest", void 0), B(this, "highest", void 0), B(this, "previousLowest", void 0),
|
|
826
|
+
B(this, "lowest", void 0), B(this, "previousResult", void 0), B(this, "result", void 0);
|
|
823
827
|
}), [ {
|
|
824
828
|
key: "isStable",
|
|
825
829
|
get: function() {
|
|
@@ -848,52 +852,52 @@ var OHLCV_INDICATORS;
|
|
|
848
852
|
} ]);
|
|
849
853
|
}();
|
|
850
854
|
// ./node_modules/trading-signals/dist/MA/MovingAverage.js
|
|
851
|
-
function
|
|
852
|
-
return
|
|
855
|
+
function U(t) {
|
|
856
|
+
return U = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
853
857
|
return typeof t;
|
|
854
858
|
} : function(t) {
|
|
855
859
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
856
|
-
},
|
|
860
|
+
}, U(t);
|
|
857
861
|
}
|
|
858
|
-
function
|
|
862
|
+
function $(t, e) {
|
|
859
863
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
860
864
|
}
|
|
861
|
-
function
|
|
865
|
+
function q(t, e) {
|
|
862
866
|
for (var r = 0; r < e.length; r++) {
|
|
863
867
|
var n = e[r];
|
|
864
868
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
865
|
-
Object.defineProperty(t,
|
|
869
|
+
Object.defineProperty(t, W(n.key), n);
|
|
866
870
|
}
|
|
867
871
|
}
|
|
868
|
-
function
|
|
869
|
-
return e &&
|
|
872
|
+
function z(t, e, r) {
|
|
873
|
+
return e && q(t.prototype, e), r && q(t, r), Object.defineProperty(t, "prototype", {
|
|
870
874
|
writable: !1
|
|
871
875
|
}), t;
|
|
872
876
|
}
|
|
873
|
-
function
|
|
874
|
-
return e =
|
|
875
|
-
if (e && ("object" ==
|
|
877
|
+
function G(t, e, r) {
|
|
878
|
+
return e = Y(e), function(t, e) {
|
|
879
|
+
if (e && ("object" == U(e) || "function" == typeof e)) return e;
|
|
876
880
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
877
881
|
return function(t) {
|
|
878
882
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
879
883
|
return t;
|
|
880
884
|
}(t);
|
|
881
|
-
}(t,
|
|
885
|
+
}(t, K() ? Reflect.construct(e, r || [], Y(t).constructor) : e.apply(t, r));
|
|
882
886
|
}
|
|
883
|
-
function
|
|
887
|
+
function K() {
|
|
884
888
|
try {
|
|
885
889
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
886
890
|
} catch (t) {}
|
|
887
|
-
return (
|
|
891
|
+
return (K = function() {
|
|
888
892
|
return !!t;
|
|
889
893
|
})();
|
|
890
894
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
895
|
+
function Y(t) {
|
|
896
|
+
return Y = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
893
897
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
894
|
-
},
|
|
898
|
+
}, Y(t);
|
|
895
899
|
}
|
|
896
|
-
function
|
|
900
|
+
function J(t, e) {
|
|
897
901
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
898
902
|
t.prototype = Object.create(e && e.prototype, {
|
|
899
903
|
constructor: {
|
|
@@ -903,40 +907,40 @@ var OHLCV_INDICATORS;
|
|
|
903
907
|
}
|
|
904
908
|
}), Object.defineProperty(t, "prototype", {
|
|
905
909
|
writable: !1
|
|
906
|
-
}), e &&
|
|
910
|
+
}), e && Z(t, e);
|
|
907
911
|
}
|
|
908
|
-
function
|
|
909
|
-
return
|
|
912
|
+
function Z(t, e) {
|
|
913
|
+
return Z = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
910
914
|
return t.__proto__ = e, t;
|
|
911
|
-
},
|
|
915
|
+
}, Z(t, e);
|
|
912
916
|
}
|
|
913
|
-
function
|
|
914
|
-
return (e =
|
|
917
|
+
function Q(t, e, r) {
|
|
918
|
+
return (e = W(e)) in t ? Object.defineProperty(t, e, {
|
|
915
919
|
value: r,
|
|
916
920
|
enumerable: !0,
|
|
917
921
|
configurable: !0,
|
|
918
922
|
writable: !0
|
|
919
923
|
}) : t[e] = r, t;
|
|
920
924
|
}
|
|
921
|
-
function
|
|
925
|
+
function W(t) {
|
|
922
926
|
var e = function(t, e) {
|
|
923
|
-
if ("object" !=
|
|
927
|
+
if ("object" != U(t) || !t) return t;
|
|
924
928
|
var r = t[Symbol.toPrimitive];
|
|
925
929
|
if (void 0 !== r) {
|
|
926
930
|
var n = r.call(t, e || "default");
|
|
927
|
-
if ("object" !=
|
|
931
|
+
if ("object" != U(n)) return n;
|
|
928
932
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
929
933
|
}
|
|
930
934
|
return ("string" === e ? String : Number)(t);
|
|
931
935
|
}(t, "string");
|
|
932
|
-
return "symbol" ==
|
|
936
|
+
return "symbol" == U(e) ? e : e + "";
|
|
933
937
|
}
|
|
934
|
-
var
|
|
938
|
+
var X = function(t) {
|
|
935
939
|
function e(t) {
|
|
936
940
|
var r;
|
|
937
|
-
return
|
|
941
|
+
return $(this, e), Q(r = G(this, e), "interval", void 0), r.interval = t, r;
|
|
938
942
|
}
|
|
939
|
-
return
|
|
943
|
+
return J(e, t), z(e, [ {
|
|
940
944
|
key: "updates",
|
|
941
945
|
value: function(t) {
|
|
942
946
|
var e = this;
|
|
@@ -950,54 +954,54 @@ var OHLCV_INDICATORS;
|
|
|
950
954
|
return this.update(t, !0);
|
|
951
955
|
}
|
|
952
956
|
} ]);
|
|
953
|
-
}(
|
|
957
|
+
}(V);
|
|
954
958
|
// ./node_modules/trading-signals/dist/SMA/SMA.js
|
|
955
|
-
function
|
|
956
|
-
return
|
|
959
|
+
function tt(t) {
|
|
960
|
+
return tt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
957
961
|
return typeof t;
|
|
958
962
|
} : function(t) {
|
|
959
963
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
960
|
-
},
|
|
964
|
+
}, tt(t);
|
|
961
965
|
}
|
|
962
|
-
function
|
|
966
|
+
function et(t, e) {
|
|
963
967
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
964
968
|
}
|
|
965
|
-
function
|
|
969
|
+
function rt(t, e) {
|
|
966
970
|
for (var r = 0; r < e.length; r++) {
|
|
967
971
|
var n = e[r];
|
|
968
972
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
969
|
-
Object.defineProperty(t,
|
|
973
|
+
Object.defineProperty(t, st(n.key), n);
|
|
970
974
|
}
|
|
971
975
|
}
|
|
972
|
-
function
|
|
973
|
-
return e &&
|
|
976
|
+
function nt(t, e, r) {
|
|
977
|
+
return e && rt(t.prototype, e), r && rt(t, r), Object.defineProperty(t, "prototype", {
|
|
974
978
|
writable: !1
|
|
975
979
|
}), t;
|
|
976
980
|
}
|
|
977
|
-
function
|
|
978
|
-
return e =
|
|
979
|
-
if (e && ("object" ==
|
|
981
|
+
function ot(t, e, r) {
|
|
982
|
+
return e = at(e), function(t, e) {
|
|
983
|
+
if (e && ("object" == tt(e) || "function" == typeof e)) return e;
|
|
980
984
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
981
985
|
return function(t) {
|
|
982
986
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
983
987
|
return t;
|
|
984
988
|
}(t);
|
|
985
|
-
}(t,
|
|
989
|
+
}(t, it() ? Reflect.construct(e, r || [], at(t).constructor) : e.apply(t, r));
|
|
986
990
|
}
|
|
987
|
-
function
|
|
991
|
+
function it() {
|
|
988
992
|
try {
|
|
989
993
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
990
994
|
} catch (t) {}
|
|
991
|
-
return (
|
|
995
|
+
return (it = function() {
|
|
992
996
|
return !!t;
|
|
993
997
|
})();
|
|
994
998
|
}
|
|
995
|
-
function
|
|
996
|
-
return
|
|
999
|
+
function at(t) {
|
|
1000
|
+
return at = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
997
1001
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
998
|
-
},
|
|
1002
|
+
}, at(t);
|
|
999
1003
|
}
|
|
1000
|
-
function
|
|
1004
|
+
function ut(t, e) {
|
|
1001
1005
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1002
1006
|
t.prototype = Object.create(e && e.prototype, {
|
|
1003
1007
|
constructor: {
|
|
@@ -1007,42 +1011,42 @@ var OHLCV_INDICATORS;
|
|
|
1007
1011
|
}
|
|
1008
1012
|
}), Object.defineProperty(t, "prototype", {
|
|
1009
1013
|
writable: !1
|
|
1010
|
-
}), e &&
|
|
1014
|
+
}), e && lt(t, e);
|
|
1011
1015
|
}
|
|
1012
|
-
function
|
|
1013
|
-
return
|
|
1016
|
+
function lt(t, e) {
|
|
1017
|
+
return lt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1014
1018
|
return t.__proto__ = e, t;
|
|
1015
|
-
},
|
|
1019
|
+
}, lt(t, e);
|
|
1016
1020
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return (e =
|
|
1021
|
+
function ct(t, e, r) {
|
|
1022
|
+
return (e = st(e)) in t ? Object.defineProperty(t, e, {
|
|
1019
1023
|
value: r,
|
|
1020
1024
|
enumerable: !0,
|
|
1021
1025
|
configurable: !0,
|
|
1022
1026
|
writable: !0
|
|
1023
1027
|
}) : t[e] = r, t;
|
|
1024
1028
|
}
|
|
1025
|
-
function
|
|
1029
|
+
function st(t) {
|
|
1026
1030
|
var e = function(t, e) {
|
|
1027
|
-
if ("object" !=
|
|
1031
|
+
if ("object" != tt(t) || !t) return t;
|
|
1028
1032
|
var r = t[Symbol.toPrimitive];
|
|
1029
1033
|
if (void 0 !== r) {
|
|
1030
1034
|
var n = r.call(t, e || "default");
|
|
1031
|
-
if ("object" !=
|
|
1035
|
+
if ("object" != tt(n)) return n;
|
|
1032
1036
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1033
1037
|
}
|
|
1034
1038
|
return ("string" === e ? String : Number)(t);
|
|
1035
1039
|
}(t, "string");
|
|
1036
|
-
return "symbol" ==
|
|
1040
|
+
return "symbol" == tt(e) ? e : e + "";
|
|
1037
1041
|
}
|
|
1038
|
-
var
|
|
1042
|
+
var ft = function(t) {
|
|
1039
1043
|
function e() {
|
|
1040
1044
|
var t;
|
|
1041
|
-
|
|
1045
|
+
et(this, e);
|
|
1042
1046
|
for (var r = arguments.length, n = new Array(r), o = 0; o < r; o++) n[o] = arguments[o];
|
|
1043
|
-
return
|
|
1047
|
+
return ct(t = ot(this, e, [].concat(n)), "prices", []), t;
|
|
1044
1048
|
}
|
|
1045
|
-
return
|
|
1049
|
+
return ut(e, t), nt(e, [ {
|
|
1046
1050
|
key: "update",
|
|
1047
1051
|
value: function(t) {
|
|
1048
1052
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
@@ -1055,54 +1059,54 @@ var OHLCV_INDICATORS;
|
|
|
1055
1059
|
}
|
|
1056
1060
|
}
|
|
1057
1061
|
} ]);
|
|
1058
|
-
}(
|
|
1062
|
+
}(X);
|
|
1059
1063
|
// ./node_modules/trading-signals/dist/WSMA/WSMA.js
|
|
1060
|
-
function
|
|
1061
|
-
return
|
|
1064
|
+
function yt(t) {
|
|
1065
|
+
return yt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1062
1066
|
return typeof t;
|
|
1063
1067
|
} : function(t) {
|
|
1064
1068
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1065
|
-
},
|
|
1069
|
+
}, yt(t);
|
|
1066
1070
|
}
|
|
1067
1071
|
function ht(t, e) {
|
|
1068
1072
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1069
1073
|
}
|
|
1070
|
-
function
|
|
1074
|
+
function pt(t, e) {
|
|
1071
1075
|
for (var r = 0; r < e.length; r++) {
|
|
1072
1076
|
var n = e[r];
|
|
1073
1077
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1074
|
-
Object.defineProperty(t,
|
|
1078
|
+
Object.defineProperty(t, Ot(n.key), n);
|
|
1075
1079
|
}
|
|
1076
1080
|
}
|
|
1077
|
-
function
|
|
1078
|
-
return e &&
|
|
1081
|
+
function vt(t, e, r) {
|
|
1082
|
+
return e && pt(t.prototype, e), r && pt(t, r), Object.defineProperty(t, "prototype", {
|
|
1079
1083
|
writable: !1
|
|
1080
1084
|
}), t;
|
|
1081
1085
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return e =
|
|
1084
|
-
if (e && ("object" ==
|
|
1086
|
+
function mt(t, e, r) {
|
|
1087
|
+
return e = bt(e), function(t, e) {
|
|
1088
|
+
if (e && ("object" == yt(e) || "function" == typeof e)) return e;
|
|
1085
1089
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1086
1090
|
return function(t) {
|
|
1087
1091
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1088
1092
|
return t;
|
|
1089
1093
|
}(t);
|
|
1090
|
-
}(t,
|
|
1094
|
+
}(t, dt() ? Reflect.construct(e, r || [], bt(t).constructor) : e.apply(t, r));
|
|
1091
1095
|
}
|
|
1092
|
-
function
|
|
1096
|
+
function dt() {
|
|
1093
1097
|
try {
|
|
1094
1098
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1095
1099
|
} catch (t) {}
|
|
1096
|
-
return (
|
|
1100
|
+
return (dt = function() {
|
|
1097
1101
|
return !!t;
|
|
1098
1102
|
})();
|
|
1099
1103
|
}
|
|
1100
|
-
function
|
|
1101
|
-
return
|
|
1104
|
+
function bt(t) {
|
|
1105
|
+
return bt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1102
1106
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1103
|
-
},
|
|
1107
|
+
}, bt(t);
|
|
1104
1108
|
}
|
|
1105
|
-
function
|
|
1109
|
+
function gt(t, e) {
|
|
1106
1110
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1107
1111
|
t.prototype = Object.create(e && e.prototype, {
|
|
1108
1112
|
constructor: {
|
|
@@ -1112,42 +1116,42 @@ var OHLCV_INDICATORS;
|
|
|
1112
1116
|
}
|
|
1113
1117
|
}), Object.defineProperty(t, "prototype", {
|
|
1114
1118
|
writable: !1
|
|
1115
|
-
}), e &&
|
|
1119
|
+
}), e && wt(t, e);
|
|
1116
1120
|
}
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
1121
|
+
function wt(t, e) {
|
|
1122
|
+
return wt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1119
1123
|
return t.__proto__ = e, t;
|
|
1120
|
-
},
|
|
1124
|
+
}, wt(t, e);
|
|
1121
1125
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return (e =
|
|
1126
|
+
function St(t, e, r) {
|
|
1127
|
+
return (e = Ot(e)) in t ? Object.defineProperty(t, e, {
|
|
1124
1128
|
value: r,
|
|
1125
1129
|
enumerable: !0,
|
|
1126
1130
|
configurable: !0,
|
|
1127
1131
|
writable: !0
|
|
1128
1132
|
}) : t[e] = r, t;
|
|
1129
1133
|
}
|
|
1130
|
-
function
|
|
1134
|
+
function Ot(t) {
|
|
1131
1135
|
var e = function(t, e) {
|
|
1132
|
-
if ("object" !=
|
|
1136
|
+
if ("object" != yt(t) || !t) return t;
|
|
1133
1137
|
var r = t[Symbol.toPrimitive];
|
|
1134
1138
|
if (void 0 !== r) {
|
|
1135
1139
|
var n = r.call(t, e || "default");
|
|
1136
|
-
if ("object" !=
|
|
1140
|
+
if ("object" != yt(n)) return n;
|
|
1137
1141
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1138
1142
|
}
|
|
1139
1143
|
return ("string" === e ? String : Number)(t);
|
|
1140
1144
|
}(t, "string");
|
|
1141
|
-
return "symbol" ==
|
|
1145
|
+
return "symbol" == yt(e) ? e : e + "";
|
|
1142
1146
|
}
|
|
1143
|
-
var
|
|
1147
|
+
var jt = function(t) {
|
|
1144
1148
|
function e(t) {
|
|
1145
1149
|
var r;
|
|
1146
|
-
return ht(this, e),
|
|
1147
|
-
|
|
1150
|
+
return ht(this, e), St(r = mt(this, e), "interval", void 0), St(r, "indicator", void 0),
|
|
1151
|
+
St(r, "smoothingFactor", void 0), r.interval = t, r.indicator = new ft(t), r.smoothingFactor = 1 / r.interval,
|
|
1148
1152
|
r;
|
|
1149
1153
|
}
|
|
1150
|
-
return
|
|
1154
|
+
return gt(e, t), vt(e, [ {
|
|
1151
1155
|
key: "updates",
|
|
1152
1156
|
value: function(t) {
|
|
1153
1157
|
var e = this;
|
|
@@ -1170,68 +1174,68 @@ var OHLCV_INDICATORS;
|
|
|
1170
1174
|
if (void 0 === this.result && void 0 !== r) return this.setResult(r, e);
|
|
1171
1175
|
}
|
|
1172
1176
|
} ]);
|
|
1173
|
-
}(
|
|
1174
|
-
function
|
|
1177
|
+
}(V);
|
|
1178
|
+
function Pt(t) {
|
|
1175
1179
|
return t.length ? t.reduce((function(t, e) {
|
|
1176
1180
|
return t + e;
|
|
1177
1181
|
}), 0) / t.length : 0;
|
|
1178
1182
|
}
|
|
1179
1183
|
// ./node_modules/trading-signals/dist/BBANDS/BollingerBands.js
|
|
1180
|
-
function
|
|
1181
|
-
return
|
|
1184
|
+
function _t(t) {
|
|
1185
|
+
return _t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1182
1186
|
return typeof t;
|
|
1183
1187
|
} : function(t) {
|
|
1184
1188
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1185
|
-
},
|
|
1189
|
+
}, _t(t);
|
|
1186
1190
|
}
|
|
1187
|
-
function
|
|
1191
|
+
function Nt(t, e) {
|
|
1188
1192
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1189
1193
|
}
|
|
1190
|
-
function
|
|
1194
|
+
function At(t, e) {
|
|
1191
1195
|
for (var r = 0; r < e.length; r++) {
|
|
1192
1196
|
var n = e[r];
|
|
1193
1197
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1194
|
-
Object.defineProperty(t,
|
|
1198
|
+
Object.defineProperty(t, kt(n.key), n);
|
|
1195
1199
|
}
|
|
1196
1200
|
}
|
|
1197
|
-
function
|
|
1198
|
-
return e &&
|
|
1201
|
+
function Tt(t, e, r) {
|
|
1202
|
+
return e && At(t.prototype, e), r && At(t, r), Object.defineProperty(t, "prototype", {
|
|
1199
1203
|
writable: !1
|
|
1200
1204
|
}), t;
|
|
1201
1205
|
}
|
|
1202
|
-
function
|
|
1203
|
-
return (e =
|
|
1206
|
+
function Et(t, e, r) {
|
|
1207
|
+
return (e = kt(e)) in t ? Object.defineProperty(t, e, {
|
|
1204
1208
|
value: r,
|
|
1205
1209
|
enumerable: !0,
|
|
1206
1210
|
configurable: !0,
|
|
1207
1211
|
writable: !0
|
|
1208
1212
|
}) : t[e] = r, t;
|
|
1209
1213
|
}
|
|
1210
|
-
function
|
|
1214
|
+
function kt(t) {
|
|
1211
1215
|
var e = function(t, e) {
|
|
1212
|
-
if ("object" !=
|
|
1216
|
+
if ("object" != _t(t) || !t) return t;
|
|
1213
1217
|
var r = t[Symbol.toPrimitive];
|
|
1214
1218
|
if (void 0 !== r) {
|
|
1215
1219
|
var n = r.call(t, e || "default");
|
|
1216
|
-
if ("object" !=
|
|
1220
|
+
if ("object" != _t(n)) return n;
|
|
1217
1221
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1218
1222
|
}
|
|
1219
1223
|
return ("string" === e ? String : Number)(t);
|
|
1220
1224
|
}(t, "string");
|
|
1221
|
-
return "symbol" ==
|
|
1225
|
+
return "symbol" == _t(e) ? e : e + "";
|
|
1222
1226
|
}
|
|
1223
1227
|
var xt = function() {
|
|
1224
|
-
return
|
|
1228
|
+
return Tt((function t(e) {
|
|
1225
1229
|
var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2;
|
|
1226
|
-
|
|
1227
|
-
|
|
1230
|
+
Nt(this, t), Et(this, "interval", void 0), Et(this, "deviationMultiplier", void 0),
|
|
1231
|
+
Et(this, "prices", []), Et(this, "result", void 0), this.interval = e, this.deviationMultiplier = r;
|
|
1228
1232
|
}), [ {
|
|
1229
1233
|
key: "update",
|
|
1230
1234
|
value: function(t) {
|
|
1231
1235
|
if (this.prices.push(t), this.prices.length > this.interval) {
|
|
1232
1236
|
this.prices.shift();
|
|
1233
|
-
var e =
|
|
1234
|
-
var r = e ||
|
|
1237
|
+
var e = Pt(this.prices), r = function(t, e) {
|
|
1238
|
+
var r = e || Pt(t), n = Pt(t.map((function(t) {
|
|
1235
1239
|
return t - r;
|
|
1236
1240
|
})).map((function(t) {
|
|
1237
1241
|
return t * t;
|
|
@@ -1259,52 +1263,52 @@ var OHLCV_INDICATORS;
|
|
|
1259
1263
|
} ]);
|
|
1260
1264
|
}();
|
|
1261
1265
|
// ./node_modules/trading-signals/dist/EMA/EMA.js
|
|
1262
|
-
function
|
|
1263
|
-
return
|
|
1266
|
+
function It(t) {
|
|
1267
|
+
return It = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1264
1268
|
return typeof t;
|
|
1265
1269
|
} : function(t) {
|
|
1266
1270
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1267
|
-
},
|
|
1271
|
+
}, It(t);
|
|
1268
1272
|
}
|
|
1269
|
-
function
|
|
1273
|
+
function Dt(t, e) {
|
|
1270
1274
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1271
1275
|
}
|
|
1272
1276
|
function Mt(t, e) {
|
|
1273
1277
|
for (var r = 0; r < e.length; r++) {
|
|
1274
1278
|
var n = e[r];
|
|
1275
1279
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1276
|
-
Object.defineProperty(t,
|
|
1280
|
+
Object.defineProperty(t, Ut(n.key), n);
|
|
1277
1281
|
}
|
|
1278
1282
|
}
|
|
1279
|
-
function
|
|
1283
|
+
function Rt(t, e, r) {
|
|
1280
1284
|
return e && Mt(t.prototype, e), r && Mt(t, r), Object.defineProperty(t, "prototype", {
|
|
1281
1285
|
writable: !1
|
|
1282
1286
|
}), t;
|
|
1283
1287
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return e =
|
|
1286
|
-
if (e && ("object" ==
|
|
1288
|
+
function Ct(t, e, r) {
|
|
1289
|
+
return e = Lt(e), function(t, e) {
|
|
1290
|
+
if (e && ("object" == It(e) || "function" == typeof e)) return e;
|
|
1287
1291
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1288
1292
|
return function(t) {
|
|
1289
1293
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1290
1294
|
return t;
|
|
1291
1295
|
}(t);
|
|
1292
|
-
}(t,
|
|
1296
|
+
}(t, Ft() ? Reflect.construct(e, r || [], Lt(t).constructor) : e.apply(t, r));
|
|
1293
1297
|
}
|
|
1294
|
-
function
|
|
1298
|
+
function Ft() {
|
|
1295
1299
|
try {
|
|
1296
1300
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1297
1301
|
} catch (t) {}
|
|
1298
|
-
return (
|
|
1302
|
+
return (Ft = function() {
|
|
1299
1303
|
return !!t;
|
|
1300
1304
|
})();
|
|
1301
1305
|
}
|
|
1302
|
-
function
|
|
1303
|
-
return
|
|
1306
|
+
function Lt(t) {
|
|
1307
|
+
return Lt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1304
1308
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1305
|
-
},
|
|
1309
|
+
}, Lt(t);
|
|
1306
1310
|
}
|
|
1307
|
-
function
|
|
1311
|
+
function Bt(t, e) {
|
|
1308
1312
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1309
1313
|
t.prototype = Object.create(e && e.prototype, {
|
|
1310
1314
|
constructor: {
|
|
@@ -1314,42 +1318,42 @@ var OHLCV_INDICATORS;
|
|
|
1314
1318
|
}
|
|
1315
1319
|
}), Object.defineProperty(t, "prototype", {
|
|
1316
1320
|
writable: !1
|
|
1317
|
-
}), e &&
|
|
1321
|
+
}), e && Ht(t, e);
|
|
1318
1322
|
}
|
|
1319
|
-
function
|
|
1320
|
-
return
|
|
1323
|
+
function Ht(t, e) {
|
|
1324
|
+
return Ht = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1321
1325
|
return t.__proto__ = e, t;
|
|
1322
|
-
},
|
|
1326
|
+
}, Ht(t, e);
|
|
1323
1327
|
}
|
|
1324
|
-
function
|
|
1325
|
-
return (e =
|
|
1328
|
+
function Vt(t, e, r) {
|
|
1329
|
+
return (e = Ut(e)) in t ? Object.defineProperty(t, e, {
|
|
1326
1330
|
value: r,
|
|
1327
1331
|
enumerable: !0,
|
|
1328
1332
|
configurable: !0,
|
|
1329
1333
|
writable: !0
|
|
1330
1334
|
}) : t[e] = r, t;
|
|
1331
1335
|
}
|
|
1332
|
-
function
|
|
1336
|
+
function Ut(t) {
|
|
1333
1337
|
var e = function(t, e) {
|
|
1334
|
-
if ("object" !=
|
|
1338
|
+
if ("object" != It(t) || !t) return t;
|
|
1335
1339
|
var r = t[Symbol.toPrimitive];
|
|
1336
1340
|
if (void 0 !== r) {
|
|
1337
1341
|
var n = r.call(t, e || "default");
|
|
1338
|
-
if ("object" !=
|
|
1342
|
+
if ("object" != It(n)) return n;
|
|
1339
1343
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1340
1344
|
}
|
|
1341
1345
|
return ("string" === e ? String : Number)(t);
|
|
1342
1346
|
}(t, "string");
|
|
1343
|
-
return "symbol" ==
|
|
1347
|
+
return "symbol" == It(e) ? e : e + "";
|
|
1344
1348
|
}
|
|
1345
|
-
var
|
|
1349
|
+
var $t = function(t) {
|
|
1346
1350
|
function e(t) {
|
|
1347
1351
|
var r;
|
|
1348
|
-
return
|
|
1349
|
-
|
|
1352
|
+
return Dt(this, e), Vt(r = Ct(this, e, [ t ]), "interval", void 0), Vt(r, "pricesCounter", 0),
|
|
1353
|
+
Vt(r, "weightFactor", void 0), r.interval = t, r.weightFactor = 2 / (r.interval + 1),
|
|
1350
1354
|
r;
|
|
1351
1355
|
}
|
|
1352
|
-
return
|
|
1356
|
+
return Bt(e, t), Rt(e, [ {
|
|
1353
1357
|
key: "update",
|
|
1354
1358
|
value: function(t) {
|
|
1355
1359
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
@@ -1372,55 +1376,55 @@ var OHLCV_INDICATORS;
|
|
|
1372
1376
|
}
|
|
1373
1377
|
}
|
|
1374
1378
|
} ]);
|
|
1375
|
-
}(
|
|
1379
|
+
}(X);
|
|
1376
1380
|
// ./node_modules/trading-signals/dist/MACD/MACD.js
|
|
1377
|
-
function
|
|
1378
|
-
return
|
|
1381
|
+
function qt(t) {
|
|
1382
|
+
return qt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1379
1383
|
return typeof t;
|
|
1380
1384
|
} : function(t) {
|
|
1381
1385
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1382
|
-
},
|
|
1386
|
+
}, qt(t);
|
|
1383
1387
|
}
|
|
1384
|
-
function
|
|
1388
|
+
function zt(t, e) {
|
|
1385
1389
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1386
1390
|
}
|
|
1387
|
-
function
|
|
1391
|
+
function Gt(t, e) {
|
|
1388
1392
|
for (var r = 0; r < e.length; r++) {
|
|
1389
1393
|
var n = e[r];
|
|
1390
1394
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1391
|
-
Object.defineProperty(t,
|
|
1395
|
+
Object.defineProperty(t, Jt(n.key), n);
|
|
1392
1396
|
}
|
|
1393
1397
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return e &&
|
|
1398
|
+
function Kt(t, e, r) {
|
|
1399
|
+
return e && Gt(t.prototype, e), r && Gt(t, r), Object.defineProperty(t, "prototype", {
|
|
1396
1400
|
writable: !1
|
|
1397
1401
|
}), t;
|
|
1398
1402
|
}
|
|
1399
|
-
function
|
|
1400
|
-
return (e =
|
|
1403
|
+
function Yt(t, e, r) {
|
|
1404
|
+
return (e = Jt(e)) in t ? Object.defineProperty(t, e, {
|
|
1401
1405
|
value: r,
|
|
1402
1406
|
enumerable: !0,
|
|
1403
1407
|
configurable: !0,
|
|
1404
1408
|
writable: !0
|
|
1405
1409
|
}) : t[e] = r, t;
|
|
1406
1410
|
}
|
|
1407
|
-
function
|
|
1411
|
+
function Jt(t) {
|
|
1408
1412
|
var e = function(t, e) {
|
|
1409
|
-
if ("object" !=
|
|
1413
|
+
if ("object" != qt(t) || !t) return t;
|
|
1410
1414
|
var r = t[Symbol.toPrimitive];
|
|
1411
1415
|
if (void 0 !== r) {
|
|
1412
1416
|
var n = r.call(t, e || "default");
|
|
1413
|
-
if ("object" !=
|
|
1417
|
+
if ("object" != qt(n)) return n;
|
|
1414
1418
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1415
1419
|
}
|
|
1416
1420
|
return ("string" === e ? String : Number)(t);
|
|
1417
1421
|
}(t, "string");
|
|
1418
|
-
return "symbol" ==
|
|
1422
|
+
return "symbol" == qt(e) ? e : e + "";
|
|
1419
1423
|
}
|
|
1420
|
-
var
|
|
1421
|
-
return
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
+
var Zt = function() {
|
|
1425
|
+
return Kt((function t(e, r, n) {
|
|
1426
|
+
zt(this, t), Yt(this, "short", void 0), Yt(this, "long", void 0), Yt(this, "signal", void 0),
|
|
1427
|
+
Yt(this, "prices", []), Yt(this, "result", void 0), this.short = e, this.long = r,
|
|
1424
1428
|
this.signal = n;
|
|
1425
1429
|
}), [ {
|
|
1426
1430
|
key: "getResult",
|
|
@@ -1451,52 +1455,52 @@ var OHLCV_INDICATORS;
|
|
|
1451
1455
|
} ]);
|
|
1452
1456
|
}();
|
|
1453
1457
|
// ./node_modules/trading-signals/dist/RSI/RSI.js
|
|
1454
|
-
function
|
|
1455
|
-
return
|
|
1458
|
+
function Qt(t) {
|
|
1459
|
+
return Qt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1456
1460
|
return typeof t;
|
|
1457
1461
|
} : function(t) {
|
|
1458
1462
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1459
|
-
},
|
|
1463
|
+
}, Qt(t);
|
|
1460
1464
|
}
|
|
1461
|
-
function
|
|
1465
|
+
function Wt(t, e) {
|
|
1462
1466
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1463
1467
|
}
|
|
1464
|
-
function
|
|
1468
|
+
function Xt(t, e) {
|
|
1465
1469
|
for (var r = 0; r < e.length; r++) {
|
|
1466
1470
|
var n = e[r];
|
|
1467
1471
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1468
|
-
Object.defineProperty(t,
|
|
1472
|
+
Object.defineProperty(t, ue(n.key), n);
|
|
1469
1473
|
}
|
|
1470
1474
|
}
|
|
1471
|
-
function
|
|
1472
|
-
return e &&
|
|
1475
|
+
function te(t, e, r) {
|
|
1476
|
+
return e && Xt(t.prototype, e), r && Xt(t, r), Object.defineProperty(t, "prototype", {
|
|
1473
1477
|
writable: !1
|
|
1474
1478
|
}), t;
|
|
1475
1479
|
}
|
|
1476
|
-
function
|
|
1477
|
-
return e =
|
|
1478
|
-
if (e && ("object" ==
|
|
1480
|
+
function ee(t, e, r) {
|
|
1481
|
+
return e = ne(e), function(t, e) {
|
|
1482
|
+
if (e && ("object" == Qt(e) || "function" == typeof e)) return e;
|
|
1479
1483
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1480
1484
|
return function(t) {
|
|
1481
1485
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1482
1486
|
return t;
|
|
1483
1487
|
}(t);
|
|
1484
|
-
}(t,
|
|
1488
|
+
}(t, re() ? Reflect.construct(e, r || [], ne(t).constructor) : e.apply(t, r));
|
|
1485
1489
|
}
|
|
1486
|
-
function
|
|
1490
|
+
function re() {
|
|
1487
1491
|
try {
|
|
1488
1492
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1489
1493
|
} catch (t) {}
|
|
1490
|
-
return (
|
|
1494
|
+
return (re = function() {
|
|
1491
1495
|
return !!t;
|
|
1492
1496
|
})();
|
|
1493
1497
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return
|
|
1498
|
+
function ne(t) {
|
|
1499
|
+
return ne = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1496
1500
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1497
|
-
},
|
|
1501
|
+
}, ne(t);
|
|
1498
1502
|
}
|
|
1499
|
-
function
|
|
1503
|
+
function oe(t, e) {
|
|
1500
1504
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1501
1505
|
t.prototype = Object.create(e && e.prototype, {
|
|
1502
1506
|
constructor: {
|
|
@@ -1506,42 +1510,42 @@ var OHLCV_INDICATORS;
|
|
|
1506
1510
|
}
|
|
1507
1511
|
}), Object.defineProperty(t, "prototype", {
|
|
1508
1512
|
writable: !1
|
|
1509
|
-
}), e &&
|
|
1513
|
+
}), e && ie(t, e);
|
|
1510
1514
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return
|
|
1515
|
+
function ie(t, e) {
|
|
1516
|
+
return ie = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1513
1517
|
return t.__proto__ = e, t;
|
|
1514
|
-
},
|
|
1518
|
+
}, ie(t, e);
|
|
1515
1519
|
}
|
|
1516
|
-
function
|
|
1517
|
-
return (e =
|
|
1520
|
+
function ae(t, e, r) {
|
|
1521
|
+
return (e = ue(e)) in t ? Object.defineProperty(t, e, {
|
|
1518
1522
|
value: r,
|
|
1519
1523
|
enumerable: !0,
|
|
1520
1524
|
configurable: !0,
|
|
1521
1525
|
writable: !0
|
|
1522
1526
|
}) : t[e] = r, t;
|
|
1523
1527
|
}
|
|
1524
|
-
function
|
|
1528
|
+
function ue(t) {
|
|
1525
1529
|
var e = function(t, e) {
|
|
1526
|
-
if ("object" !=
|
|
1530
|
+
if ("object" != Qt(t) || !t) return t;
|
|
1527
1531
|
var r = t[Symbol.toPrimitive];
|
|
1528
1532
|
if (void 0 !== r) {
|
|
1529
1533
|
var n = r.call(t, e || "default");
|
|
1530
|
-
if ("object" !=
|
|
1534
|
+
if ("object" != Qt(n)) return n;
|
|
1531
1535
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1532
1536
|
}
|
|
1533
1537
|
return ("string" === e ? String : Number)(t);
|
|
1534
1538
|
}(t, "string");
|
|
1535
|
-
return "symbol" ==
|
|
1539
|
+
return "symbol" == Qt(e) ? e : e + "";
|
|
1536
1540
|
}
|
|
1537
|
-
var
|
|
1541
|
+
var le = function(t) {
|
|
1538
1542
|
function e(t) {
|
|
1539
|
-
var r, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] :
|
|
1540
|
-
return
|
|
1541
|
-
|
|
1543
|
+
var r, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : jt;
|
|
1544
|
+
return Wt(this, e), ae(r = ee(this, e), "interval", void 0), ae(r, "previousPrices", []),
|
|
1545
|
+
ae(r, "avgGain", void 0), ae(r, "avgLoss", void 0), ae(r, "maxValue", 100), r.interval = t,
|
|
1542
1546
|
r.avgGain = new n(r.interval), r.avgLoss = new n(r.interval), r;
|
|
1543
1547
|
}
|
|
1544
|
-
return
|
|
1548
|
+
return oe(e, t), te(e, [ {
|
|
1545
1549
|
key: "update",
|
|
1546
1550
|
value: function(t) {
|
|
1547
1551
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
@@ -1558,28 +1562,28 @@ var OHLCV_INDICATORS;
|
|
|
1558
1562
|
}
|
|
1559
1563
|
}
|
|
1560
1564
|
} ]);
|
|
1561
|
-
}(
|
|
1565
|
+
}(V);
|
|
1562
1566
|
// ./src/oscillators/rsi.js
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1567
|
+
function ce(t) {
|
|
1568
|
+
return ce = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1565
1569
|
return typeof t;
|
|
1566
1570
|
} : function(t) {
|
|
1567
1571
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1568
|
-
},
|
|
1572
|
+
}, ce(t);
|
|
1569
1573
|
}
|
|
1570
|
-
function
|
|
1574
|
+
function se(t, e, r) {
|
|
1571
1575
|
return (e = function(t) {
|
|
1572
1576
|
var e = function(t, e) {
|
|
1573
|
-
if ("object" !=
|
|
1577
|
+
if ("object" != ce(t) || !t) return t;
|
|
1574
1578
|
var r = t[Symbol.toPrimitive];
|
|
1575
1579
|
if (void 0 !== r) {
|
|
1576
1580
|
var n = r.call(t, e || "default");
|
|
1577
|
-
if ("object" !=
|
|
1581
|
+
if ("object" != ce(n)) return n;
|
|
1578
1582
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1579
1583
|
}
|
|
1580
1584
|
return ("string" === e ? String : Number)(t);
|
|
1581
1585
|
}(t, "string");
|
|
1582
|
-
return "symbol" ==
|
|
1586
|
+
return "symbol" == ce(e) ? e : e + "";
|
|
1583
1587
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1584
1588
|
value: r,
|
|
1585
1589
|
enumerable: !0,
|
|
@@ -1587,57 +1591,57 @@ var OHLCV_INDICATORS;
|
|
|
1587
1591
|
writable: !0
|
|
1588
1592
|
}) : t[e] = r, t;
|
|
1589
1593
|
}
|
|
1590
|
-
var
|
|
1591
|
-
ema:
|
|
1592
|
-
sma:
|
|
1593
|
-
},
|
|
1594
|
+
var fe = {
|
|
1595
|
+
ema: $t,
|
|
1596
|
+
sma: ft
|
|
1597
|
+
}, ye = function(t, e, r, n, o) {
|
|
1594
1598
|
var i = o.target, a = (o.lag, o.precomputed), u = t.verticalOhlcv, l = t.instances, c = a.keyName;
|
|
1595
1599
|
if (0 === e && !u.hasOwnProperty(i)) throw new Error("Target property ".concat(i, " not found in verticalOhlcv for ").concat(r, "."));
|
|
1596
1600
|
// Retrieve the current price value.
|
|
1597
1601
|
var s = u[i][e], f = l[c].maInstance;
|
|
1598
1602
|
// Update the moving average instance.
|
|
1599
1603
|
f.update(s);
|
|
1600
|
-
var
|
|
1604
|
+
var y = NaN;
|
|
1601
1605
|
try {
|
|
1602
|
-
|
|
1606
|
+
y = f.getResult();
|
|
1603
1607
|
} catch (t) {}
|
|
1604
1608
|
// Always push the MA value (even if NaN).
|
|
1605
1609
|
return t.pushToMain({
|
|
1606
1610
|
index: e,
|
|
1607
1611
|
key: c,
|
|
1608
|
-
value:
|
|
1612
|
+
value: y
|
|
1609
1613
|
}), !0;
|
|
1610
1614
|
}, he = function(t) {
|
|
1611
|
-
var e = t.main, r = t.size, n = t.target, o = t.lag, i = t.methodName, a = e.instances, u = e.verticalOhlcv, l = e.priceBased, c = e.arrayTypes, s = e.len, f = "close" !== n ? "_".concat(n) : "",
|
|
1615
|
+
var e = t.main, r = t.size, n = t.target, o = t.lag, i = t.methodName, a = e.instances, u = e.verticalOhlcv, l = e.priceBased, c = e.arrayTypes, s = e.len, f = "close" !== n ? "_".concat(n) : "", y = "".concat(i, "_").concat(r).concat(f);
|
|
1612
1616
|
// Create the main moving average instance.
|
|
1613
|
-
return a[
|
|
1614
|
-
maInstance: new
|
|
1615
|
-
}, u[
|
|
1617
|
+
return a[y] = {
|
|
1618
|
+
maInstance: new fe[i](r)
|
|
1619
|
+
}, u[y] = new Float64Array(s).fill(NaN), l.add(y), o > 0 && e.lag([ y ], o), c[y] = "Float64Array",
|
|
1616
1620
|
{
|
|
1617
|
-
keyName:
|
|
1621
|
+
keyName: y
|
|
1618
1622
|
};
|
|
1619
1623
|
};
|
|
1620
1624
|
// ./src/moving-averages/macd.js
|
|
1621
|
-
function
|
|
1622
|
-
return
|
|
1625
|
+
function pe(t) {
|
|
1626
|
+
return pe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1623
1627
|
return typeof t;
|
|
1624
1628
|
} : function(t) {
|
|
1625
1629
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1626
|
-
},
|
|
1630
|
+
}, pe(t);
|
|
1627
1631
|
}
|
|
1628
|
-
function
|
|
1632
|
+
function ve(t, e, r) {
|
|
1629
1633
|
return (e = function(t) {
|
|
1630
1634
|
var e = function(t, e) {
|
|
1631
|
-
if ("object" !=
|
|
1635
|
+
if ("object" != pe(t) || !t) return t;
|
|
1632
1636
|
var r = t[Symbol.toPrimitive];
|
|
1633
1637
|
if (void 0 !== r) {
|
|
1634
1638
|
var n = r.call(t, e || "default");
|
|
1635
|
-
if ("object" !=
|
|
1639
|
+
if ("object" != pe(n)) return n;
|
|
1636
1640
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1637
1641
|
}
|
|
1638
1642
|
return ("string" === e ? String : Number)(t);
|
|
1639
1643
|
}(t, "string");
|
|
1640
|
-
return "symbol" ==
|
|
1644
|
+
return "symbol" == pe(e) ? e : e + "";
|
|
1641
1645
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1642
1646
|
value: r,
|
|
1643
1647
|
enumerable: !0,
|
|
@@ -1645,14 +1649,14 @@ var OHLCV_INDICATORS;
|
|
|
1645
1649
|
writable: !0
|
|
1646
1650
|
}) : t[e] = r, t;
|
|
1647
1651
|
}
|
|
1648
|
-
function
|
|
1652
|
+
function me(t, e) {
|
|
1649
1653
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1650
1654
|
if (!r) {
|
|
1651
1655
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
1652
1656
|
if (t) {
|
|
1653
|
-
if ("string" == typeof t) return
|
|
1657
|
+
if ("string" == typeof t) return de(t, e);
|
|
1654
1658
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1655
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
1659
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? de(t, e) : void 0;
|
|
1656
1660
|
}
|
|
1657
1661
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
1658
1662
|
r && (t = r);
|
|
@@ -1696,22 +1700,22 @@ var OHLCV_INDICATORS;
|
|
|
1696
1700
|
}
|
|
1697
1701
|
};
|
|
1698
1702
|
}
|
|
1699
|
-
function
|
|
1703
|
+
function de(t, e) {
|
|
1700
1704
|
(null == e || e > t.length) && (e = t.length);
|
|
1701
1705
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1702
1706
|
return n;
|
|
1703
1707
|
}
|
|
1704
|
-
var
|
|
1708
|
+
var be = "close";
|
|
1705
1709
|
// ./src/utilities/numberUtilities.js
|
|
1706
|
-
function
|
|
1707
|
-
return
|
|
1710
|
+
function ge(t) {
|
|
1711
|
+
return ge = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1708
1712
|
return typeof t;
|
|
1709
1713
|
} : function(t) {
|
|
1710
1714
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1711
|
-
},
|
|
1715
|
+
}, ge(t);
|
|
1712
1716
|
}
|
|
1713
1717
|
// Helper to clean non-numeric characters (except "-" at the start and decimal point)
|
|
1714
|
-
var
|
|
1718
|
+
var we = {
|
|
1715
1719
|
number: function(t) {
|
|
1716
1720
|
return t;
|
|
1717
1721
|
},
|
|
@@ -1721,7 +1725,7 @@ var OHLCV_INDICATORS;
|
|
|
1721
1725
|
numberDirtyString: function(t) {
|
|
1722
1726
|
return Number(t.replace(/(?!^-)[^0-9.]/g, ""));
|
|
1723
1727
|
}
|
|
1724
|
-
},
|
|
1728
|
+
}, Se = function(t) {
|
|
1725
1729
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
1726
1730
|
// 1) true numbers
|
|
1727
1731
|
if ("number" == typeof t && !Number.isNaN(t)) return "number";
|
|
@@ -1736,43 +1740,43 @@ var OHLCV_INDICATORS;
|
|
|
1736
1740
|
if (o && n.test(o)) return "numberDirtyString";
|
|
1737
1741
|
}
|
|
1738
1742
|
if (e) throw new TypeError("Invalid input: expected a number or numeric string");
|
|
1739
|
-
return
|
|
1740
|
-
},
|
|
1743
|
+
return ge(t);
|
|
1744
|
+
}, Oe = function(t, e) {
|
|
1741
1745
|
var r = Math.pow(10, e);
|
|
1742
1746
|
// add a tiny epsilon to mitigate floating-point quirks around .5
|
|
1743
1747
|
return Math.round((t + Number.EPSILON) * r) / r;
|
|
1744
1748
|
};
|
|
1745
1749
|
// ./src/moving-averages/donchianChannel.js
|
|
1746
|
-
function
|
|
1750
|
+
function je(t) {
|
|
1747
1751
|
return function(t) {
|
|
1748
|
-
if (Array.isArray(t)) return
|
|
1752
|
+
if (Array.isArray(t)) return _e(t);
|
|
1749
1753
|
}(t) || function(t) {
|
|
1750
1754
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1751
|
-
}(t) ||
|
|
1755
|
+
}(t) || Pe(t) || function() {
|
|
1752
1756
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1753
1757
|
}();
|
|
1754
1758
|
}
|
|
1755
|
-
function
|
|
1759
|
+
function Pe(t, e) {
|
|
1756
1760
|
if (t) {
|
|
1757
|
-
if ("string" == typeof t) return
|
|
1761
|
+
if ("string" == typeof t) return _e(t, e);
|
|
1758
1762
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1759
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
1763
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _e(t, e) : void 0;
|
|
1760
1764
|
}
|
|
1761
1765
|
}
|
|
1762
|
-
function
|
|
1766
|
+
function _e(t, e) {
|
|
1763
1767
|
(null == e || e > t.length) && (e = t.length);
|
|
1764
1768
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1765
1769
|
return n;
|
|
1766
1770
|
}
|
|
1767
1771
|
// ./src/moving-averages/bollingerBands.js
|
|
1768
|
-
function
|
|
1769
|
-
return
|
|
1772
|
+
function Ne(t) {
|
|
1773
|
+
return Ne = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1770
1774
|
return typeof t;
|
|
1771
1775
|
} : function(t) {
|
|
1772
1776
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1773
|
-
},
|
|
1777
|
+
}, Ne(t);
|
|
1774
1778
|
}
|
|
1775
|
-
function
|
|
1779
|
+
function Ae(t, e) {
|
|
1776
1780
|
var r = Object.keys(t);
|
|
1777
1781
|
if (Object.getOwnPropertySymbols) {
|
|
1778
1782
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -1782,19 +1786,19 @@ var OHLCV_INDICATORS;
|
|
|
1782
1786
|
}
|
|
1783
1787
|
return r;
|
|
1784
1788
|
}
|
|
1785
|
-
function
|
|
1789
|
+
function Te(t, e, r) {
|
|
1786
1790
|
return (e = function(t) {
|
|
1787
1791
|
var e = function(t, e) {
|
|
1788
|
-
if ("object" !=
|
|
1792
|
+
if ("object" != Ne(t) || !t) return t;
|
|
1789
1793
|
var r = t[Symbol.toPrimitive];
|
|
1790
1794
|
if (void 0 !== r) {
|
|
1791
1795
|
var n = r.call(t, e || "default");
|
|
1792
|
-
if ("object" !=
|
|
1796
|
+
if ("object" != Ne(n)) return n;
|
|
1793
1797
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1794
1798
|
}
|
|
1795
1799
|
return ("string" === e ? String : Number)(t);
|
|
1796
1800
|
}(t, "string");
|
|
1797
|
-
return "symbol" ==
|
|
1801
|
+
return "symbol" == Ne(e) ? e : e + "";
|
|
1798
1802
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1799
1803
|
value: r,
|
|
1800
1804
|
enumerable: !0,
|
|
@@ -1802,14 +1806,14 @@ var OHLCV_INDICATORS;
|
|
|
1802
1806
|
writable: !0
|
|
1803
1807
|
}) : t[e] = r, t;
|
|
1804
1808
|
}
|
|
1805
|
-
function
|
|
1809
|
+
function Ee(t, e) {
|
|
1806
1810
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1807
1811
|
if (!r) {
|
|
1808
1812
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
1809
1813
|
if (t) {
|
|
1810
|
-
if ("string" == typeof t) return
|
|
1814
|
+
if ("string" == typeof t) return ke(t, e);
|
|
1811
1815
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1812
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
1816
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ke(t, e) : void 0;
|
|
1813
1817
|
}
|
|
1814
1818
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
1815
1819
|
r && (t = r);
|
|
@@ -1853,7 +1857,7 @@ var OHLCV_INDICATORS;
|
|
|
1853
1857
|
}
|
|
1854
1858
|
};
|
|
1855
1859
|
}
|
|
1856
|
-
function
|
|
1860
|
+
function ke(t, e) {
|
|
1857
1861
|
(null == e || e > t.length) && (e = t.length);
|
|
1858
1862
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1859
1863
|
return n;
|
|
@@ -1866,7 +1870,7 @@ var OHLCV_INDICATORS;
|
|
|
1866
1870
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1867
1871
|
}, xe(t);
|
|
1868
1872
|
}
|
|
1869
|
-
function
|
|
1873
|
+
function Ie(t, e, r) {
|
|
1870
1874
|
return (e = function(t) {
|
|
1871
1875
|
var e = function(t, e) {
|
|
1872
1876
|
if ("object" != xe(t) || !t) return t;
|
|
@@ -1887,14 +1891,27 @@ var OHLCV_INDICATORS;
|
|
|
1887
1891
|
}) : t[e] = r, t;
|
|
1888
1892
|
}
|
|
1889
1893
|
// ./src/utilities/dateUtilities.js
|
|
1890
|
-
function
|
|
1891
|
-
return
|
|
1894
|
+
function De(t) {
|
|
1895
|
+
return De = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1892
1896
|
return typeof t;
|
|
1893
1897
|
} : function(t) {
|
|
1894
1898
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1895
|
-
},
|
|
1899
|
+
}, De(t);
|
|
1896
1900
|
}
|
|
1897
1901
|
var Me = {
|
|
1902
|
+
string: function(t) {
|
|
1903
|
+
return t.toISOString();
|
|
1904
|
+
},
|
|
1905
|
+
milliseconds: function(t) {
|
|
1906
|
+
return t.getTime();
|
|
1907
|
+
},
|
|
1908
|
+
seconds: function(t) {
|
|
1909
|
+
return t.getTime() / 1e3;
|
|
1910
|
+
},
|
|
1911
|
+
object: function(t) {
|
|
1912
|
+
return t;
|
|
1913
|
+
}
|
|
1914
|
+
}, Re = {
|
|
1898
1915
|
dateObject: function(t) {
|
|
1899
1916
|
return t;
|
|
1900
1917
|
},
|
|
@@ -1910,14 +1927,14 @@ var OHLCV_INDICATORS;
|
|
|
1910
1927
|
dateCompleteDateString: function(t) {
|
|
1911
1928
|
return new Date(t);
|
|
1912
1929
|
}
|
|
1913
|
-
},
|
|
1930
|
+
}, Ce = function(t) {
|
|
1914
1931
|
// Regex for a UTC Time Format where the string ends with "Z".
|
|
1915
1932
|
var e = [ "Date -> object", "Milliseconds Timestamp -> integer", "Seconds Timestamp -> integer", "UTC Time Format (ISO 8601) -> string", "Including a Timezone Offset (ISO 8601) -> string", "Local Time Format (ISO 8601) -> string", "YYYY/MM/DD or YYYY-MM-DD -> string" ], r = function() {
|
|
1916
|
-
throw new Error('Invalid "'.concat(
|
|
1933
|
+
throw new Error('Invalid "'.concat(De(t), '" date value passed in selectDateFormatter. Supported formats: \n-').concat(e.join("\n- ")));
|
|
1917
1934
|
};
|
|
1918
1935
|
// Regex for a Timezone Offset Format,
|
|
1919
1936
|
// which includes a plus or minus sign followed by HH:MM at the end.
|
|
1920
|
-
if ("object" ===
|
|
1937
|
+
if ("object" === De(t)) {
|
|
1921
1938
|
if (t instanceof Date && !isNaN(t.valueOf())) return "dateObject";
|
|
1922
1939
|
r();
|
|
1923
1940
|
} else {
|
|
@@ -1934,7 +1951,7 @@ var OHLCV_INDICATORS;
|
|
|
1934
1951
|
}
|
|
1935
1952
|
};
|
|
1936
1953
|
// ./src/utilities/assignTypes.js
|
|
1937
|
-
function
|
|
1954
|
+
function Fe(t, e) {
|
|
1938
1955
|
return function(t) {
|
|
1939
1956
|
if (Array.isArray(t)) return t;
|
|
1940
1957
|
}(t) || function(t, e) {
|
|
@@ -1959,24 +1976,24 @@ var OHLCV_INDICATORS;
|
|
|
1959
1976
|
}
|
|
1960
1977
|
}(t, e) || function(t, e) {
|
|
1961
1978
|
if (t) {
|
|
1962
|
-
if ("string" == typeof t) return
|
|
1979
|
+
if ("string" == typeof t) return Le(t, e);
|
|
1963
1980
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1964
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
1981
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Le(t, e) : void 0;
|
|
1965
1982
|
}
|
|
1966
1983
|
}(t, e) || function() {
|
|
1967
1984
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1968
1985
|
}();
|
|
1969
1986
|
}
|
|
1970
|
-
function
|
|
1987
|
+
function Le(t, e) {
|
|
1971
1988
|
(null == e || e > t.length) && (e = t.length);
|
|
1972
1989
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1973
1990
|
return n;
|
|
1974
1991
|
}
|
|
1975
|
-
var
|
|
1992
|
+
var Be = new Set([ "open", "high", "low", "close" ]), He = function(t, e) {
|
|
1976
1993
|
return "Array" === t ? new Array(e).fill(null) : "Float64Array" === t ? new Float64Array(e).fill(NaN) : "Int32Array" === t ? new Int32Array(e).fill(NaN) : void 0;
|
|
1977
1994
|
};
|
|
1978
1995
|
// ./src/studies/lag.js
|
|
1979
|
-
function
|
|
1996
|
+
function Ve(t, e) {
|
|
1980
1997
|
return function(t) {
|
|
1981
1998
|
if (Array.isArray(t)) return t;
|
|
1982
1999
|
}(t) || function(t, e) {
|
|
@@ -1999,14 +2016,14 @@ var OHLCV_INDICATORS;
|
|
|
1999
2016
|
}
|
|
2000
2017
|
return u;
|
|
2001
2018
|
}
|
|
2002
|
-
}(t, e) ||
|
|
2019
|
+
}(t, e) || $e(t, e) || function() {
|
|
2003
2020
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2004
2021
|
}();
|
|
2005
2022
|
}
|
|
2006
|
-
function
|
|
2023
|
+
function Ue(t, e) {
|
|
2007
2024
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2008
2025
|
if (!r) {
|
|
2009
|
-
if (Array.isArray(t) || (r =
|
|
2026
|
+
if (Array.isArray(t) || (r = $e(t)) || e && t && "number" == typeof t.length) {
|
|
2010
2027
|
r && (t = r);
|
|
2011
2028
|
var n = 0, o = function() {};
|
|
2012
2029
|
return {
|
|
@@ -2048,22 +2065,22 @@ var OHLCV_INDICATORS;
|
|
|
2048
2065
|
}
|
|
2049
2066
|
};
|
|
2050
2067
|
}
|
|
2051
|
-
function
|
|
2068
|
+
function $e(t, e) {
|
|
2052
2069
|
if (t) {
|
|
2053
|
-
if ("string" == typeof t) return
|
|
2070
|
+
if ("string" == typeof t) return qe(t, e);
|
|
2054
2071
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2055
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
2072
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? qe(t, e) : void 0;
|
|
2056
2073
|
}
|
|
2057
2074
|
}
|
|
2058
|
-
function
|
|
2075
|
+
function qe(t, e) {
|
|
2059
2076
|
(null == e || e > t.length) && (e = t.length);
|
|
2060
2077
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2061
2078
|
return n;
|
|
2062
2079
|
}
|
|
2063
|
-
var
|
|
2080
|
+
var ze = function(t, e) {
|
|
2064
2081
|
var r = t.instances, n = t.verticalOhlcv, o = t.len, i = t.arrayTypes, a = t.priceBased;
|
|
2065
2082
|
if (0 === e) {
|
|
2066
|
-
var u, l = [], c =
|
|
2083
|
+
var u, l = [], c = Ue(t.inputParams);
|
|
2067
2084
|
try {
|
|
2068
2085
|
for (c.s(); !(u = c.n()).done; ) {
|
|
2069
2086
|
var s = u.value;
|
|
@@ -2074,11 +2091,11 @@ var OHLCV_INDICATORS;
|
|
|
2074
2091
|
} finally {
|
|
2075
2092
|
c.f();
|
|
2076
2093
|
}
|
|
2077
|
-
for (var f = 0,
|
|
2078
|
-
var
|
|
2094
|
+
for (var f = 0, y = l; f < y.length; f++) {
|
|
2095
|
+
var h, p = Ve(y[f], 2), v = p[0], m = p[1], d = Ue(v);
|
|
2079
2096
|
try {
|
|
2080
|
-
for (d.s(); !(
|
|
2081
|
-
var b =
|
|
2097
|
+
for (d.s(); !(h = d.n()).done; ) {
|
|
2098
|
+
var b = h.value;
|
|
2082
2099
|
if (a.has(b)) for (var g = 1; g <= m; g++) a.add("".concat(b, "_lag_").concat(g));
|
|
2083
2100
|
}
|
|
2084
2101
|
} catch (t) {
|
|
@@ -2091,26 +2108,26 @@ var OHLCV_INDICATORS;
|
|
|
2091
2108
|
lagParams: l
|
|
2092
2109
|
};
|
|
2093
2110
|
}
|
|
2094
|
-
var w, S =
|
|
2111
|
+
var w, S = Ue(r.lag.lagParams);
|
|
2095
2112
|
try {
|
|
2096
2113
|
for (S.s(); !(w = S.n()).done; ) {
|
|
2097
|
-
var O, j =
|
|
2114
|
+
var O, j = Ve(w.value, 2), P = j[0], _ = j[1], N = Ue(P);
|
|
2098
2115
|
try {
|
|
2099
2116
|
for (N.s(); !(O = N.n()).done; ) {
|
|
2100
2117
|
var A = O.value, T = n[A];
|
|
2101
2118
|
// Initialize lagged arrays only on the first index
|
|
2102
2119
|
if (0 === e) for (var E = 1; E <= _; E++) {
|
|
2103
|
-
var
|
|
2120
|
+
var k = "".concat(A, "_lag_").concat(E);
|
|
2104
2121
|
if (!i.hasOwnProperty(A)) throw new Error('Lag processing invoked by "'.concat(A, '" expected arrayTypes to have a "').concat(A, '" property, but it wasn’t found.'));
|
|
2105
|
-
n[
|
|
2122
|
+
n[k] = He(i[A], o), i[k] = i[A];
|
|
2106
2123
|
}
|
|
2107
2124
|
// Populate lagged values
|
|
2108
|
-
for (var
|
|
2109
|
-
var I = "".concat(A, "_lag_").concat(
|
|
2125
|
+
for (var x = 1; x <= _; x++) {
|
|
2126
|
+
var I = "".concat(A, "_lag_").concat(x), D = e - x, M = D <= 0 || void 0 === T[D] ? null : T[D];
|
|
2110
2127
|
t.pushToMain({
|
|
2111
2128
|
index: e,
|
|
2112
2129
|
key: I,
|
|
2113
|
-
value:
|
|
2130
|
+
value: M
|
|
2114
2131
|
});
|
|
2115
2132
|
}
|
|
2116
2133
|
}
|
|
@@ -2128,14 +2145,14 @@ var OHLCV_INDICATORS;
|
|
|
2128
2145
|
return !0;
|
|
2129
2146
|
};
|
|
2130
2147
|
// ./src/studies/findCrosses.js
|
|
2131
|
-
function
|
|
2148
|
+
function Ge(t, e) {
|
|
2132
2149
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2133
2150
|
if (!r) {
|
|
2134
2151
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
2135
2152
|
if (t) {
|
|
2136
|
-
if ("string" == typeof t) return
|
|
2153
|
+
if ("string" == typeof t) return Ke(t, e);
|
|
2137
2154
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2138
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
2155
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ke(t, e) : void 0;
|
|
2139
2156
|
}
|
|
2140
2157
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
2141
2158
|
r && (t = r);
|
|
@@ -2179,43 +2196,43 @@ var OHLCV_INDICATORS;
|
|
|
2179
2196
|
}
|
|
2180
2197
|
};
|
|
2181
2198
|
}
|
|
2182
|
-
function
|
|
2199
|
+
function Ke(t, e) {
|
|
2183
2200
|
(null == e || e > t.length) && (e = t.length);
|
|
2184
2201
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2185
2202
|
return n;
|
|
2186
2203
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
2204
|
+
function Ye(t) {
|
|
2205
|
+
return Ye = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2189
2206
|
return typeof t;
|
|
2190
2207
|
} : function(t) {
|
|
2191
2208
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2192
|
-
},
|
|
2209
|
+
}, Ye(t);
|
|
2193
2210
|
}
|
|
2194
|
-
function
|
|
2211
|
+
function Je(t, e) {
|
|
2195
2212
|
for (var r = 0; r < e.length; r++) {
|
|
2196
2213
|
var n = e[r];
|
|
2197
2214
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
2198
|
-
Object.defineProperty(t,
|
|
2215
|
+
Object.defineProperty(t, Ze(n.key), n);
|
|
2199
2216
|
}
|
|
2200
2217
|
}
|
|
2201
|
-
function
|
|
2218
|
+
function Ze(t) {
|
|
2202
2219
|
var e = function(t, e) {
|
|
2203
|
-
if ("object" !=
|
|
2220
|
+
if ("object" != Ye(t) || !t) return t;
|
|
2204
2221
|
var r = t[Symbol.toPrimitive];
|
|
2205
2222
|
if (void 0 !== r) {
|
|
2206
2223
|
var n = r.call(t, e || "default");
|
|
2207
|
-
if ("object" !=
|
|
2224
|
+
if ("object" != Ye(n)) return n;
|
|
2208
2225
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2209
2226
|
}
|
|
2210
2227
|
return ("string" === e ? String : Number)(t);
|
|
2211
2228
|
}(t, "string");
|
|
2212
|
-
return "symbol" ==
|
|
2229
|
+
return "symbol" == Ye(e) ? e : e + "";
|
|
2213
2230
|
}
|
|
2214
|
-
var
|
|
2231
|
+
var Qe = function(t, e) {
|
|
2215
2232
|
return t > e;
|
|
2216
|
-
},
|
|
2233
|
+
}, We = function(t, e) {
|
|
2217
2234
|
return t < e;
|
|
2218
|
-
},
|
|
2235
|
+
}, Xe = function() {
|
|
2219
2236
|
return t = function t() {
|
|
2220
2237
|
!function(t, e) {
|
|
2221
2238
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -2239,11 +2256,11 @@ var OHLCV_INDICATORS;
|
|
|
2239
2256
|
this.areHighAndLowUndefined || void 0 !== n && void 0 !== i || (this.areHighAndLowUndefined = !0),
|
|
2240
2257
|
Number.isNaN(r) || Number.isNaN(o) || function(t, e) {
|
|
2241
2258
|
return t === e;
|
|
2242
|
-
}(r, o) ? a = .5 :
|
|
2259
|
+
}(r, o) ? a = .5 : Qe(r, o) ? a = this.areHighAndLowUndefined ? 1 : [ i, o, this.prevLow, this.prevSlow ].every((function(t) {
|
|
2243
2260
|
return !Number.isNaN(t);
|
|
2244
|
-
})) &&
|
|
2261
|
+
})) && We(i, o) && Qe(this.prevLow, this.prevSlow) ? 0 : 1 : We(r, o) && (a = this.areHighAndLowUndefined ? 0 : [ n, o, this.prevHigh, this.prevSlow ].every((function(t) {
|
|
2245
2262
|
return !Number.isNaN(t);
|
|
2246
|
-
})) &&
|
|
2263
|
+
})) && Qe(n, o) && We(this.prevHigh, this.prevSlow) ? 1 : 0), .5 === a ? this.interval = 0 : 1 === a ? this.prevState <= .5 ? this.interval = 1 : this.interval++ : 0 === a && (this.prevState >= .5 ? this.interval = -1 : this.interval--),
|
|
2247
2264
|
1 === this.interval && this.crossIndexes.up.push(t), -1 === this.interval && this.crossIndexes.down.push(t),
|
|
2248
2265
|
//save prev state
|
|
2249
2266
|
Object.assign(this, {
|
|
@@ -2259,21 +2276,21 @@ var OHLCV_INDICATORS;
|
|
|
2259
2276
|
value: function() {
|
|
2260
2277
|
return this.interval;
|
|
2261
2278
|
}
|
|
2262
|
-
} ]) &&
|
|
2279
|
+
} ]) && Je(t.prototype, e), r && Je(t, r), Object.defineProperty(t, "prototype", {
|
|
2263
2280
|
writable: !1
|
|
2264
2281
|
}), t;
|
|
2265
2282
|
var t, e, r;
|
|
2266
|
-
}(),
|
|
2283
|
+
}(), tr = function(t, e) {
|
|
2267
2284
|
var r = t.verticalOhlcv, n = t.instances, o = t.len, i = t.arrayTypes, a = t.verticalOhlcvTempCols;
|
|
2268
2285
|
if (0 === e) {
|
|
2269
2286
|
var u = t.inputParams;
|
|
2270
2287
|
n.crossPairsList = u.reduce((function(t, e) {
|
|
2271
2288
|
var r = e.key, n = e.params;
|
|
2272
2289
|
if ("crossPairs" === r) {
|
|
2273
|
-
var o, i =
|
|
2290
|
+
var o, i = Ge(n);
|
|
2274
2291
|
try {
|
|
2275
2292
|
for (i.s(); !(o = i.n()).done; ) {
|
|
2276
|
-
var a, u =
|
|
2293
|
+
var a, u = Ge(o.value);
|
|
2277
2294
|
try {
|
|
2278
2295
|
for (u.s(); !(a = u.n()).done; ) {
|
|
2279
2296
|
var l = a.value;
|
|
@@ -2294,31 +2311,31 @@ var OHLCV_INDICATORS;
|
|
|
2294
2311
|
return t;
|
|
2295
2312
|
}), []);
|
|
2296
2313
|
}
|
|
2297
|
-
var l, c =
|
|
2314
|
+
var l, c = Ge(n.crossPairsList);
|
|
2298
2315
|
try {
|
|
2299
2316
|
for (c.s(); !(l = c.n()).done; ) {
|
|
2300
|
-
var s = l.value, f = s.fast,
|
|
2301
|
-
if (null != f && null !=
|
|
2302
|
-
var
|
|
2317
|
+
var s = l.value, f = s.fast, y = s.slow;
|
|
2318
|
+
if (null != f && null != y) {
|
|
2319
|
+
var h = "".concat(f, "_x_").concat(y);
|
|
2303
2320
|
if (0 === e) {
|
|
2304
|
-
if ("number" == typeof
|
|
2321
|
+
if ("number" == typeof y && (a.add(y.toString()), r[y.toString()] = new Int32Array(o).fill(y)),
|
|
2305
2322
|
"price" !== f && !r.hasOwnProperty(f)) throw Error('fast "'.concat(f, ' not found in crossPairs"'));
|
|
2306
|
-
if (!r.hasOwnProperty(
|
|
2307
|
-
n[
|
|
2323
|
+
if (!r.hasOwnProperty(y)) throw Error('slow "'.concat(y, ' not found in crossPairs"'));
|
|
2324
|
+
n[h] = new Xe, r[h] = new Int32Array(o).fill(NaN), i[h] = "Int32Array";
|
|
2308
2325
|
}
|
|
2309
2326
|
var p = void 0, v = void 0, m = void 0, d = void 0, b = void 0;
|
|
2310
|
-
"price" === f ? (v = r.close[e], m = r.high[e], d = r.low[e], b = r[
|
|
2327
|
+
"price" === f ? (v = r.close[e], m = r.high[e], d = r.low[e], b = r[y][e], n[h].update(e, {
|
|
2311
2328
|
fast: v,
|
|
2312
2329
|
slow: b,
|
|
2313
2330
|
high: m,
|
|
2314
2331
|
low: d
|
|
2315
|
-
})) : (p = r[f][e], b = r[
|
|
2332
|
+
})) : (p = r[f][e], b = r[y][e], n[h].update(e, {
|
|
2316
2333
|
fast: p,
|
|
2317
2334
|
slow: b
|
|
2318
2335
|
})), t.pushToMain({
|
|
2319
2336
|
index: e,
|
|
2320
|
-
key:
|
|
2321
|
-
value: n[
|
|
2337
|
+
key: h,
|
|
2338
|
+
value: n[h].getResult()
|
|
2322
2339
|
});
|
|
2323
2340
|
}
|
|
2324
2341
|
}
|
|
@@ -2329,14 +2346,14 @@ var OHLCV_INDICATORS;
|
|
|
2329
2346
|
}
|
|
2330
2347
|
};
|
|
2331
2348
|
// ./src/studies/dateTime.js
|
|
2332
|
-
function
|
|
2333
|
-
return
|
|
2349
|
+
function er(t) {
|
|
2350
|
+
return er = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2334
2351
|
return typeof t;
|
|
2335
2352
|
} : function(t) {
|
|
2336
2353
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2337
|
-
},
|
|
2354
|
+
}, er(t);
|
|
2338
2355
|
}
|
|
2339
|
-
function
|
|
2356
|
+
function rr(t, e) {
|
|
2340
2357
|
var r = Object.keys(t);
|
|
2341
2358
|
if (Object.getOwnPropertySymbols) {
|
|
2342
2359
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -2346,19 +2363,19 @@ var OHLCV_INDICATORS;
|
|
|
2346
2363
|
}
|
|
2347
2364
|
return r;
|
|
2348
2365
|
}
|
|
2349
|
-
function
|
|
2366
|
+
function nr(t, e, r) {
|
|
2350
2367
|
return (e = function(t) {
|
|
2351
2368
|
var e = function(t, e) {
|
|
2352
|
-
if ("object" !=
|
|
2369
|
+
if ("object" != er(t) || !t) return t;
|
|
2353
2370
|
var r = t[Symbol.toPrimitive];
|
|
2354
2371
|
if (void 0 !== r) {
|
|
2355
2372
|
var n = r.call(t, e || "default");
|
|
2356
|
-
if ("object" !=
|
|
2373
|
+
if ("object" != er(n)) return n;
|
|
2357
2374
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2358
2375
|
}
|
|
2359
2376
|
return ("string" === e ? String : Number)(t);
|
|
2360
2377
|
}(t, "string");
|
|
2361
|
-
return "symbol" ==
|
|
2378
|
+
return "symbol" == er(e) ? e : e + "";
|
|
2362
2379
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
2363
2380
|
value: r,
|
|
2364
2381
|
enumerable: !0,
|
|
@@ -2366,7 +2383,7 @@ var OHLCV_INDICATORS;
|
|
|
2366
2383
|
writable: !0
|
|
2367
2384
|
}) : t[e] = r, t;
|
|
2368
2385
|
}
|
|
2369
|
-
var
|
|
2386
|
+
var or = function(t) {
|
|
2370
2387
|
var e = t.getMonth(), r = t.getFullYear(), n = t.getHours(), o = t.getMinutes(), i = t.getDay(), a = t.getDate(), u = new Date(t.getFullYear(), t.getMonth(), 1).getDay();
|
|
2371
2388
|
return {
|
|
2372
2389
|
month: e,
|
|
@@ -2379,19 +2396,19 @@ var OHLCV_INDICATORS;
|
|
|
2379
2396
|
};
|
|
2380
2397
|
};
|
|
2381
2398
|
// ./src/studies/scaler.js
|
|
2382
|
-
function
|
|
2399
|
+
function ir(t) {
|
|
2383
2400
|
return function(t) {
|
|
2384
|
-
if (Array.isArray(t)) return
|
|
2401
|
+
if (Array.isArray(t)) return cr(t);
|
|
2385
2402
|
}(t) || function(t) {
|
|
2386
2403
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2387
|
-
}(t) ||
|
|
2404
|
+
}(t) || lr(t) || function() {
|
|
2388
2405
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2389
2406
|
}();
|
|
2390
2407
|
}
|
|
2391
|
-
function
|
|
2408
|
+
function ar(t, e) {
|
|
2392
2409
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2393
2410
|
if (!r) {
|
|
2394
|
-
if (Array.isArray(t) || (r =
|
|
2411
|
+
if (Array.isArray(t) || (r = lr(t)) || e && t && "number" == typeof t.length) {
|
|
2395
2412
|
r && (t = r);
|
|
2396
2413
|
var n = 0, o = function() {};
|
|
2397
2414
|
return {
|
|
@@ -2433,7 +2450,7 @@ var OHLCV_INDICATORS;
|
|
|
2433
2450
|
}
|
|
2434
2451
|
};
|
|
2435
2452
|
}
|
|
2436
|
-
function
|
|
2453
|
+
function ur(t, e) {
|
|
2437
2454
|
return function(t) {
|
|
2438
2455
|
if (Array.isArray(t)) return t;
|
|
2439
2456
|
}
|
|
@@ -2457,36 +2474,36 @@ var OHLCV_INDICATORS;
|
|
|
2457
2474
|
}
|
|
2458
2475
|
return u;
|
|
2459
2476
|
}
|
|
2460
|
-
}(t, e) ||
|
|
2477
|
+
}(t, e) || lr(t, e) || function() {
|
|
2461
2478
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2462
2479
|
}();
|
|
2463
2480
|
}
|
|
2464
|
-
function
|
|
2481
|
+
function lr(t, e) {
|
|
2465
2482
|
if (t) {
|
|
2466
|
-
if ("string" == typeof t) return
|
|
2483
|
+
if ("string" == typeof t) return cr(t, e);
|
|
2467
2484
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2468
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
2485
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? cr(t, e) : void 0;
|
|
2469
2486
|
}
|
|
2470
2487
|
}
|
|
2471
|
-
function
|
|
2488
|
+
function cr(t, e) {
|
|
2472
2489
|
(null == e || e > t.length) && (e = t.length);
|
|
2473
2490
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2474
2491
|
return n;
|
|
2475
2492
|
}
|
|
2476
2493
|
// ./src/core-functions/mainLoop.js
|
|
2477
|
-
function
|
|
2494
|
+
function sr(t) {
|
|
2478
2495
|
return function(t) {
|
|
2479
|
-
if (Array.isArray(t)) return
|
|
2496
|
+
if (Array.isArray(t)) return pr(t);
|
|
2480
2497
|
}(t) || function(t) {
|
|
2481
2498
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2482
|
-
}(t) ||
|
|
2499
|
+
}(t) || hr(t) || function() {
|
|
2483
2500
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2484
2501
|
}();
|
|
2485
2502
|
}
|
|
2486
|
-
function
|
|
2503
|
+
function fr(t, e) {
|
|
2487
2504
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2488
2505
|
if (!r) {
|
|
2489
|
-
if (Array.isArray(t) || (r =
|
|
2506
|
+
if (Array.isArray(t) || (r = hr(t)) || e && t && "number" == typeof t.length) {
|
|
2490
2507
|
r && (t = r);
|
|
2491
2508
|
var n = 0, o = function() {};
|
|
2492
2509
|
return {
|
|
@@ -2528,7 +2545,7 @@ var OHLCV_INDICATORS;
|
|
|
2528
2545
|
}
|
|
2529
2546
|
};
|
|
2530
2547
|
}
|
|
2531
|
-
function
|
|
2548
|
+
function yr(t, e) {
|
|
2532
2549
|
return function(t) {
|
|
2533
2550
|
if (Array.isArray(t)) return t;
|
|
2534
2551
|
}
|
|
@@ -2553,23 +2570,23 @@ var OHLCV_INDICATORS;
|
|
|
2553
2570
|
}
|
|
2554
2571
|
return u;
|
|
2555
2572
|
}
|
|
2556
|
-
}(t, e) ||
|
|
2573
|
+
}(t, e) || hr(t, e) || function() {
|
|
2557
2574
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2558
2575
|
}();
|
|
2559
2576
|
}
|
|
2560
|
-
function
|
|
2577
|
+
function hr(t, e) {
|
|
2561
2578
|
if (t) {
|
|
2562
|
-
if ("string" == typeof t) return
|
|
2579
|
+
if ("string" == typeof t) return pr(t, e);
|
|
2563
2580
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2564
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
2581
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? pr(t, e) : void 0;
|
|
2565
2582
|
}
|
|
2566
2583
|
}
|
|
2567
|
-
function
|
|
2584
|
+
function pr(t, e) {
|
|
2568
2585
|
(null == e || e > t.length) && (e = t.length);
|
|
2569
2586
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2570
2587
|
return n;
|
|
2571
2588
|
}
|
|
2572
|
-
var
|
|
2589
|
+
var vr = {
|
|
2573
2590
|
dateTime: function(t, e, r) {
|
|
2574
2591
|
var n = r.lag, o = t.instances, i = t.verticalOhlcv;
|
|
2575
2592
|
if (0 === e) {
|
|
@@ -2589,9 +2606,9 @@ var OHLCV_INDICATORS;
|
|
|
2589
2606
|
Object.assign(i, function(t) {
|
|
2590
2607
|
for (var e = 1; e < arguments.length; e++) {
|
|
2591
2608
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2592
|
-
e % 2 ?
|
|
2593
|
-
|
|
2594
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
2609
|
+
e % 2 ? rr(Object(r), !0).forEach((function(e) {
|
|
2610
|
+
nr(t, e, r[e]);
|
|
2611
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : rr(Object(r)).forEach((function(e) {
|
|
2595
2612
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2596
2613
|
}));
|
|
2597
2614
|
}
|
|
@@ -2600,7 +2617,7 @@ var OHLCV_INDICATORS;
|
|
|
2600
2617
|
return [ t, new Int32Array(a).fill(NaN) ];
|
|
2601
2618
|
}))))), n > 0 && t.lag(c, n);
|
|
2602
2619
|
}
|
|
2603
|
-
var
|
|
2620
|
+
var y = i.date[e], h = or(y), p = h.day_of_the_week, v = h.day_of_the_month, m = h.week_of_the_month, d = h.month, b = h.year, g = h.hour, w = h.minute, S = y;
|
|
2604
2621
|
S !== o.dateTime.prevDateStr && (o.dateTime.prevDateStr = S, o.dateTime.sessionDailyIndexCount++,
|
|
2605
2622
|
o.dateTime.sessionIntradayIndexCount = 0), t.pushToMain({
|
|
2606
2623
|
index: e,
|
|
@@ -2644,17 +2661,17 @@ var OHLCV_INDICATORS;
|
|
|
2644
2661
|
var o = n.target, i = n.lag, a = t.verticalOhlcv, u = t.instances, l = "close" === o ? "" : "_".concat(o), c = "rsi_".concat(r).concat(l), s = "rsi_sma_".concat(r).concat(l);
|
|
2645
2662
|
// Initialization on the first index.
|
|
2646
2663
|
if (0 === e) {
|
|
2647
|
-
var f = t.crossPairsList,
|
|
2664
|
+
var f = t.crossPairsList, y = t.len, h = t.arrayTypes;
|
|
2648
2665
|
if (!a.hasOwnProperty(o)) throw new Error("Target property ".concat(o, " not found in verticalOhlcv for rsi."));
|
|
2649
2666
|
f.push({
|
|
2650
2667
|
fast: c,
|
|
2651
2668
|
slow: s,
|
|
2652
2669
|
isDefault: !0
|
|
2653
|
-
}), Object.assign(u,
|
|
2670
|
+
}), Object.assign(u, se(se({}, c, new le(r)), s, new ft(r))), Object.assign(a, se(se({}, c, new Float64Array(y).fill(NaN)), s, new Float64Array(y).fill(NaN)));
|
|
2654
2671
|
var p = [ c, s ];
|
|
2655
2672
|
i > 0 && t.lag(p, i);
|
|
2656
2673
|
for (var v = 0, m = p; v < m.length; v++) {
|
|
2657
|
-
|
|
2674
|
+
h[m[v]] = "Float64Array";
|
|
2658
2675
|
}
|
|
2659
2676
|
}
|
|
2660
2677
|
var d = a[o][e], b = NaN, g = NaN;
|
|
@@ -2685,15 +2702,15 @@ var OHLCV_INDICATORS;
|
|
|
2685
2702
|
value: g
|
|
2686
2703
|
});
|
|
2687
2704
|
},
|
|
2688
|
-
ema:
|
|
2689
|
-
sma:
|
|
2705
|
+
ema: ye,
|
|
2706
|
+
sma: ye,
|
|
2690
2707
|
macd: function(t, e, r, n, o, i) {
|
|
2691
2708
|
var a = i.target, u = i.lag, l = i.precomputed, c = t.verticalOhlcv, s = t.instances, f = l.instanceKey;
|
|
2692
2709
|
// Initialization on the first index.
|
|
2693
2710
|
if (0 === e) {
|
|
2694
|
-
var
|
|
2711
|
+
var y = t.inputParams, h = t.crossPairsList, p = t.priceBased, v = t.len, m = t.arrayTypes;
|
|
2695
2712
|
if (!c.hasOwnProperty(a)) throw new Error("Target property ".concat(a, " not found in verticalOhlcv for macd."));
|
|
2696
|
-
var d, b = 0, g =
|
|
2713
|
+
var d, b = 0, g = me(y);
|
|
2697
2714
|
try {
|
|
2698
2715
|
for (g.s(); !(d = g.n()).done; ) {
|
|
2699
2716
|
"macd" === d.value.key && b++;
|
|
@@ -2704,16 +2721,16 @@ var OHLCV_INDICATORS;
|
|
|
2704
2721
|
} finally {
|
|
2705
2722
|
g.f();
|
|
2706
2723
|
}
|
|
2707
|
-
var w = b > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", S = a ===
|
|
2724
|
+
var w = b > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", S = a === be ? "".concat(w, "_diff") : "".concat(w, "_diff_").concat(a), O = a === be ? "".concat(w, "_dea") : "".concat(w, "_dea_").concat(a), j = a === be ? "".concat(w, "_histogram") : "".concat(w, "_histogram_").concat(a);
|
|
2708
2725
|
// Build the keys.
|
|
2709
|
-
|
|
2726
|
+
h.push({
|
|
2710
2727
|
fast: S,
|
|
2711
2728
|
slow: O,
|
|
2712
2729
|
isDefault: !0
|
|
2713
2730
|
}), s.hasOwnProperty("macd") || (s.macd = {
|
|
2714
2731
|
numberOfIndicators: b,
|
|
2715
2732
|
settings: {}
|
|
2716
|
-
}), s.macd.settings[f] = new
|
|
2733
|
+
}), s.macd.settings[f] = new Zt(new $t(r), new $t(n), new $t(o)), Object.assign(c, ve(ve(ve({}, S, new Float64Array(v).fill(NaN)), O, new Float64Array(v).fill(NaN)), j, new Float64Array(v).fill(NaN)))[j].forEach((function(t) {
|
|
2717
2734
|
p.add(t);
|
|
2718
2735
|
}));
|
|
2719
2736
|
var P = [ S, O, j ];
|
|
@@ -2722,18 +2739,18 @@ var OHLCV_INDICATORS;
|
|
|
2722
2739
|
m[N[_]] = "Float64Array";
|
|
2723
2740
|
}
|
|
2724
2741
|
}
|
|
2725
|
-
var A = s.macd, T = A.numberOfIndicators, E = A.settings,
|
|
2726
|
-
|
|
2742
|
+
var A = s.macd, T = A.numberOfIndicators, E = A.settings, k = T > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", x = a === be ? "".concat(k, "_diff") : "".concat(k, "_diff_").concat(a), I = a === be ? "".concat(k, "_dea") : "".concat(k, "_dea_").concat(a), D = a === be ? "".concat(k, "_histogram") : "".concat(k, "_histogram_").concat(a), M = E[f], R = c[a][e];
|
|
2743
|
+
M.update(R);
|
|
2727
2744
|
var C = {};
|
|
2728
2745
|
try {
|
|
2729
|
-
C =
|
|
2746
|
+
C = M.getResult();
|
|
2730
2747
|
} catch (t) {
|
|
2731
2748
|
// If the result is unavailable, macdResult remains NaN.
|
|
2732
2749
|
}
|
|
2733
2750
|
// Always push values; use NaN as fallback when macdResult is missing.
|
|
2734
2751
|
return t.pushToMain({
|
|
2735
2752
|
index: e,
|
|
2736
|
-
key:
|
|
2753
|
+
key: x,
|
|
2737
2754
|
value: C ? C.macd : NaN
|
|
2738
2755
|
}), t.pushToMain({
|
|
2739
2756
|
index: e,
|
|
@@ -2741,7 +2758,7 @@ var OHLCV_INDICATORS;
|
|
|
2741
2758
|
value: C ? C.signal : NaN
|
|
2742
2759
|
}), t.pushToMain({
|
|
2743
2760
|
index: e,
|
|
2744
|
-
key:
|
|
2761
|
+
key: D,
|
|
2745
2762
|
value: C ? C.histogram : NaN
|
|
2746
2763
|
}), !0;
|
|
2747
2764
|
},
|
|
@@ -2750,26 +2767,26 @@ var OHLCV_INDICATORS;
|
|
|
2750
2767
|
if (0 === e) {
|
|
2751
2768
|
var l = t.len, c = t.arrayTypes;
|
|
2752
2769
|
a[i] = {
|
|
2753
|
-
instance: new
|
|
2770
|
+
instance: new ft(r),
|
|
2754
2771
|
prevRelativeVolumeSma: NaN
|
|
2755
2772
|
}, u[i] = new Float64Array(l).fill(NaN), o > 0 && t.lag([ i ], o), c[i] = "Float64Array";
|
|
2756
2773
|
}
|
|
2757
2774
|
var s = u.volume[e], f = a[i].instance;
|
|
2758
2775
|
f.update(s);
|
|
2759
|
-
var
|
|
2776
|
+
var y = NaN;
|
|
2760
2777
|
try {
|
|
2761
|
-
|
|
2778
|
+
y = f.getResult();
|
|
2762
2779
|
} catch (t) {}
|
|
2763
|
-
var
|
|
2780
|
+
var h = a[i].prevRelativeVolumeSma, p = NaN;
|
|
2764
2781
|
// Only calculate relative volume if both current SMA and previous SMA are valid numbers and prevSma is not zero.
|
|
2765
|
-
return Number.isNaN(
|
|
2782
|
+
return Number.isNaN(y) || Number.isNaN(h) || (p = s / h), t.pushToMain({
|
|
2766
2783
|
index: e,
|
|
2767
2784
|
key: i,
|
|
2768
2785
|
value: p
|
|
2769
|
-
}), a[i].prevRelativeVolumeSma =
|
|
2786
|
+
}), a[i].prevRelativeVolumeSma = y, !0;
|
|
2770
2787
|
},
|
|
2771
2788
|
donchianChannels: function(t, e, r, n, o) {
|
|
2772
|
-
var i = t.verticalOhlcv, a = t.instances, u = t.len, l = t.inputParams, c = t.priceBased, s = t.arrayTypes, f = t.lag,
|
|
2789
|
+
var i = t.verticalOhlcv, a = t.instances, u = t.len, l = t.inputParams, c = t.priceBased, s = t.arrayTypes, f = t.lag, y = o.height, h = o.range, p = o.decimals, v = "".concat(r, "_").concat(n);
|
|
2773
2790
|
// ---- INIT (only at first bar) ----
|
|
2774
2791
|
if (0 === e) {
|
|
2775
2792
|
// how many donchianChannels calls in this session?
|
|
@@ -2778,11 +2795,11 @@ var OHLCV_INDICATORS;
|
|
|
2778
2795
|
})).length, d = "donchian_channel", b = m > 1 ? "".concat(d, "_").concat(v) : d, g = [ "upper", "basis", "lower" ].map((function(t) {
|
|
2779
2796
|
return "".concat(b, "_").concat(t);
|
|
2780
2797
|
}));
|
|
2781
|
-
|
|
2798
|
+
y && g.push("".concat(b, "_height"));
|
|
2782
2799
|
var w, S = function(t, e) {
|
|
2783
2800
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2784
2801
|
if (!r) {
|
|
2785
|
-
if (Array.isArray(t) || (r =
|
|
2802
|
+
if (Array.isArray(t) || (r = Pe(t)) || e && t && "number" == typeof t.length) {
|
|
2786
2803
|
r && (t = r);
|
|
2787
2804
|
var n = 0, o = function() {};
|
|
2788
2805
|
return {
|
|
@@ -2823,11 +2840,11 @@ var OHLCV_INDICATORS;
|
|
|
2823
2840
|
}
|
|
2824
2841
|
}
|
|
2825
2842
|
};
|
|
2826
|
-
}(
|
|
2843
|
+
}(h);
|
|
2827
2844
|
try {
|
|
2828
2845
|
for (S.s(); !(w = S.n()).done; ) {
|
|
2829
2846
|
var O = w.value;
|
|
2830
|
-
if (!(O in i) || !c.has(O)) throw new Error('Invalid range key "'.concat(O, '". Only price-based keys are allowed: ').concat(
|
|
2847
|
+
if (!(O in i) || !c.has(O)) throw new Error('Invalid range key "'.concat(O, '". Only price-based keys are allowed: ').concat(je(c)));
|
|
2831
2848
|
g.push("".concat(b, "_range_").concat(O));
|
|
2832
2849
|
}
|
|
2833
2850
|
// bootstrap instance
|
|
@@ -2857,34 +2874,34 @@ var OHLCV_INDICATORS;
|
|
|
2857
2874
|
}));
|
|
2858
2875
|
}
|
|
2859
2876
|
// ---- PER-BAR COMPUTATION ----
|
|
2860
|
-
var j = a.donchian_channel, P = j.numberOfIndicators, _ = j.settings, N = P > 1 ? "donchian_channel_".concat(v) : "donchian_channel", A = _[v], T = A.maxDeque, E = A.minDeque,
|
|
2877
|
+
var j = a.donchian_channel, P = j.numberOfIndicators, _ = j.settings, N = P > 1 ? "donchian_channel_".concat(v) : "donchian_channel", A = _[v], T = A.maxDeque, E = A.minDeque, k = e - n, x = k - r + 1, I = [ "upper", "basis", "lower" ].map((function(t) {
|
|
2861
2878
|
return "".concat(N, "_").concat(t);
|
|
2862
2879
|
}));
|
|
2863
|
-
|
|
2864
|
-
var
|
|
2880
|
+
y && I.push("".concat(N, "_height"));
|
|
2881
|
+
var D = h.map((function(t) {
|
|
2865
2882
|
return "".concat(N, "_range_").concat(t);
|
|
2866
2883
|
}));
|
|
2867
2884
|
// not enough data → push NaNs
|
|
2868
|
-
if (
|
|
2885
|
+
if (x < 0 || k + 1 > u) return [].concat(je(I), je(D)).forEach((function(r) {
|
|
2869
2886
|
return t.pushToMain({
|
|
2870
2887
|
index: e,
|
|
2871
2888
|
key: r,
|
|
2872
2889
|
value: NaN
|
|
2873
2890
|
});
|
|
2874
2891
|
})), !0;
|
|
2875
|
-
var
|
|
2876
|
-
for (;t.length && t[0] <
|
|
2877
|
-
for (;t.length && r(e[t.at(-1)], e[
|
|
2878
|
-
t.push(
|
|
2892
|
+
var M = i.high, R = i.low, C = function(t, e, r) {
|
|
2893
|
+
for (;t.length && t[0] < x; ) t.shift();
|
|
2894
|
+
for (;t.length && r(e[t.at(-1)], e[k]); ) t.pop();
|
|
2895
|
+
t.push(k);
|
|
2879
2896
|
};
|
|
2880
2897
|
// tiny helper to keep deques up-to-date
|
|
2881
|
-
C(T,
|
|
2898
|
+
C(T, M, (function(t, e) {
|
|
2882
2899
|
return t <= e;
|
|
2883
2900
|
})), C(E, R, (function(t, e) {
|
|
2884
2901
|
return t >= e;
|
|
2885
2902
|
}));
|
|
2886
2903
|
// single “bounds exist?” flag instead of repeated isNaN
|
|
2887
|
-
var F = T.length && E.length, L = F ?
|
|
2904
|
+
var F = T.length && E.length, L = F ? M[T[0]] : NaN, B = F ? R[E[0]] : NaN, H = F ? (L + B) / 2 : NaN;
|
|
2888
2905
|
if (t.pushToMain({
|
|
2889
2906
|
index: e,
|
|
2890
2907
|
key: "".concat(N, "_upper"),
|
|
@@ -2897,34 +2914,34 @@ var OHLCV_INDICATORS;
|
|
|
2897
2914
|
index: e,
|
|
2898
2915
|
key: "".concat(N, "_lower"),
|
|
2899
2916
|
value: B
|
|
2900
|
-
}),
|
|
2917
|
+
}), y) {
|
|
2901
2918
|
// avoid divide-by-zero
|
|
2902
2919
|
var V = F && B ? (L - B) / B : NaN;
|
|
2903
2920
|
t.pushToMain({
|
|
2904
2921
|
index: e,
|
|
2905
2922
|
key: "".concat(N, "_height"),
|
|
2906
|
-
value: null === p ? V :
|
|
2923
|
+
value: null === p ? V : Oe(V, p)
|
|
2907
2924
|
});
|
|
2908
2925
|
}
|
|
2909
2926
|
// precompute spread once
|
|
2910
2927
|
// for each extra range key, use price===price to skip NaNs
|
|
2911
|
-
for (var U = F ? L - B : NaN, $ = 0; $ <
|
|
2912
|
-
var q = i[
|
|
2928
|
+
for (var U = F ? L - B : NaN, $ = 0; $ < h.length; $++) {
|
|
2929
|
+
var q = i[h[$]][e], z = F && q == q && U ? (q - B) / U : NaN;
|
|
2913
2930
|
t.pushToMain({
|
|
2914
2931
|
index: e,
|
|
2915
|
-
key:
|
|
2916
|
-
value: null === p ? z :
|
|
2932
|
+
key: D[$],
|
|
2933
|
+
value: null === p ? z : Oe(z, p)
|
|
2917
2934
|
});
|
|
2918
2935
|
}
|
|
2919
2936
|
return !0;
|
|
2920
2937
|
},
|
|
2921
2938
|
bollingerBands: function(t, e, r, n, o) {
|
|
2922
|
-
var i, a, u, l, c, s, f,
|
|
2939
|
+
var i, a, u, l, c, s, f, y = o.height, h = o.range, p = void 0 === h ? [] : h, v = o.target, m = o.lag, d = o.decimals, b = t.verticalOhlcv, g = t.instances, w = "close" === v ? "" : "_".concat(v), S = "".concat(r, "_").concat(n).concat(w);
|
|
2923
2940
|
// Initialization on the first call.
|
|
2924
2941
|
if (0 === e) {
|
|
2925
2942
|
var O = t.priceBased, j = t.inputParams, P = t.verticalOhlcv, _ = t.len, N = t.arrayTypes;
|
|
2926
2943
|
if (!(v in P)) throw new Error('bollingerBands could not find target "'.concat(v, '"'));
|
|
2927
|
-
var A, T = 0, E =
|
|
2944
|
+
var A, T = 0, E = Ee(j);
|
|
2928
2945
|
try {
|
|
2929
2946
|
for (E.s(); !(A = E.n()).done; ) {
|
|
2930
2947
|
"bollingerBands" === A.value.key && T++;
|
|
@@ -2942,38 +2959,38 @@ var OHLCV_INDICATORS;
|
|
|
2942
2959
|
}),
|
|
2943
2960
|
// Add (or override) the indicator instance keyed by indicatorKey.
|
|
2944
2961
|
g.bollinger_bands.settings[S] = new xt(r, n);
|
|
2945
|
-
var
|
|
2946
|
-
|
|
2962
|
+
var k = [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ];
|
|
2963
|
+
y && k.push("".concat(f, "_height"));
|
|
2947
2964
|
// Set up additional arrays for each range property.
|
|
2948
|
-
var
|
|
2965
|
+
var x, I = Ee(p);
|
|
2949
2966
|
try {
|
|
2950
|
-
for (I.s(); !(
|
|
2951
|
-
var
|
|
2952
|
-
if (!(
|
|
2953
|
-
|
|
2967
|
+
for (I.s(); !(x = I.n()).done; ) {
|
|
2968
|
+
var D = x.value;
|
|
2969
|
+
if (!(D in P) || !O.has(D)) throw new Error('Invalid range item value "'.concat(D, '" property for bollingerBands. Only price based key names are accepted:\n').concat(JSON.stringify(O)));
|
|
2970
|
+
k.push("".concat(f, "_range_").concat(D));
|
|
2954
2971
|
}
|
|
2955
2972
|
} catch (t) {
|
|
2956
2973
|
I.e(t);
|
|
2957
2974
|
} finally {
|
|
2958
2975
|
I.f();
|
|
2959
2976
|
}
|
|
2960
|
-
var
|
|
2977
|
+
var M = Object.fromEntries(k.map((function(t) {
|
|
2961
2978
|
return [ t, new Float64Array(_).fill(NaN) ];
|
|
2962
2979
|
})));
|
|
2963
2980
|
Object.assign(P, function(t) {
|
|
2964
2981
|
for (var e = 1; e < arguments.length; e++) {
|
|
2965
2982
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2966
|
-
e % 2 ?
|
|
2967
|
-
|
|
2968
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
2983
|
+
e % 2 ? Ae(Object(r), !0).forEach((function(e) {
|
|
2984
|
+
Te(t, e, r[e]);
|
|
2985
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Ae(Object(r)).forEach((function(e) {
|
|
2969
2986
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2970
2987
|
}));
|
|
2971
2988
|
}
|
|
2972
2989
|
return t;
|
|
2973
|
-
}({},
|
|
2990
|
+
}({}, M)), m > 0 && t.lag(k, m), [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ].forEach((function(t) {
|
|
2974
2991
|
O.add(t);
|
|
2975
2992
|
}));
|
|
2976
|
-
for (var R = 0, C =
|
|
2993
|
+
for (var R = 0, C = k; R < C.length; R++) {
|
|
2977
2994
|
N[C[R]] = "Float64Array";
|
|
2978
2995
|
}
|
|
2979
2996
|
}
|
|
@@ -3006,16 +3023,16 @@ var OHLCV_INDICATORS;
|
|
|
3006
3023
|
index: e,
|
|
3007
3024
|
key: "".concat(F, "_lower"),
|
|
3008
3025
|
value: $
|
|
3009
|
-
}),
|
|
3026
|
+
}), y) {
|
|
3010
3027
|
var q = NaN;
|
|
3011
3028
|
Number.isNaN($) || Number.isNaN(V) || (q = (V - $) / $), t.pushToMain({
|
|
3012
3029
|
index: e,
|
|
3013
3030
|
key: "".concat(F, "_height"),
|
|
3014
|
-
value: null === d ? q :
|
|
3031
|
+
value: null === d ? q : Oe(q, d)
|
|
3015
3032
|
});
|
|
3016
3033
|
}
|
|
3017
3034
|
// Process each range property.
|
|
3018
|
-
var z, G =
|
|
3035
|
+
var z, G = Ee(p);
|
|
3019
3036
|
try {
|
|
3020
3037
|
for (G.s(); !(z = G.n()).done; ) {
|
|
3021
3038
|
var K = z.value, Y = NaN, J = b[K][e];
|
|
@@ -3023,7 +3040,7 @@ var OHLCV_INDICATORS;
|
|
|
3023
3040
|
t.pushToMain({
|
|
3024
3041
|
index: e,
|
|
3025
3042
|
key: "".concat(F, "_range_").concat(K),
|
|
3026
|
-
value: null === d ? Y :
|
|
3043
|
+
value: null === d ? Y : Oe(Y, d)
|
|
3027
3044
|
});
|
|
3028
3045
|
}
|
|
3029
3046
|
} catch (t) {
|
|
@@ -3036,17 +3053,17 @@ var OHLCV_INDICATORS;
|
|
|
3036
3053
|
volumeOscillator: function(t, e, r, n, o) {
|
|
3037
3054
|
var i = o.lag, a = t.verticalOhlcv, u = t.instances, l = a.volume[e], c = "volume_oscillator_".concat(r, "_").concat(n);
|
|
3038
3055
|
if (0 === e) {
|
|
3039
|
-
var s = t.crossPairsList, f = t.len,
|
|
3040
|
-
Object.assign(u,
|
|
3041
|
-
fastEMA: new
|
|
3042
|
-
slowEMA: new
|
|
3056
|
+
var s = t.crossPairsList, f = t.len, y = t.arrayTypes;
|
|
3057
|
+
Object.assign(u, Ie({}, c, {
|
|
3058
|
+
fastEMA: new $t(r),
|
|
3059
|
+
slowEMA: new $t(n)
|
|
3043
3060
|
})), a[c] = new Float64Array(f).fill(NaN), s.push({
|
|
3044
3061
|
fast: c,
|
|
3045
3062
|
slow: 0,
|
|
3046
3063
|
isDefault: !0
|
|
3047
|
-
}), i > 0 && t.lag([ c ], i),
|
|
3064
|
+
}), i > 0 && t.lag([ c ], i), y[c] = "Float64Array";
|
|
3048
3065
|
}
|
|
3049
|
-
var
|
|
3066
|
+
var h = u[c], p = h.fastEMA, v = h.slowEMA;
|
|
3050
3067
|
p.update(l), v.update(l);
|
|
3051
3068
|
var m = NaN, d = NaN;
|
|
3052
3069
|
try {
|
|
@@ -3063,19 +3080,19 @@ var OHLCV_INDICATORS;
|
|
|
3063
3080
|
}), !0;
|
|
3064
3081
|
},
|
|
3065
3082
|
scaler: function(t, e, r, n, o) {
|
|
3066
|
-
var i = o.type, a = o.group, u = o.range, l = o.lag, c = o.precomputed, s = o.decimals, f = c.groupKey,
|
|
3083
|
+
var i = o.type, a = o.group, u = o.range, l = o.lag, c = o.precomputed, s = o.decimals, f = c.groupKey, y = c.groupKeyLen, h = t.verticalOhlcv, p = t.instances, v = t.arrayTypes, m = "".concat(i, "_").concat(r);
|
|
3067
3084
|
if (0 === e) {
|
|
3068
3085
|
var d = t.len;
|
|
3069
3086
|
p.hasOwnProperty("scaler") || (p.scaler = {
|
|
3070
3087
|
windows: {}
|
|
3071
3088
|
});
|
|
3072
|
-
var b, g =
|
|
3089
|
+
var b, g = ar(n);
|
|
3073
3090
|
try {
|
|
3074
3091
|
var w = function() {
|
|
3075
3092
|
var e = b.value;
|
|
3076
|
-
if (!
|
|
3093
|
+
if (!h.hasOwnProperty(e)) throw new Error('Target property "'.concat(e, '" not found in verticalOhlcv'));
|
|
3077
3094
|
var r = "".concat(m, "_").concat(e);
|
|
3078
|
-
|
|
3095
|
+
h[r] = new Float64Array(d).fill(NaN), v[r] = "Float64Array";
|
|
3079
3096
|
var n = a ? f : e;
|
|
3080
3097
|
if (p.scaler.windows[n] = [], a && (t.scaledGroups[f] || (t.scaledGroups[f] = []),
|
|
3081
3098
|
t.scaledGroups[f].push(r)), l > 0) {
|
|
@@ -3085,7 +3102,7 @@ var OHLCV_INDICATORS;
|
|
|
3085
3102
|
}).map((function(t, e) {
|
|
3086
3103
|
return "".concat(r, "_lag_").concat(e + 1);
|
|
3087
3104
|
}));
|
|
3088
|
-
(o = t.scaledGroups[f]).push.apply(o,
|
|
3105
|
+
(o = t.scaledGroups[f]).push.apply(o, ir(i));
|
|
3089
3106
|
}
|
|
3090
3107
|
t.lag([ r ], l);
|
|
3091
3108
|
}
|
|
@@ -3097,28 +3114,28 @@ var OHLCV_INDICATORS;
|
|
|
3097
3114
|
g.f();
|
|
3098
3115
|
}
|
|
3099
3116
|
}
|
|
3100
|
-
var S, O = p.scaler.windows, j =
|
|
3117
|
+
var S, O = p.scaler.windows, j = ar(n);
|
|
3101
3118
|
// update windows with current values
|
|
3102
3119
|
try {
|
|
3103
3120
|
for (j.s(); !(S = j.n()).done; ) {
|
|
3104
|
-
var P = S.value, _ =
|
|
3105
|
-
N.push(_), N.length > (a ? r *
|
|
3121
|
+
var P = S.value, _ = h[P][e], N = O[a ? f : P];
|
|
3122
|
+
N.push(_), N.length > (a ? r * y : r) && N.shift();
|
|
3106
3123
|
}
|
|
3107
3124
|
} catch (t) {
|
|
3108
3125
|
j.e(t);
|
|
3109
3126
|
} finally {
|
|
3110
3127
|
j.f();
|
|
3111
3128
|
}
|
|
3112
|
-
var A, T = e + 1 >= r, E =
|
|
3129
|
+
var A, T = e + 1 >= r, E = ar(n);
|
|
3113
3130
|
// scale values once enough data
|
|
3114
3131
|
try {
|
|
3115
|
-
var
|
|
3116
|
-
var r, n, o, l, c,
|
|
3132
|
+
var k = function() {
|
|
3133
|
+
var r, n, o, l, c, y, p = A.value, v = h[p][e], d = "".concat(m, "_").concat(p), b = null;
|
|
3117
3134
|
if (T) {
|
|
3118
3135
|
var g = O[a ? f : p];
|
|
3119
3136
|
if ("minmax" === i) {
|
|
3120
|
-
var w = Math.min.apply(Math,
|
|
3121
|
-
r = v, n = w, o = S, l =
|
|
3137
|
+
var w = Math.min.apply(Math, ir(g)), S = Math.max.apply(Math, ir(g));
|
|
3138
|
+
r = v, n = w, o = S, l = ur(u, 2), c = l[0], y = l[1], b = (Math.min(Math.max(r, n), o) - n) / (o - n) * (y - c) + c;
|
|
3122
3139
|
} else {
|
|
3123
3140
|
if ("zscore" !== i) throw new Error('Unknown scaler type "'.concat(i, '"'));
|
|
3124
3141
|
var j = g.reduce((function(t, e) {
|
|
@@ -3134,53 +3151,53 @@ var OHLCV_INDICATORS;
|
|
|
3134
3151
|
t.pushToMain({
|
|
3135
3152
|
index: e,
|
|
3136
3153
|
key: d,
|
|
3137
|
-
value: null === s ? b :
|
|
3154
|
+
value: null === s ? b : Oe(b, s)
|
|
3138
3155
|
});
|
|
3139
3156
|
};
|
|
3140
|
-
for (E.s(); !(A = E.n()).done; )
|
|
3157
|
+
for (E.s(); !(A = E.n()).done; ) k();
|
|
3141
3158
|
} catch (t) {
|
|
3142
3159
|
E.e(t);
|
|
3143
3160
|
} finally {
|
|
3144
3161
|
E.f();
|
|
3145
3162
|
}
|
|
3146
3163
|
}
|
|
3147
|
-
},
|
|
3148
|
-
for (var r = t.length, n = new
|
|
3164
|
+
}, mr = function(t, e) {
|
|
3165
|
+
for (var r = t.length, n = new ft(e), o = new Array(r), i = 0, a = 0, u = 0, l = 0; l < r; l++) if (n.update(t[l]),
|
|
3149
3166
|
n.isStable) {
|
|
3150
3167
|
var c = n.getResult();
|
|
3151
3168
|
o[l] = c, i += c, a += c * c, u++;
|
|
3152
3169
|
} else o[l] = null;
|
|
3153
|
-
var s = i / u, f = a / u - s * s,
|
|
3170
|
+
var s = i / u, f = a / u - s * s, y = Math.sqrt(f);
|
|
3154
3171
|
return o.map((function(t) {
|
|
3155
|
-
return null !== t ? (t - s) /
|
|
3172
|
+
return null !== t ? (t - s) / y : null;
|
|
3156
3173
|
}));
|
|
3157
|
-
},
|
|
3174
|
+
}, dr = function(t, e) {
|
|
3158
3175
|
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5;
|
|
3159
3176
|
if (t.length !== e.length) throw new Error("Both arrays must have the same length");
|
|
3160
|
-
for (var n =
|
|
3177
|
+
for (var n = mr(t, r), o = mr(e, r), i = t.length, a = [], u = 0, l = 0, c = 0, s = 0, f = 0, y = 0, h = -1, p = 0; p < i; p++) {
|
|
3161
3178
|
if (null !== n[p] && null !== o[p]) {
|
|
3162
|
-
|
|
3179
|
+
h = p;
|
|
3163
3180
|
break;
|
|
3164
3181
|
}
|
|
3165
3182
|
a.push(0);
|
|
3166
3183
|
}
|
|
3167
|
-
if (-1 ===
|
|
3184
|
+
if (-1 === h)
|
|
3168
3185
|
// No valid data points
|
|
3169
3186
|
return new Array(i).fill(0);
|
|
3170
|
-
for (var v =
|
|
3187
|
+
for (var v = h; v < i; v++) {
|
|
3171
3188
|
var m = n[v], d = o[v];
|
|
3172
3189
|
if (null !== m && null !== d) if (u += m, l += d, c += m * d, s += m * m, f += d * d,
|
|
3173
|
-
++
|
|
3174
|
-
var b =
|
|
3190
|
+
++y < 2) a.push(0); else {
|
|
3191
|
+
var b = y * c - u * l, g = Math.sqrt((y * s - u * u) * (y * f - l * l)), w = 0 === g ? 0 : b / g;
|
|
3175
3192
|
a.push(w);
|
|
3176
3193
|
} else
|
|
3177
3194
|
// Reset sums and counts when encountering null values
|
|
3178
|
-
u = l = c = s = f =
|
|
3195
|
+
u = l = c = s = f = y = 0, a.push(0);
|
|
3179
3196
|
}
|
|
3180
3197
|
return a;
|
|
3181
3198
|
};
|
|
3182
3199
|
// ./src/utilities/verticalToHorizontal.js
|
|
3183
|
-
function
|
|
3200
|
+
function br(t, e) {
|
|
3184
3201
|
return function(t) {
|
|
3185
3202
|
if (Array.isArray(t)) return t;
|
|
3186
3203
|
}(t) || function(t, e) {
|
|
@@ -3205,33 +3222,33 @@ var OHLCV_INDICATORS;
|
|
|
3205
3222
|
}
|
|
3206
3223
|
}(t, e) || function(t, e) {
|
|
3207
3224
|
if (t) {
|
|
3208
|
-
if ("string" == typeof t) return
|
|
3225
|
+
if ("string" == typeof t) return gr(t, e);
|
|
3209
3226
|
var r = {}.toString.call(t).slice(8, -1);
|
|
3210
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
3227
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? gr(t, e) : void 0;
|
|
3211
3228
|
}
|
|
3212
3229
|
}(t, e) || function() {
|
|
3213
3230
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3214
3231
|
}();
|
|
3215
3232
|
}
|
|
3216
|
-
function
|
|
3233
|
+
function gr(t, e) {
|
|
3217
3234
|
(null == e || e > t.length) && (e = t.length);
|
|
3218
3235
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3219
3236
|
return n;
|
|
3220
3237
|
}
|
|
3221
|
-
var
|
|
3222
|
-
var t =
|
|
3223
|
-
if (0 ===
|
|
3224
|
-
for (var
|
|
3225
|
-
length:
|
|
3238
|
+
var wr = function(t) {
|
|
3239
|
+
var e = t.main, r = t.skipNull, n = void 0 !== r && r, o = t.startIndex, i = void 0 === o ? 0 : o, a = t.dateFormat, u = e.precisionMultiplier, l = e.priceBased, c = e.precision, s = e.verticalOhlcv, f = e.invalidValueIndex, y = e.len, h = e.verticalOhlcvKeyNames, p = e.verticalOhlcvTempCols;
|
|
3240
|
+
if (0 === h.length) return [];
|
|
3241
|
+
for (var v = n && f >= 0 ? f + 1 : 0, m = Math.max(v, i), d = y - m, b = Array.from({
|
|
3242
|
+
length: d
|
|
3226
3243
|
}, (function() {
|
|
3227
3244
|
return {};
|
|
3228
|
-
})),
|
|
3229
|
-
var
|
|
3230
|
-
if (!
|
|
3245
|
+
})), g = 0, w = Object.entries(s); g < w.length; g++) {
|
|
3246
|
+
var S = br(w[g], 2), O = S[0], j = S[1];
|
|
3247
|
+
if (!p.has(O)) for (var P = l.has(O) && c, _ = m; _ < y; _++) b[_ - m][O] = P ? j[_] / u : "date" === O ? Me[a](j[_]) : j[_];
|
|
3231
3248
|
}
|
|
3232
|
-
return
|
|
3249
|
+
return b;
|
|
3233
3250
|
};
|
|
3234
|
-
function
|
|
3251
|
+
function Sr(t, e) {
|
|
3235
3252
|
return function(t) {
|
|
3236
3253
|
if (Array.isArray(t)) return t;
|
|
3237
3254
|
}(t) || function(t, e) {
|
|
@@ -3254,30 +3271,30 @@ var OHLCV_INDICATORS;
|
|
|
3254
3271
|
}
|
|
3255
3272
|
return u;
|
|
3256
3273
|
}
|
|
3257
|
-
}(t, e) ||
|
|
3274
|
+
}(t, e) || Or(t, e) || function() {
|
|
3258
3275
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3259
3276
|
}();
|
|
3260
3277
|
}
|
|
3261
|
-
function
|
|
3278
|
+
function Or(t, e) {
|
|
3262
3279
|
if (t) {
|
|
3263
|
-
if ("string" == typeof t) return
|
|
3280
|
+
if ("string" == typeof t) return jr(t, e);
|
|
3264
3281
|
var r = {}.toString.call(t).slice(8, -1);
|
|
3265
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
3282
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? jr(t, e) : void 0;
|
|
3266
3283
|
}
|
|
3267
3284
|
}
|
|
3268
|
-
function
|
|
3285
|
+
function jr(t, e) {
|
|
3269
3286
|
(null == e || e > t.length) && (e = t.length);
|
|
3270
3287
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3271
3288
|
return n;
|
|
3272
3289
|
}
|
|
3273
|
-
var
|
|
3290
|
+
var Pr = function(t, e) {
|
|
3274
3291
|
var r = t.precision, n = t.priceBased;
|
|
3275
3292
|
if (!1 === r) return 1;
|
|
3276
3293
|
var o, i = 1, a = // ./src/utilities/precisionMultiplier.js
|
|
3277
3294
|
function(t, e) {
|
|
3278
3295
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
3279
3296
|
if (!r) {
|
|
3280
|
-
if (Array.isArray(t) || (r =
|
|
3297
|
+
if (Array.isArray(t) || (r = Or(t)) || e && t && "number" == typeof t.length) {
|
|
3281
3298
|
r && (t = r);
|
|
3282
3299
|
var n = 0, o = function() {};
|
|
3283
3300
|
return {
|
|
@@ -3319,17 +3336,17 @@ var OHLCV_INDICATORS;
|
|
|
3319
3336
|
}
|
|
3320
3337
|
};
|
|
3321
3338
|
}(Object.entries(e).filter((function(t) {
|
|
3322
|
-
var e =
|
|
3339
|
+
var e = Sr(t, 2), r = e[0];
|
|
3323
3340
|
e[1];
|
|
3324
3341
|
return n.has(r);
|
|
3325
3342
|
})).map((function(t) {
|
|
3326
|
-
var e =
|
|
3343
|
+
var e = Sr(t, 2);
|
|
3327
3344
|
e[0];
|
|
3328
3345
|
return e[1];
|
|
3329
3346
|
})));
|
|
3330
3347
|
try {
|
|
3331
3348
|
for (a.s(); !(o = a.n()).done; ) {
|
|
3332
|
-
var u = o.value, l =
|
|
3349
|
+
var u = o.value, l = Sr(String(u).split("."), 2)[1], c = void 0 === l ? "" : l, s = Math.max(4, c.length), f = s > 1 ? Math.pow(10, s - 1) : 1;
|
|
3333
3350
|
f > i && (i = f);
|
|
3334
3351
|
}
|
|
3335
3352
|
} catch (t) {
|
|
@@ -3340,23 +3357,23 @@ var OHLCV_INDICATORS;
|
|
|
3340
3357
|
return i;
|
|
3341
3358
|
};
|
|
3342
3359
|
// ./index.js
|
|
3343
|
-
function
|
|
3344
|
-
return
|
|
3360
|
+
function _r(t) {
|
|
3361
|
+
return _r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
3345
3362
|
return typeof t;
|
|
3346
3363
|
} : function(t) {
|
|
3347
3364
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
3348
|
-
},
|
|
3365
|
+
}, _r(t);
|
|
3349
3366
|
}
|
|
3350
|
-
function
|
|
3367
|
+
function Nr(t) {
|
|
3351
3368
|
return function(t) {
|
|
3352
|
-
if (Array.isArray(t)) return
|
|
3369
|
+
if (Array.isArray(t)) return Er(t);
|
|
3353
3370
|
}(t) || function(t) {
|
|
3354
3371
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
3355
|
-
}(t) ||
|
|
3372
|
+
}(t) || Tr(t) || function() {
|
|
3356
3373
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3357
3374
|
}();
|
|
3358
3375
|
}
|
|
3359
|
-
function
|
|
3376
|
+
function Ar(t, e) {
|
|
3360
3377
|
return function(t) {
|
|
3361
3378
|
if (Array.isArray(t)) return t;
|
|
3362
3379
|
}(t) || function(t, e) {
|
|
@@ -3379,36 +3396,36 @@ var OHLCV_INDICATORS;
|
|
|
3379
3396
|
}
|
|
3380
3397
|
return u;
|
|
3381
3398
|
}
|
|
3382
|
-
}(t, e) ||
|
|
3399
|
+
}(t, e) || Tr(t, e) || function() {
|
|
3383
3400
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3384
3401
|
}();
|
|
3385
3402
|
}
|
|
3386
|
-
function
|
|
3403
|
+
function Tr(t, e) {
|
|
3387
3404
|
if (t) {
|
|
3388
|
-
if ("string" == typeof t) return
|
|
3405
|
+
if ("string" == typeof t) return Er(t, e);
|
|
3389
3406
|
var r = {}.toString.call(t).slice(8, -1);
|
|
3390
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
3407
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Er(t, e) : void 0;
|
|
3391
3408
|
}
|
|
3392
3409
|
}
|
|
3393
|
-
function
|
|
3410
|
+
function Er(t, e) {
|
|
3394
3411
|
(null == e || e > t.length) && (e = t.length);
|
|
3395
3412
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3396
3413
|
return n;
|
|
3397
3414
|
}
|
|
3398
|
-
function
|
|
3415
|
+
function kr(t, e) {
|
|
3399
3416
|
for (var r = 0; r < e.length; r++) {
|
|
3400
3417
|
var n = e[r];
|
|
3401
3418
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
3402
|
-
Object.defineProperty(t,
|
|
3419
|
+
Object.defineProperty(t, xr(n.key), n);
|
|
3403
3420
|
}
|
|
3404
3421
|
}
|
|
3405
|
-
function
|
|
3422
|
+
function xr(t) {
|
|
3406
3423
|
var e = function(t, e) {
|
|
3407
|
-
if ("object" !=
|
|
3424
|
+
if ("object" != _r(t) || !t) return t;
|
|
3408
3425
|
var r = t[Symbol.toPrimitive];
|
|
3409
3426
|
if (void 0 !== r) {
|
|
3410
3427
|
var n = r.call(t, e || "default");
|
|
3411
|
-
if ("object" !=
|
|
3428
|
+
if ("object" != _r(n)) return n;
|
|
3412
3429
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3413
3430
|
}
|
|
3414
3431
|
return ("string" === e ? String : Number)(t);
|
|
@@ -3422,26 +3439,26 @@ var OHLCV_INDICATORS;
|
|
|
3422
3439
|
* to parallel compute various technical indicators in 1 single loop.
|
|
3423
3440
|
* OHLCV datasets.
|
|
3424
3441
|
*/ (t, "string");
|
|
3425
|
-
return "symbol" ==
|
|
3442
|
+
return "symbol" == _r(e) ? e : e + "";
|
|
3426
3443
|
}
|
|
3427
|
-
var
|
|
3444
|
+
var Ir = function() {
|
|
3428
3445
|
return t = function t(e) {
|
|
3429
|
-
var r = this, n = e.input, o = e.ticker, i = void 0 === o ? null : o, a = e.precision, l = void 0 === a || a, s = e.inputParams,
|
|
3446
|
+
var r = this, n = e.input, o = e.ticker, i = void 0 === o ? null : o, a = e.precision, l = void 0 === a || a, s = e.inputParams, f = void 0 === s ? null : s, p = e.chunkProcess, v = void 0 === p ? 2e3 : p;
|
|
3430
3447
|
if (function(t, e) {
|
|
3431
3448
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
3432
3449
|
}(this, t), c(n, "input", null !== i ? "contructor ".concat(i) : "constuctor"),
|
|
3433
3450
|
0 === n.length) throw Error("input OHLCV must not be empty: " + i);
|
|
3434
|
-
|
|
3451
|
+
y(l, "precision", "constructor"), h(v, {
|
|
3435
3452
|
min: 100,
|
|
3436
3453
|
max: 5e4,
|
|
3437
3454
|
allowDecimals: !1
|
|
3438
3455
|
}, "chunkProcess", "constructor"), this.chunkProcess = v, this.firstRow = n[0];
|
|
3439
3456
|
var m = function(t) {
|
|
3440
3457
|
for (var e = {}, r = {}, n = 0, o = Object.entries(t); n < o.length; n++) {
|
|
3441
|
-
var i =
|
|
3442
|
-
if ("date" === a) e[a] =
|
|
3443
|
-
r[a] = "Int32Array"; else if (
|
|
3444
|
-
var l =
|
|
3458
|
+
var i = Fe(o[n], 2), a = i[0], u = i[1];
|
|
3459
|
+
if ("date" === a) e[a] = Ce(u), r[a] = "Array"; else if ("volume" === a) e[a] = Se(u, !0),
|
|
3460
|
+
r[a] = "Int32Array"; else if (Be.has(a)) e[a] = Se(u, !0), r[a] = "Float64Array"; else {
|
|
3461
|
+
var l = Se(u, !1);
|
|
3445
3462
|
e[a] = l, r[a] = "number" === l ? "Float64Array" : "Array";
|
|
3446
3463
|
}
|
|
3447
3464
|
}
|
|
@@ -3455,8 +3472,8 @@ var OHLCV_INDICATORS;
|
|
|
3455
3472
|
this.input = n, this.priceBased = new Set([ "open", "high", "low", "close" ]), this.len = n.length,
|
|
3456
3473
|
this.instances = {}, this.crossPairsList = [], this.verticalOhlcv = {}, this.verticalOhlcvKeyNames = [],
|
|
3457
3474
|
this.verticalOhlcvTempCols = new Set, this.utilities = {
|
|
3458
|
-
correlation:
|
|
3459
|
-
}, this.invalidValueIndex = -1, this.precision = l, this.precisionMultiplier =
|
|
3475
|
+
correlation: dr
|
|
3476
|
+
}, this.invalidValueIndex = -1, this.precision = l, this.precisionMultiplier = Pr(this, this.firstRow),
|
|
3460
3477
|
this.scaledGroups = {}, this.pushToMain = function(t) {
|
|
3461
3478
|
var e = t.index, n = t.key, o = t.value;
|
|
3462
3479
|
return function(t) {
|
|
@@ -3469,34 +3486,52 @@ var OHLCV_INDICATORS;
|
|
|
3469
3486
|
key: n,
|
|
3470
3487
|
value: o
|
|
3471
3488
|
});
|
|
3472
|
-
}, null !==
|
|
3489
|
+
}, null !== f && (u(f, this.len), this.inputParams = f, this.compute()), this.inputParams = [],
|
|
3473
3490
|
this;
|
|
3474
3491
|
}, e = [ {
|
|
3475
3492
|
key: "getDataAsCols",
|
|
3476
3493
|
value: function() {
|
|
3477
|
-
var t =
|
|
3494
|
+
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3478
3495
|
this.compute();
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3496
|
+
var e = t.skipNull, r = void 0 === e || e, n = t.dateFormat, o = void 0 === n ? "string" : n;
|
|
3497
|
+
f(Object.keys(Me), o, "dateFormat", "getDataAsCols"), s(t, "options", "getDataAsCols");
|
|
3498
|
+
for (var i = this.precisionMultiplier, a = this.precision, u = this.invalidValueIndex, l = this.len, c = this.verticalOhlcv, y = this.priceBased, h = this.arrayTypes, p = this.verticalOhlcvTempCols, v = {}, m = r ? u + 1 : 0, d = l - m, b = 0, g = Object.entries(c); b < g.length; b++) {
|
|
3499
|
+
var w = Ar(g[b], 2), S = w[0], O = w[1];
|
|
3500
|
+
if (!p.has(S)) {
|
|
3501
|
+
var j = y.has(S) && a;
|
|
3502
|
+
v[S] = He(h[S], d);
|
|
3503
|
+
for (var P = m; P < l; P++) v[S][P] = j ? O[P] / i : "date" === S ? Me[o](O[P]) : O[P];
|
|
3485
3504
|
}
|
|
3486
3505
|
}
|
|
3487
|
-
return
|
|
3506
|
+
return v;
|
|
3488
3507
|
}
|
|
3489
3508
|
}, {
|
|
3490
3509
|
key: "getData",
|
|
3491
3510
|
value: function() {
|
|
3492
|
-
var t =
|
|
3511
|
+
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3493
3512
|
//getData method returns the last object (row) of the new OHLCV with indicators: {open, high, low, close, rsi_14, bollinger_bands_upper}
|
|
3494
|
-
|
|
3513
|
+
this.compute();
|
|
3514
|
+
var e = t.skipNull, r = void 0 === e || e, n = t.dateFormat, o = void 0 === n ? "string" : n;
|
|
3515
|
+
return f(Object.keys(Me), o, "dateFormat", "getData"), s(t, "options", "getData"),
|
|
3516
|
+
wr({
|
|
3517
|
+
main: this,
|
|
3518
|
+
skipNull: r,
|
|
3519
|
+
startIndex: 0,
|
|
3520
|
+
dateFormat: o
|
|
3521
|
+
});
|
|
3495
3522
|
}
|
|
3496
3523
|
}, {
|
|
3497
3524
|
key: "getLastValues",
|
|
3498
3525
|
value: function() {
|
|
3499
|
-
|
|
3526
|
+
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3527
|
+
this.compute();
|
|
3528
|
+
var e = t.dateFormat, r = void 0 === e ? "string" : e;
|
|
3529
|
+
return f(Object.keys(Me), r, "dateFormat", "getData"), wr({
|
|
3530
|
+
skipNull: !1,
|
|
3531
|
+
main: this,
|
|
3532
|
+
startIndex: this.len - 1,
|
|
3533
|
+
dateFormat: r
|
|
3534
|
+
})[0];
|
|
3500
3535
|
}
|
|
3501
3536
|
}, {
|
|
3502
3537
|
key: "compute",
|
|
@@ -3511,25 +3546,25 @@ var OHLCV_INDICATORS;
|
|
|
3511
3546
|
this.len > 0 && (function(t, e) {
|
|
3512
3547
|
var r = e.len, n = e.inputParams, o = e.priceBased, i = e.precisionMultiplier, a = e.arrayTypes, l = e.verticalOhlcv, c = e.verticalOhlcvKeyNames, s = e.inputTypes, f = e.chunkProcess;
|
|
3513
3548
|
u(n, r);
|
|
3514
|
-
for (var
|
|
3515
|
-
var p = y
|
|
3516
|
-
l[p] =
|
|
3549
|
+
for (var y = 0, h = Object.keys(s); y < h.length; y++) {
|
|
3550
|
+
var p = h[y];
|
|
3551
|
+
l[p] = He(a[p], r);
|
|
3517
3552
|
}
|
|
3518
3553
|
// Process each row in the input
|
|
3519
3554
|
for (var v = 0; v < r; v += f) for (var m = Math.min(v + f, r), d = v; d < m; d++) {
|
|
3520
3555
|
for (var b = t[d], g = 0, w = Object.entries(s); g < w.length; g++) {
|
|
3521
|
-
var S =
|
|
3522
|
-
if (
|
|
3523
|
-
var _ =
|
|
3556
|
+
var S = yr(w[g], 2), O = S[0], j = S[1], P = b[O];
|
|
3557
|
+
if (we.hasOwnProperty(j)) {
|
|
3558
|
+
var _ = we[j](P);
|
|
3524
3559
|
i > 1 && o.has(O) && (_ *= i), e.pushToMain({
|
|
3525
3560
|
index: d,
|
|
3526
3561
|
key: O,
|
|
3527
3562
|
value: _
|
|
3528
3563
|
});
|
|
3529
|
-
} else
|
|
3564
|
+
} else Re.hasOwnProperty(j) ? e.pushToMain({
|
|
3530
3565
|
index: d,
|
|
3531
3566
|
key: O,
|
|
3532
|
-
value:
|
|
3567
|
+
value: Re[j](P)
|
|
3533
3568
|
}) : e.pushToMain({
|
|
3534
3569
|
index: d,
|
|
3535
3570
|
key: O,
|
|
@@ -3537,13 +3572,13 @@ var OHLCV_INDICATORS;
|
|
|
3537
3572
|
});
|
|
3538
3573
|
}
|
|
3539
3574
|
// Run all indicator functions except for the ones processed later
|
|
3540
|
-
var N, A =
|
|
3575
|
+
var N, A = fr(n);
|
|
3541
3576
|
try {
|
|
3542
3577
|
for (A.s(); !(N = A.n()).done; ) {
|
|
3543
|
-
var T = N.value, E = T.key,
|
|
3578
|
+
var T = N.value, E = T.key, k = T.params;
|
|
3544
3579
|
"lag" !== E && "crossPairs" !== E &&
|
|
3545
3580
|
// resolve fn on-demand, no per-item object allocation here
|
|
3546
|
-
|
|
3581
|
+
vr[E].apply(vr, [ e, d ].concat(sr(k)));
|
|
3547
3582
|
}
|
|
3548
3583
|
// Process these indicators separately (ensuring their execution order)
|
|
3549
3584
|
} catch (t) {
|
|
@@ -3551,9 +3586,9 @@ var OHLCV_INDICATORS;
|
|
|
3551
3586
|
} finally {
|
|
3552
3587
|
A.f();
|
|
3553
3588
|
}
|
|
3554
|
-
|
|
3589
|
+
ze(e, d), tr(e, d), t[d] = null;
|
|
3555
3590
|
}
|
|
3556
|
-
c.push.apply(c,
|
|
3591
|
+
c.push.apply(c, sr(Object.keys(l)));
|
|
3557
3592
|
}(this.input, this), this.isComputed = !0,
|
|
3558
3593
|
//flushing after mainLoop
|
|
3559
3594
|
this.input = [], this.instances = {}, this.firstRow = [])), this;
|
|
@@ -3562,7 +3597,7 @@ var OHLCV_INDICATORS;
|
|
|
3562
3597
|
key: "crossPairs",
|
|
3563
3598
|
value: function() {
|
|
3564
3599
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], e = "crossPairs";
|
|
3565
|
-
return l(this), c(t, "arr", e), this.crossPairsList = [].concat(
|
|
3600
|
+
return l(this), c(t, "arr", e), this.crossPairsList = [].concat(Nr(this.crossPairsList), Nr(t)),
|
|
3566
3601
|
this.inputParams.push({
|
|
3567
3602
|
key: e,
|
|
3568
3603
|
params: [ this.crossPairsList ]
|
|
@@ -3583,7 +3618,7 @@ var OHLCV_INDICATORS;
|
|
|
3583
3618
|
var n, o = function(t, e) {
|
|
3584
3619
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
3585
3620
|
if (!r) {
|
|
3586
|
-
if (Array.isArray(t) || (r =
|
|
3621
|
+
if (Array.isArray(t) || (r = Tr(t)) || e && t && "number" == typeof t.length) {
|
|
3587
3622
|
r && (t = r);
|
|
3588
3623
|
var n = 0, o = function() {};
|
|
3589
3624
|
return {
|
|
@@ -3769,12 +3804,12 @@ var OHLCV_INDICATORS;
|
|
|
3769
3804
|
max: 50,
|
|
3770
3805
|
allowDecimals: !0
|
|
3771
3806
|
}, "stdDev", n), s(r, "options", n);
|
|
3772
|
-
var o = r.target, i = void 0 === o ? "close" : o, a = r.height, u = void 0 !== a && a,
|
|
3807
|
+
var o = r.target, i = void 0 === o ? "close" : o, a = r.height, u = void 0 !== a && a, f = r.range, p = void 0 === f ? [] : f, v = r.lag, m = void 0 === v ? 0 : v, d = r.decimals, b = void 0 === d ? null : d;
|
|
3773
3808
|
return c(p, "options.range", n), h(m, {
|
|
3774
3809
|
min: 0,
|
|
3775
3810
|
max: this.len,
|
|
3776
3811
|
allowDecimals: !1
|
|
3777
|
-
}, "options.lag", n),
|
|
3812
|
+
}, "options.lag", n), y(u, "options.height", n), null !== b && h(b, {
|
|
3778
3813
|
min: 1,
|
|
3779
3814
|
max: 15,
|
|
3780
3815
|
allowDecimals: !1
|
|
@@ -3824,12 +3859,12 @@ var OHLCV_INDICATORS;
|
|
|
3824
3859
|
max: this.len,
|
|
3825
3860
|
allowDecimals: !1
|
|
3826
3861
|
}, "offset", n), s(r, "options", n);
|
|
3827
|
-
var o = r.height, i = void 0 !== o && o, a = r.range, u = void 0 === a ? [] : a,
|
|
3862
|
+
var o = r.height, i = void 0 !== o && o, a = r.range, u = void 0 === a ? [] : a, f = r.lag, p = void 0 === f ? 0 : f, v = r.decimals, m = void 0 === v ? null : v;
|
|
3828
3863
|
return c(u, "options.range", n), h(p, {
|
|
3829
3864
|
min: 0,
|
|
3830
3865
|
max: this.len,
|
|
3831
3866
|
allowDecimals: !1
|
|
3832
|
-
}, "options.lag", n),
|
|
3867
|
+
}, "options.lag", n), y(i, "options.height", n), null !== m && h(m, {
|
|
3833
3868
|
min: 1,
|
|
3834
3869
|
max: 15,
|
|
3835
3870
|
allowDecimals: !1
|
|
@@ -3895,8 +3930,8 @@ var OHLCV_INDICATORS;
|
|
|
3895
3930
|
max: this.len,
|
|
3896
3931
|
allowDecimals: !1
|
|
3897
3932
|
}, "size", o), c(e, "colKeys", o);
|
|
3898
|
-
var i = n.group, a = void 0 !== i && i, u = n.range, s = void 0 === u ? [ 0, 1 ] : u,
|
|
3899
|
-
|
|
3933
|
+
var i = n.group, a = void 0 !== i && i, u = n.range, s = void 0 === u ? [ 0, 1 ] : u, p = n.lag, v = void 0 === p ? 0 : p, m = n.type, d = void 0 === m ? "minmax" : m, b = n.decimals, g = void 0 === b ? null : b;
|
|
3934
|
+
y(a, "options.group", o), function(t, e, n) {
|
|
3900
3935
|
if (c(t, e, n), 2 !== t.length) throw new Error('Invalid "'.concat(e, '" array length: expected 2 items, but got ').concat(t.length, ' in "').concat(n, ".").concat(e, '".'));
|
|
3901
3936
|
var o = r(t, 2), i = o[0], a = o[1];
|
|
3902
3937
|
if (h(i, {
|
|
@@ -3908,31 +3943,28 @@ var OHLCV_INDICATORS;
|
|
|
3908
3943
|
max: 100,
|
|
3909
3944
|
allowDecimals: !1
|
|
3910
3945
|
}, "max", n), i === a) throw new Error('Invalid "min" can not be equal to "max" property in "'.concat(n, ".").concat(e, '".'));
|
|
3911
|
-
}(s, "options.range", o),
|
|
3912
|
-
if (c(t, "arrayOptions", "".concat(n, ".").concat(r, ".validateArrayOptions")),
|
|
3913
|
-
!t.includes(e.toString())) throw new Error('Param "'.concat(r, '" must be any of the following values [').concat(t.join(", "), '] in "').concat(n, '".'));
|
|
3914
|
-
}([ "minmax", "zscore" ], m, "options.type", o), null !== b && h(b, {
|
|
3946
|
+
}(s, "options.range", o), f([ "minmax", "zscore" ], d, "options.type", o), null !== g && h(g, {
|
|
3915
3947
|
min: 1,
|
|
3916
3948
|
max: 15,
|
|
3917
3949
|
allowDecimals: !1
|
|
3918
3950
|
}, "decimals", o);
|
|
3919
|
-
var
|
|
3920
|
-
groupKey: a ? "".concat(
|
|
3951
|
+
var w = {
|
|
3952
|
+
groupKey: a ? "".concat(d, "_").concat(t, "_group_").concat(e.join("_")) : "",
|
|
3921
3953
|
groupKeyLen: e.length
|
|
3922
3954
|
};
|
|
3923
3955
|
return this.inputParams.push({
|
|
3924
3956
|
key: o,
|
|
3925
3957
|
params: [ t, e, {
|
|
3926
|
-
type:
|
|
3958
|
+
type: d,
|
|
3927
3959
|
group: a,
|
|
3928
3960
|
range: s,
|
|
3929
|
-
lag:
|
|
3930
|
-
precomputed:
|
|
3931
|
-
decimals:
|
|
3961
|
+
lag: v,
|
|
3962
|
+
precomputed: w,
|
|
3963
|
+
decimals: g
|
|
3932
3964
|
} ]
|
|
3933
3965
|
}), this;
|
|
3934
3966
|
}
|
|
3935
|
-
} ], e &&
|
|
3967
|
+
} ], e && kr(t.prototype, e), n && kr(t, n), Object.defineProperty(t, "prototype", {
|
|
3936
3968
|
writable: !1
|
|
3937
3969
|
}), t;
|
|
3938
3970
|
var t, e, n;
|