ohlcv-indicators 3.4.6 → 3.4.8
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 +1045 -764
- package/index.js +58 -9
- package/package.json +1 -1
- package/src/core-functions/mainLoop.js +2 -0
- package/src/moving-averages/movingAverages.js +8 -7
- package/src/utilities/dateUtilities.js +7 -0
- package/src/utilities/verticalToHorizontal.js +16 -8
- package/src/volatility/atr.js +46 -0
|
@@ -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 */ rn
|
|
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,10 +162,14 @@ 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
|
+
}, p = function(t, e, r, n) {
|
|
169
173
|
s(e, "options", "".concat(n, ".").concat(r, ".validateNumber"));
|
|
170
174
|
var o = e.allowDecimals, i = void 0 !== o && o, a = e.min, u = e.max, l = i ? "number" : "integer";
|
|
171
175
|
if ("number" != typeof t || !1 === i && !Number.isInteger(t)) throw new Error('Param "'.concat(r, '" must be an integer in "').concat(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
|
+
h = 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
|
+
O = {}, S = 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,9 +195,9 @@ 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 === S && (r = t.constructor.RM), 0 !== r && 1 !== r && 2 !== r && 3 !== r) throw Error(
|
|
200
|
+
if (r === S && (r = t.constructor.RM), 0 !== r && 1 !== r && 2 !== r && 3 !== r) throw Error(g);
|
|
197
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] !== S))),
|
|
198
202
|
o.length = 1, n ? (
|
|
199
203
|
// 1, 0.1, 0.01, 0.001, 0.0001 etc.
|
|
@@ -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
|
+
*/ O.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
|
+
O.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
|
+
O.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 > h) 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
|
-
O =
|
|
275
|
+
var u, l, c, s, f, y = o.slice(), p = u = o.length, v = n.length, m = n.slice(0, u), // remainder
|
|
276
|
+
d = m.length, g = t, // quotient
|
|
277
|
+
O = 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
|
-
O[
|
|
305
|
+
O[j++] = s ? c : ++c,
|
|
302
306
|
// Update the remainder.
|
|
303
|
-
m[0] && s ? m[
|
|
307
|
+
m[0] && s ? m[d] = n[p] || 0 : m = [ n[p] ];
|
|
304
308
|
} while ((p++ < v || m[0] !== S) && i--);
|
|
305
309
|
// Leading zero? Do not remove if result is simply zero (qi == 1).
|
|
306
|
-
return O[0] || 1 ==
|
|
310
|
+
return O[0] || 1 == j || (
|
|
307
311
|
// There can't be more than one zero.
|
|
308
|
-
O.shift(),
|
|
312
|
+
O.shift(), g.e--, _--),
|
|
309
313
|
// Round?
|
|
310
|
-
|
|
314
|
+
j > _ && P(g, _, r.RM, m[0] !== S), 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
|
+
O.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
|
+
O.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
|
+
O.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
|
+
O.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
|
+
O.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
|
+
O.minus = O.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
|
+
O.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
|
+
O.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
|
+
O.plus = O.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
|
+
O.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
|
+
O.prec = function(t, e) {
|
|
456
|
+
if (t !== ~~t || t < 1 || t > h) 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 === S) t = 0; else if (t !== ~~t || t < -
|
|
466
|
-
return
|
|
468
|
+
O.round = function(t, e) {
|
|
469
|
+
if (t === S) t = 0; else if (t !== ~~t || t < -h || t > h) 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
|
+
O.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
|
+
O.times = O.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
|
+
O.toExponential = function(t, e) {
|
|
527
531
|
var r = this, n = r.c[0];
|
|
528
532
|
if (t !== S) {
|
|
529
|
-
if (t !== ~~t || t < 0 || t >
|
|
530
|
-
for (r =
|
|
533
|
+
if (t !== ~~t || t < 0 || t > h) 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
|
+
O.toFixed = function(t, e) {
|
|
545
549
|
var r = this, n = r.c[0];
|
|
546
550
|
if (t !== S) {
|
|
547
|
-
if (t !== ~~t || t < 0 || t >
|
|
551
|
+
if (t !== ~~t || t < 0 || t > h) 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
|
+
O[Symbol.for("nodejs.util.inspect.custom")] = O.toJSON = O.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
|
+
O.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
|
+
O.toPrecision = function(t, e) {
|
|
581
585
|
var r = this, n = r.constructor, o = r.c[0];
|
|
582
586
|
if (t !== S) {
|
|
583
|
-
if (t !== ~~t || t < 1 || t >
|
|
584
|
-
for (r =
|
|
587
|
+
if (t !== ~~t || t < 1 || t > h) 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
|
+
O.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
|
(
|
|
@@ -615,7 +619,7 @@ var OHLCV_INDICATORS;
|
|
|
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,19 +658,19 @@ 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 = O, 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 T(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),
|
|
@@ -675,30 +679,30 @@ var OHLCV_INDICATORS;
|
|
|
675
679
|
}
|
|
676
680
|
function A(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 && T(r.prototype, n), o && T(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
|
-
function
|
|
1071
|
+
function pt(t, e) {
|
|
1068
1072
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1069
1073
|
}
|
|
1070
|
-
function
|
|
1074
|
+
function ht(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
1078
|
Object.defineProperty(t, St(n.key), n);
|
|
1075
1079
|
}
|
|
1076
1080
|
}
|
|
1077
|
-
function
|
|
1078
|
-
return e &&
|
|
1081
|
+
function vt(t, e, r) {
|
|
1082
|
+
return e && ht(t.prototype, e), r && ht(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,14 +1116,14 @@ 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
|
|
1126
|
+
function Ot(t, e, r) {
|
|
1123
1127
|
return (e = St(e)) in t ? Object.defineProperty(t, e, {
|
|
1124
1128
|
value: r,
|
|
1125
1129
|
enumerable: !0,
|
|
@@ -1129,25 +1133,25 @@ var OHLCV_INDICATORS;
|
|
|
1129
1133
|
}
|
|
1130
1134
|
function St(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
|
|
1147
|
-
|
|
1150
|
+
return pt(this, e), Ot(r = mt(this, e), "interval", void 0), Ot(r, "indicator", void 0),
|
|
1151
|
+
Ot(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,272 @@ 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
|
-
// ./node_modules/trading-signals/dist/
|
|
1180
|
-
function
|
|
1181
|
-
return
|
|
1183
|
+
// ./node_modules/trading-signals/dist/TR/TR.js
|
|
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 Tt(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, Rt(n.key), n);
|
|
1195
1199
|
}
|
|
1196
1200
|
}
|
|
1197
1201
|
function At(t, e, r) {
|
|
1198
|
-
return e &&
|
|
1202
|
+
return e && Tt(t.prototype, e), r && Tt(t, r), Object.defineProperty(t, "prototype", {
|
|
1199
1203
|
writable: !1
|
|
1200
1204
|
}), t;
|
|
1201
1205
|
}
|
|
1202
|
-
function
|
|
1203
|
-
return
|
|
1206
|
+
function Et(t, e, r) {
|
|
1207
|
+
return e = xt(e), function(t, e) {
|
|
1208
|
+
if (e && ("object" == _t(e) || "function" == typeof e)) return e;
|
|
1209
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1210
|
+
return function(t) {
|
|
1211
|
+
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1212
|
+
return t;
|
|
1213
|
+
}(t);
|
|
1214
|
+
}(t, kt() ? Reflect.construct(e, r || [], xt(t).constructor) : e.apply(t, r));
|
|
1215
|
+
}
|
|
1216
|
+
function kt() {
|
|
1217
|
+
try {
|
|
1218
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1219
|
+
} catch (t) {}
|
|
1220
|
+
return (kt = function() {
|
|
1221
|
+
return !!t;
|
|
1222
|
+
})();
|
|
1223
|
+
}
|
|
1224
|
+
function xt(t) {
|
|
1225
|
+
return xt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1226
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1227
|
+
}, xt(t);
|
|
1228
|
+
}
|
|
1229
|
+
function It(t, e) {
|
|
1230
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1231
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
1232
|
+
constructor: {
|
|
1233
|
+
value: t,
|
|
1234
|
+
writable: !0,
|
|
1235
|
+
configurable: !0
|
|
1236
|
+
}
|
|
1237
|
+
}), Object.defineProperty(t, "prototype", {
|
|
1238
|
+
writable: !1
|
|
1239
|
+
}), e && Dt(t, e);
|
|
1240
|
+
}
|
|
1241
|
+
function Dt(t, e) {
|
|
1242
|
+
return Dt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1243
|
+
return t.__proto__ = e, t;
|
|
1244
|
+
}, Dt(t, e);
|
|
1245
|
+
}
|
|
1246
|
+
function Mt(t, e, r) {
|
|
1247
|
+
return (e = Rt(e)) in t ? Object.defineProperty(t, e, {
|
|
1204
1248
|
value: r,
|
|
1205
1249
|
enumerable: !0,
|
|
1206
1250
|
configurable: !0,
|
|
1207
1251
|
writable: !0
|
|
1208
1252
|
}) : t[e] = r, t;
|
|
1209
1253
|
}
|
|
1210
|
-
function
|
|
1254
|
+
function Rt(t) {
|
|
1211
1255
|
var e = function(t, e) {
|
|
1212
|
-
if ("object" !=
|
|
1256
|
+
if ("object" != _t(t) || !t) return t;
|
|
1213
1257
|
var r = t[Symbol.toPrimitive];
|
|
1214
1258
|
if (void 0 !== r) {
|
|
1215
1259
|
var n = r.call(t, e || "default");
|
|
1216
|
-
if ("object" !=
|
|
1260
|
+
if ("object" != _t(n)) return n;
|
|
1217
1261
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1218
1262
|
}
|
|
1219
1263
|
return ("string" === e ? String : Number)(t);
|
|
1220
1264
|
}(t, "string");
|
|
1221
|
-
return "symbol" ==
|
|
1265
|
+
return "symbol" == _t(e) ? e : e + "";
|
|
1222
1266
|
}
|
|
1223
|
-
var
|
|
1224
|
-
|
|
1267
|
+
var Ct = function(t) {
|
|
1268
|
+
function e() {
|
|
1269
|
+
var t;
|
|
1270
|
+
Nt(this, e);
|
|
1271
|
+
for (var r = arguments.length, n = new Array(r), o = 0; o < r; o++) n[o] = arguments[o];
|
|
1272
|
+
return Mt(t = Et(this, e, [].concat(n)), "previousCandle", void 0), Mt(t, "twoPreviousCandle", void 0),
|
|
1273
|
+
t;
|
|
1274
|
+
}
|
|
1275
|
+
return It(e, t), At(e, [ {
|
|
1276
|
+
key: "update",
|
|
1277
|
+
value: function(t) {
|
|
1278
|
+
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r = t.high, n = t.low, o = r - n;
|
|
1279
|
+
if (this.previousCandle && e && (this.previousCandle = this.twoPreviousCandle),
|
|
1280
|
+
this.previousCandle) {
|
|
1281
|
+
var i = Math.abs(r - this.previousCandle.close), a = Math.abs(n - this.previousCandle.close);
|
|
1282
|
+
return this.twoPreviousCandle = this.previousCandle, this.previousCandle = t, this.setResult(Math.max(o, i, a), e);
|
|
1283
|
+
}
|
|
1284
|
+
return this.twoPreviousCandle = this.previousCandle, this.previousCandle = t, this.setResult(o, e);
|
|
1285
|
+
}
|
|
1286
|
+
} ]);
|
|
1287
|
+
}(V);
|
|
1288
|
+
// ./node_modules/trading-signals/dist/ATR/ATR.js
|
|
1289
|
+
function Ft(t) {
|
|
1290
|
+
return Ft = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1291
|
+
return typeof t;
|
|
1292
|
+
} : function(t) {
|
|
1293
|
+
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1294
|
+
}, Ft(t);
|
|
1295
|
+
}
|
|
1296
|
+
function Lt(t, e) {
|
|
1297
|
+
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1298
|
+
}
|
|
1299
|
+
function Bt(t, e) {
|
|
1300
|
+
for (var r = 0; r < e.length; r++) {
|
|
1301
|
+
var n = e[r];
|
|
1302
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1303
|
+
Object.defineProperty(t, Kt(n.key), n);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
function Ht(t, e, r) {
|
|
1307
|
+
return e && Bt(t.prototype, e), r && Bt(t, r), Object.defineProperty(t, "prototype", {
|
|
1308
|
+
writable: !1
|
|
1309
|
+
}), t;
|
|
1310
|
+
}
|
|
1311
|
+
function Vt(t, e, r) {
|
|
1312
|
+
return e = $t(e), function(t, e) {
|
|
1313
|
+
if (e && ("object" == Ft(e) || "function" == typeof e)) return e;
|
|
1314
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1315
|
+
return function(t) {
|
|
1316
|
+
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1317
|
+
return t;
|
|
1318
|
+
}(t);
|
|
1319
|
+
}(t, Ut() ? Reflect.construct(e, r || [], $t(t).constructor) : e.apply(t, r));
|
|
1320
|
+
}
|
|
1321
|
+
function Ut() {
|
|
1322
|
+
try {
|
|
1323
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1324
|
+
} catch (t) {}
|
|
1325
|
+
return (Ut = function() {
|
|
1326
|
+
return !!t;
|
|
1327
|
+
})();
|
|
1328
|
+
}
|
|
1329
|
+
function $t(t) {
|
|
1330
|
+
return $t = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1331
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1332
|
+
}, $t(t);
|
|
1333
|
+
}
|
|
1334
|
+
function qt(t, e) {
|
|
1335
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1336
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
1337
|
+
constructor: {
|
|
1338
|
+
value: t,
|
|
1339
|
+
writable: !0,
|
|
1340
|
+
configurable: !0
|
|
1341
|
+
}
|
|
1342
|
+
}), Object.defineProperty(t, "prototype", {
|
|
1343
|
+
writable: !1
|
|
1344
|
+
}), e && zt(t, e);
|
|
1345
|
+
}
|
|
1346
|
+
function zt(t, e) {
|
|
1347
|
+
return zt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1348
|
+
return t.__proto__ = e, t;
|
|
1349
|
+
}, zt(t, e);
|
|
1350
|
+
}
|
|
1351
|
+
function Gt(t, e, r) {
|
|
1352
|
+
return (e = Kt(e)) in t ? Object.defineProperty(t, e, {
|
|
1353
|
+
value: r,
|
|
1354
|
+
enumerable: !0,
|
|
1355
|
+
configurable: !0,
|
|
1356
|
+
writable: !0
|
|
1357
|
+
}) : t[e] = r, t;
|
|
1358
|
+
}
|
|
1359
|
+
function Kt(t) {
|
|
1360
|
+
var e = function(t, e) {
|
|
1361
|
+
if ("object" != Ft(t) || !t) return t;
|
|
1362
|
+
var r = t[Symbol.toPrimitive];
|
|
1363
|
+
if (void 0 !== r) {
|
|
1364
|
+
var n = r.call(t, e || "default");
|
|
1365
|
+
if ("object" != Ft(n)) return n;
|
|
1366
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1367
|
+
}
|
|
1368
|
+
return ("string" === e ? String : Number)(t);
|
|
1369
|
+
}(t, "string");
|
|
1370
|
+
return "symbol" == Ft(e) ? e : e + "";
|
|
1371
|
+
}
|
|
1372
|
+
var Yt = function(t) {
|
|
1373
|
+
function e(t) {
|
|
1374
|
+
var r, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : jt;
|
|
1375
|
+
return Lt(this, e), Gt(r = Vt(this, e), "interval", void 0), Gt(r, "tr", void 0),
|
|
1376
|
+
Gt(r, "smoothing", void 0), r.interval = t, r.tr = new Ct, r.smoothing = new n(t),
|
|
1377
|
+
r;
|
|
1378
|
+
}
|
|
1379
|
+
return qt(e, t), Ht(e, [ {
|
|
1380
|
+
key: "update",
|
|
1381
|
+
value: function(t) {
|
|
1382
|
+
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], r = this.tr.update(t, e);
|
|
1383
|
+
if (this.smoothing.update(r, e), this.smoothing.isStable) return this.setResult(this.smoothing.getResult(), e);
|
|
1384
|
+
}
|
|
1385
|
+
} ]);
|
|
1386
|
+
}(V);
|
|
1387
|
+
// ./node_modules/trading-signals/dist/BBANDS/BollingerBands.js
|
|
1388
|
+
function Jt(t) {
|
|
1389
|
+
return Jt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1390
|
+
return typeof t;
|
|
1391
|
+
} : function(t) {
|
|
1392
|
+
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1393
|
+
}, Jt(t);
|
|
1394
|
+
}
|
|
1395
|
+
function Zt(t, e) {
|
|
1396
|
+
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1397
|
+
}
|
|
1398
|
+
function Qt(t, e) {
|
|
1399
|
+
for (var r = 0; r < e.length; r++) {
|
|
1400
|
+
var n = e[r];
|
|
1401
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1402
|
+
Object.defineProperty(t, te(n.key), n);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
function Wt(t, e, r) {
|
|
1406
|
+
return e && Qt(t.prototype, e), r && Qt(t, r), Object.defineProperty(t, "prototype", {
|
|
1407
|
+
writable: !1
|
|
1408
|
+
}), t;
|
|
1409
|
+
}
|
|
1410
|
+
function Xt(t, e, r) {
|
|
1411
|
+
return (e = te(e)) in t ? Object.defineProperty(t, e, {
|
|
1412
|
+
value: r,
|
|
1413
|
+
enumerable: !0,
|
|
1414
|
+
configurable: !0,
|
|
1415
|
+
writable: !0
|
|
1416
|
+
}) : t[e] = r, t;
|
|
1417
|
+
}
|
|
1418
|
+
function te(t) {
|
|
1419
|
+
var e = function(t, e) {
|
|
1420
|
+
if ("object" != Jt(t) || !t) return t;
|
|
1421
|
+
var r = t[Symbol.toPrimitive];
|
|
1422
|
+
if (void 0 !== r) {
|
|
1423
|
+
var n = r.call(t, e || "default");
|
|
1424
|
+
if ("object" != Jt(n)) return n;
|
|
1425
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1426
|
+
}
|
|
1427
|
+
return ("string" === e ? String : Number)(t);
|
|
1428
|
+
}(t, "string");
|
|
1429
|
+
return "symbol" == Jt(e) ? e : e + "";
|
|
1430
|
+
}
|
|
1431
|
+
var ee = function() {
|
|
1432
|
+
return Wt((function t(e) {
|
|
1225
1433
|
var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2;
|
|
1226
|
-
|
|
1227
|
-
|
|
1434
|
+
Zt(this, t), Xt(this, "interval", void 0), Xt(this, "deviationMultiplier", void 0),
|
|
1435
|
+
Xt(this, "prices", []), Xt(this, "result", void 0), this.interval = e, this.deviationMultiplier = r;
|
|
1228
1436
|
}), [ {
|
|
1229
1437
|
key: "update",
|
|
1230
1438
|
value: function(t) {
|
|
1231
1439
|
if (this.prices.push(t), this.prices.length > this.interval) {
|
|
1232
1440
|
this.prices.shift();
|
|
1233
|
-
var e =
|
|
1234
|
-
var r = e ||
|
|
1441
|
+
var e = Pt(this.prices), r = function(t, e) {
|
|
1442
|
+
var r = e || Pt(t), n = Pt(t.map((function(t) {
|
|
1235
1443
|
return t - r;
|
|
1236
1444
|
})).map((function(t) {
|
|
1237
1445
|
return t * t;
|
|
@@ -1259,52 +1467,52 @@ var OHLCV_INDICATORS;
|
|
|
1259
1467
|
} ]);
|
|
1260
1468
|
}();
|
|
1261
1469
|
// ./node_modules/trading-signals/dist/EMA/EMA.js
|
|
1262
|
-
function
|
|
1263
|
-
return
|
|
1470
|
+
function re(t) {
|
|
1471
|
+
return re = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1264
1472
|
return typeof t;
|
|
1265
1473
|
} : function(t) {
|
|
1266
1474
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1267
|
-
},
|
|
1475
|
+
}, re(t);
|
|
1268
1476
|
}
|
|
1269
|
-
function
|
|
1477
|
+
function ne(t, e) {
|
|
1270
1478
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1271
1479
|
}
|
|
1272
|
-
function
|
|
1480
|
+
function oe(t, e) {
|
|
1273
1481
|
for (var r = 0; r < e.length; r++) {
|
|
1274
1482
|
var n = e[r];
|
|
1275
1483
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1276
|
-
Object.defineProperty(t,
|
|
1484
|
+
Object.defineProperty(t, ye(n.key), n);
|
|
1277
1485
|
}
|
|
1278
1486
|
}
|
|
1279
|
-
function
|
|
1280
|
-
return e &&
|
|
1487
|
+
function ie(t, e, r) {
|
|
1488
|
+
return e && oe(t.prototype, e), r && oe(t, r), Object.defineProperty(t, "prototype", {
|
|
1281
1489
|
writable: !1
|
|
1282
1490
|
}), t;
|
|
1283
1491
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return e =
|
|
1286
|
-
if (e && ("object" ==
|
|
1492
|
+
function ae(t, e, r) {
|
|
1493
|
+
return e = le(e), function(t, e) {
|
|
1494
|
+
if (e && ("object" == re(e) || "function" == typeof e)) return e;
|
|
1287
1495
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1288
1496
|
return function(t) {
|
|
1289
1497
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1290
1498
|
return t;
|
|
1291
1499
|
}(t);
|
|
1292
|
-
}(t,
|
|
1500
|
+
}(t, ue() ? Reflect.construct(e, r || [], le(t).constructor) : e.apply(t, r));
|
|
1293
1501
|
}
|
|
1294
|
-
function
|
|
1502
|
+
function ue() {
|
|
1295
1503
|
try {
|
|
1296
1504
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1297
1505
|
} catch (t) {}
|
|
1298
|
-
return (
|
|
1506
|
+
return (ue = function() {
|
|
1299
1507
|
return !!t;
|
|
1300
1508
|
})();
|
|
1301
1509
|
}
|
|
1302
|
-
function
|
|
1303
|
-
return
|
|
1510
|
+
function le(t) {
|
|
1511
|
+
return le = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1304
1512
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1305
|
-
},
|
|
1513
|
+
}, le(t);
|
|
1306
1514
|
}
|
|
1307
|
-
function
|
|
1515
|
+
function ce(t, e) {
|
|
1308
1516
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1309
1517
|
t.prototype = Object.create(e && e.prototype, {
|
|
1310
1518
|
constructor: {
|
|
@@ -1314,42 +1522,42 @@ var OHLCV_INDICATORS;
|
|
|
1314
1522
|
}
|
|
1315
1523
|
}), Object.defineProperty(t, "prototype", {
|
|
1316
1524
|
writable: !1
|
|
1317
|
-
}), e &&
|
|
1525
|
+
}), e && se(t, e);
|
|
1318
1526
|
}
|
|
1319
|
-
function
|
|
1320
|
-
return
|
|
1527
|
+
function se(t, e) {
|
|
1528
|
+
return se = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1321
1529
|
return t.__proto__ = e, t;
|
|
1322
|
-
},
|
|
1530
|
+
}, se(t, e);
|
|
1323
1531
|
}
|
|
1324
|
-
function
|
|
1325
|
-
return (e =
|
|
1532
|
+
function fe(t, e, r) {
|
|
1533
|
+
return (e = ye(e)) in t ? Object.defineProperty(t, e, {
|
|
1326
1534
|
value: r,
|
|
1327
1535
|
enumerable: !0,
|
|
1328
1536
|
configurable: !0,
|
|
1329
1537
|
writable: !0
|
|
1330
1538
|
}) : t[e] = r, t;
|
|
1331
1539
|
}
|
|
1332
|
-
function
|
|
1540
|
+
function ye(t) {
|
|
1333
1541
|
var e = function(t, e) {
|
|
1334
|
-
if ("object" !=
|
|
1542
|
+
if ("object" != re(t) || !t) return t;
|
|
1335
1543
|
var r = t[Symbol.toPrimitive];
|
|
1336
1544
|
if (void 0 !== r) {
|
|
1337
1545
|
var n = r.call(t, e || "default");
|
|
1338
|
-
if ("object" !=
|
|
1546
|
+
if ("object" != re(n)) return n;
|
|
1339
1547
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1340
1548
|
}
|
|
1341
1549
|
return ("string" === e ? String : Number)(t);
|
|
1342
1550
|
}(t, "string");
|
|
1343
|
-
return "symbol" ==
|
|
1551
|
+
return "symbol" == re(e) ? e : e + "";
|
|
1344
1552
|
}
|
|
1345
|
-
var
|
|
1553
|
+
var pe = function(t) {
|
|
1346
1554
|
function e(t) {
|
|
1347
1555
|
var r;
|
|
1348
|
-
return
|
|
1349
|
-
|
|
1556
|
+
return ne(this, e), fe(r = ae(this, e, [ t ]), "interval", void 0), fe(r, "pricesCounter", 0),
|
|
1557
|
+
fe(r, "weightFactor", void 0), r.interval = t, r.weightFactor = 2 / (r.interval + 1),
|
|
1350
1558
|
r;
|
|
1351
1559
|
}
|
|
1352
|
-
return
|
|
1560
|
+
return ce(e, t), ie(e, [ {
|
|
1353
1561
|
key: "update",
|
|
1354
1562
|
value: function(t) {
|
|
1355
1563
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
@@ -1372,55 +1580,55 @@ var OHLCV_INDICATORS;
|
|
|
1372
1580
|
}
|
|
1373
1581
|
}
|
|
1374
1582
|
} ]);
|
|
1375
|
-
}(
|
|
1583
|
+
}(X);
|
|
1376
1584
|
// ./node_modules/trading-signals/dist/MACD/MACD.js
|
|
1377
|
-
function
|
|
1378
|
-
return
|
|
1585
|
+
function he(t) {
|
|
1586
|
+
return he = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1379
1587
|
return typeof t;
|
|
1380
1588
|
} : function(t) {
|
|
1381
1589
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1382
|
-
},
|
|
1590
|
+
}, he(t);
|
|
1383
1591
|
}
|
|
1384
|
-
function
|
|
1592
|
+
function ve(t, e) {
|
|
1385
1593
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1386
1594
|
}
|
|
1387
|
-
function
|
|
1595
|
+
function me(t, e) {
|
|
1388
1596
|
for (var r = 0; r < e.length; r++) {
|
|
1389
1597
|
var n = e[r];
|
|
1390
1598
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1391
|
-
Object.defineProperty(t,
|
|
1599
|
+
Object.defineProperty(t, ge(n.key), n);
|
|
1392
1600
|
}
|
|
1393
1601
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return e &&
|
|
1602
|
+
function de(t, e, r) {
|
|
1603
|
+
return e && me(t.prototype, e), r && me(t, r), Object.defineProperty(t, "prototype", {
|
|
1396
1604
|
writable: !1
|
|
1397
1605
|
}), t;
|
|
1398
1606
|
}
|
|
1399
|
-
function
|
|
1400
|
-
return (e =
|
|
1607
|
+
function be(t, e, r) {
|
|
1608
|
+
return (e = ge(e)) in t ? Object.defineProperty(t, e, {
|
|
1401
1609
|
value: r,
|
|
1402
1610
|
enumerable: !0,
|
|
1403
1611
|
configurable: !0,
|
|
1404
1612
|
writable: !0
|
|
1405
1613
|
}) : t[e] = r, t;
|
|
1406
1614
|
}
|
|
1407
|
-
function
|
|
1615
|
+
function ge(t) {
|
|
1408
1616
|
var e = function(t, e) {
|
|
1409
|
-
if ("object" !=
|
|
1617
|
+
if ("object" != he(t) || !t) return t;
|
|
1410
1618
|
var r = t[Symbol.toPrimitive];
|
|
1411
1619
|
if (void 0 !== r) {
|
|
1412
1620
|
var n = r.call(t, e || "default");
|
|
1413
|
-
if ("object" !=
|
|
1621
|
+
if ("object" != he(n)) return n;
|
|
1414
1622
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1415
1623
|
}
|
|
1416
1624
|
return ("string" === e ? String : Number)(t);
|
|
1417
1625
|
}(t, "string");
|
|
1418
|
-
return "symbol" ==
|
|
1626
|
+
return "symbol" == he(e) ? e : e + "";
|
|
1419
1627
|
}
|
|
1420
|
-
var
|
|
1421
|
-
return
|
|
1422
|
-
|
|
1423
|
-
|
|
1628
|
+
var we = function() {
|
|
1629
|
+
return de((function t(e, r, n) {
|
|
1630
|
+
ve(this, t), be(this, "short", void 0), be(this, "long", void 0), be(this, "signal", void 0),
|
|
1631
|
+
be(this, "prices", []), be(this, "result", void 0), this.short = e, this.long = r,
|
|
1424
1632
|
this.signal = n;
|
|
1425
1633
|
}), [ {
|
|
1426
1634
|
key: "getResult",
|
|
@@ -1451,52 +1659,52 @@ var OHLCV_INDICATORS;
|
|
|
1451
1659
|
} ]);
|
|
1452
1660
|
}();
|
|
1453
1661
|
// ./node_modules/trading-signals/dist/RSI/RSI.js
|
|
1454
|
-
function
|
|
1455
|
-
return
|
|
1662
|
+
function Oe(t) {
|
|
1663
|
+
return Oe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1456
1664
|
return typeof t;
|
|
1457
1665
|
} : function(t) {
|
|
1458
1666
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1459
|
-
},
|
|
1667
|
+
}, Oe(t);
|
|
1460
1668
|
}
|
|
1461
|
-
function
|
|
1669
|
+
function Se(t, e) {
|
|
1462
1670
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1463
1671
|
}
|
|
1464
|
-
function
|
|
1672
|
+
function je(t, e) {
|
|
1465
1673
|
for (var r = 0; r < e.length; r++) {
|
|
1466
1674
|
var n = e[r];
|
|
1467
1675
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1468
|
-
Object.defineProperty(t,
|
|
1676
|
+
Object.defineProperty(t, xe(n.key), n);
|
|
1469
1677
|
}
|
|
1470
1678
|
}
|
|
1471
|
-
function
|
|
1472
|
-
return e &&
|
|
1679
|
+
function Pe(t, e, r) {
|
|
1680
|
+
return e && je(t.prototype, e), r && je(t, r), Object.defineProperty(t, "prototype", {
|
|
1473
1681
|
writable: !1
|
|
1474
1682
|
}), t;
|
|
1475
1683
|
}
|
|
1476
|
-
function
|
|
1477
|
-
return e =
|
|
1478
|
-
if (e && ("object" ==
|
|
1684
|
+
function _e(t, e, r) {
|
|
1685
|
+
return e = Te(e), function(t, e) {
|
|
1686
|
+
if (e && ("object" == Oe(e) || "function" == typeof e)) return e;
|
|
1479
1687
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1480
1688
|
return function(t) {
|
|
1481
1689
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1482
1690
|
return t;
|
|
1483
1691
|
}(t);
|
|
1484
|
-
}(t,
|
|
1692
|
+
}(t, Ne() ? Reflect.construct(e, r || [], Te(t).constructor) : e.apply(t, r));
|
|
1485
1693
|
}
|
|
1486
|
-
function
|
|
1694
|
+
function Ne() {
|
|
1487
1695
|
try {
|
|
1488
1696
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1489
1697
|
} catch (t) {}
|
|
1490
|
-
return (
|
|
1698
|
+
return (Ne = function() {
|
|
1491
1699
|
return !!t;
|
|
1492
1700
|
})();
|
|
1493
1701
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return
|
|
1702
|
+
function Te(t) {
|
|
1703
|
+
return Te = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1496
1704
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1497
|
-
},
|
|
1705
|
+
}, Te(t);
|
|
1498
1706
|
}
|
|
1499
|
-
function
|
|
1707
|
+
function Ae(t, e) {
|
|
1500
1708
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1501
1709
|
t.prototype = Object.create(e && e.prototype, {
|
|
1502
1710
|
constructor: {
|
|
@@ -1506,42 +1714,42 @@ var OHLCV_INDICATORS;
|
|
|
1506
1714
|
}
|
|
1507
1715
|
}), Object.defineProperty(t, "prototype", {
|
|
1508
1716
|
writable: !1
|
|
1509
|
-
}), e &&
|
|
1717
|
+
}), e && Ee(t, e);
|
|
1510
1718
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return
|
|
1719
|
+
function Ee(t, e) {
|
|
1720
|
+
return Ee = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1513
1721
|
return t.__proto__ = e, t;
|
|
1514
|
-
},
|
|
1722
|
+
}, Ee(t, e);
|
|
1515
1723
|
}
|
|
1516
|
-
function
|
|
1517
|
-
return (e =
|
|
1724
|
+
function ke(t, e, r) {
|
|
1725
|
+
return (e = xe(e)) in t ? Object.defineProperty(t, e, {
|
|
1518
1726
|
value: r,
|
|
1519
1727
|
enumerable: !0,
|
|
1520
1728
|
configurable: !0,
|
|
1521
1729
|
writable: !0
|
|
1522
1730
|
}) : t[e] = r, t;
|
|
1523
1731
|
}
|
|
1524
|
-
function
|
|
1732
|
+
function xe(t) {
|
|
1525
1733
|
var e = function(t, e) {
|
|
1526
|
-
if ("object" !=
|
|
1734
|
+
if ("object" != Oe(t) || !t) return t;
|
|
1527
1735
|
var r = t[Symbol.toPrimitive];
|
|
1528
1736
|
if (void 0 !== r) {
|
|
1529
1737
|
var n = r.call(t, e || "default");
|
|
1530
|
-
if ("object" !=
|
|
1738
|
+
if ("object" != Oe(n)) return n;
|
|
1531
1739
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1532
1740
|
}
|
|
1533
1741
|
return ("string" === e ? String : Number)(t);
|
|
1534
1742
|
}(t, "string");
|
|
1535
|
-
return "symbol" ==
|
|
1743
|
+
return "symbol" == Oe(e) ? e : e + "";
|
|
1536
1744
|
}
|
|
1537
|
-
var
|
|
1745
|
+
var Ie = function(t) {
|
|
1538
1746
|
function e(t) {
|
|
1539
|
-
var r, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] :
|
|
1540
|
-
return
|
|
1541
|
-
|
|
1747
|
+
var r, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : jt;
|
|
1748
|
+
return Se(this, e), ke(r = _e(this, e), "interval", void 0), ke(r, "previousPrices", []),
|
|
1749
|
+
ke(r, "avgGain", void 0), ke(r, "avgLoss", void 0), ke(r, "maxValue", 100), r.interval = t,
|
|
1542
1750
|
r.avgGain = new n(r.interval), r.avgLoss = new n(r.interval), r;
|
|
1543
1751
|
}
|
|
1544
|
-
return
|
|
1752
|
+
return Ae(e, t), Pe(e, [ {
|
|
1545
1753
|
key: "update",
|
|
1546
1754
|
value: function(t) {
|
|
1547
1755
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
@@ -1558,28 +1766,28 @@ var OHLCV_INDICATORS;
|
|
|
1558
1766
|
}
|
|
1559
1767
|
}
|
|
1560
1768
|
} ]);
|
|
1561
|
-
}(
|
|
1769
|
+
}(V);
|
|
1562
1770
|
// ./src/oscillators/rsi.js
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1771
|
+
function De(t) {
|
|
1772
|
+
return De = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1565
1773
|
return typeof t;
|
|
1566
1774
|
} : function(t) {
|
|
1567
1775
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1568
|
-
},
|
|
1776
|
+
}, De(t);
|
|
1569
1777
|
}
|
|
1570
|
-
function
|
|
1778
|
+
function Me(t, e, r) {
|
|
1571
1779
|
return (e = function(t) {
|
|
1572
1780
|
var e = function(t, e) {
|
|
1573
|
-
if ("object" !=
|
|
1781
|
+
if ("object" != De(t) || !t) return t;
|
|
1574
1782
|
var r = t[Symbol.toPrimitive];
|
|
1575
1783
|
if (void 0 !== r) {
|
|
1576
1784
|
var n = r.call(t, e || "default");
|
|
1577
|
-
if ("object" !=
|
|
1785
|
+
if ("object" != De(n)) return n;
|
|
1578
1786
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1579
1787
|
}
|
|
1580
1788
|
return ("string" === e ? String : Number)(t);
|
|
1581
1789
|
}(t, "string");
|
|
1582
|
-
return "symbol" ==
|
|
1790
|
+
return "symbol" == De(e) ? e : e + "";
|
|
1583
1791
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1584
1792
|
value: r,
|
|
1585
1793
|
enumerable: !0,
|
|
@@ -1587,57 +1795,55 @@ var OHLCV_INDICATORS;
|
|
|
1587
1795
|
writable: !0
|
|
1588
1796
|
}) : t[e] = r, t;
|
|
1589
1797
|
}
|
|
1590
|
-
var
|
|
1591
|
-
ema:
|
|
1592
|
-
sma:
|
|
1593
|
-
},
|
|
1798
|
+
var Re = {
|
|
1799
|
+
ema: pe,
|
|
1800
|
+
sma: ft
|
|
1801
|
+
}, Ce = function(t, e, r, n, o) {
|
|
1594
1802
|
var i = o.target, a = (o.lag, o.precomputed), u = t.verticalOhlcv, l = t.instances, c = a.keyName;
|
|
1595
1803
|
if (0 === e && !u.hasOwnProperty(i)) throw new Error("Target property ".concat(i, " not found in verticalOhlcv for ").concat(r, "."));
|
|
1596
1804
|
// Retrieve the current price value.
|
|
1597
|
-
var s = u[i][e], f = l[c]
|
|
1805
|
+
var s = u[i][e], f = l[c];
|
|
1598
1806
|
// Update the moving average instance.
|
|
1599
1807
|
f.update(s);
|
|
1600
|
-
var
|
|
1808
|
+
var y = NaN;
|
|
1601
1809
|
try {
|
|
1602
|
-
|
|
1810
|
+
y = f.getResult();
|
|
1603
1811
|
} catch (t) {}
|
|
1604
1812
|
// Always push the MA value (even if NaN).
|
|
1605
1813
|
return t.pushToMain({
|
|
1606
1814
|
index: e,
|
|
1607
1815
|
key: c,
|
|
1608
|
-
value:
|
|
1816
|
+
value: y
|
|
1609
1817
|
}), !0;
|
|
1610
|
-
},
|
|
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) : "",
|
|
1818
|
+
}, Fe = function(t) {
|
|
1819
|
+
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
1820
|
// Create the main moving average instance.
|
|
1613
|
-
return a[
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
{
|
|
1617
|
-
keyName: h
|
|
1821
|
+
return a[y] = new Re[i](r), u[y] = new Float64Array(s).fill(NaN), l.add(y), o > 0 && e.lag([ y ], o),
|
|
1822
|
+
c[y] = "Float64Array", {
|
|
1823
|
+
keyName: y
|
|
1618
1824
|
};
|
|
1619
1825
|
};
|
|
1620
1826
|
// ./src/moving-averages/macd.js
|
|
1621
|
-
function
|
|
1622
|
-
return
|
|
1827
|
+
function Le(t) {
|
|
1828
|
+
return Le = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1623
1829
|
return typeof t;
|
|
1624
1830
|
} : function(t) {
|
|
1625
1831
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1626
|
-
},
|
|
1832
|
+
}, Le(t);
|
|
1627
1833
|
}
|
|
1628
|
-
function
|
|
1834
|
+
function Be(t, e, r) {
|
|
1629
1835
|
return (e = function(t) {
|
|
1630
1836
|
var e = function(t, e) {
|
|
1631
|
-
if ("object" !=
|
|
1837
|
+
if ("object" != Le(t) || !t) return t;
|
|
1632
1838
|
var r = t[Symbol.toPrimitive];
|
|
1633
1839
|
if (void 0 !== r) {
|
|
1634
1840
|
var n = r.call(t, e || "default");
|
|
1635
|
-
if ("object" !=
|
|
1841
|
+
if ("object" != Le(n)) return n;
|
|
1636
1842
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1637
1843
|
}
|
|
1638
1844
|
return ("string" === e ? String : Number)(t);
|
|
1639
1845
|
}(t, "string");
|
|
1640
|
-
return "symbol" ==
|
|
1846
|
+
return "symbol" == Le(e) ? e : e + "";
|
|
1641
1847
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1642
1848
|
value: r,
|
|
1643
1849
|
enumerable: !0,
|
|
@@ -1645,14 +1851,14 @@ var OHLCV_INDICATORS;
|
|
|
1645
1851
|
writable: !0
|
|
1646
1852
|
}) : t[e] = r, t;
|
|
1647
1853
|
}
|
|
1648
|
-
function
|
|
1854
|
+
function He(t, e) {
|
|
1649
1855
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1650
1856
|
if (!r) {
|
|
1651
1857
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
1652
1858
|
if (t) {
|
|
1653
|
-
if ("string" == typeof t) return
|
|
1859
|
+
if ("string" == typeof t) return Ve(t, e);
|
|
1654
1860
|
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) ?
|
|
1861
|
+
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) ? Ve(t, e) : void 0;
|
|
1656
1862
|
}
|
|
1657
1863
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
1658
1864
|
r && (t = r);
|
|
@@ -1696,22 +1902,22 @@ var OHLCV_INDICATORS;
|
|
|
1696
1902
|
}
|
|
1697
1903
|
};
|
|
1698
1904
|
}
|
|
1699
|
-
function
|
|
1905
|
+
function Ve(t, e) {
|
|
1700
1906
|
(null == e || e > t.length) && (e = t.length);
|
|
1701
1907
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1702
1908
|
return n;
|
|
1703
1909
|
}
|
|
1704
|
-
var
|
|
1910
|
+
var Ue = "close";
|
|
1705
1911
|
// ./src/utilities/numberUtilities.js
|
|
1706
|
-
function
|
|
1707
|
-
return
|
|
1912
|
+
function $e(t) {
|
|
1913
|
+
return $e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1708
1914
|
return typeof t;
|
|
1709
1915
|
} : function(t) {
|
|
1710
1916
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1711
|
-
},
|
|
1917
|
+
}, $e(t);
|
|
1712
1918
|
}
|
|
1713
1919
|
// Helper to clean non-numeric characters (except "-" at the start and decimal point)
|
|
1714
|
-
var
|
|
1920
|
+
var qe = {
|
|
1715
1921
|
number: function(t) {
|
|
1716
1922
|
return t;
|
|
1717
1923
|
},
|
|
@@ -1721,7 +1927,7 @@ var OHLCV_INDICATORS;
|
|
|
1721
1927
|
numberDirtyString: function(t) {
|
|
1722
1928
|
return Number(t.replace(/(?!^-)[^0-9.]/g, ""));
|
|
1723
1929
|
}
|
|
1724
|
-
},
|
|
1930
|
+
}, ze = function(t) {
|
|
1725
1931
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
1726
1932
|
// 1) true numbers
|
|
1727
1933
|
if ("number" == typeof t && !Number.isNaN(t)) return "number";
|
|
@@ -1736,43 +1942,43 @@ var OHLCV_INDICATORS;
|
|
|
1736
1942
|
if (o && n.test(o)) return "numberDirtyString";
|
|
1737
1943
|
}
|
|
1738
1944
|
if (e) throw new TypeError("Invalid input: expected a number or numeric string");
|
|
1739
|
-
return
|
|
1740
|
-
},
|
|
1945
|
+
return $e(t);
|
|
1946
|
+
}, Ge = function(t, e) {
|
|
1741
1947
|
var r = Math.pow(10, e);
|
|
1742
1948
|
// add a tiny epsilon to mitigate floating-point quirks around .5
|
|
1743
1949
|
return Math.round((t + Number.EPSILON) * r) / r;
|
|
1744
1950
|
};
|
|
1745
1951
|
// ./src/moving-averages/donchianChannel.js
|
|
1746
|
-
function
|
|
1952
|
+
function Ke(t) {
|
|
1747
1953
|
return function(t) {
|
|
1748
|
-
if (Array.isArray(t)) return
|
|
1954
|
+
if (Array.isArray(t)) return Je(t);
|
|
1749
1955
|
}(t) || function(t) {
|
|
1750
1956
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1751
|
-
}(t) ||
|
|
1957
|
+
}(t) || Ye(t) || function() {
|
|
1752
1958
|
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
1959
|
}();
|
|
1754
1960
|
}
|
|
1755
|
-
function
|
|
1961
|
+
function Ye(t, e) {
|
|
1756
1962
|
if (t) {
|
|
1757
|
-
if ("string" == typeof t) return
|
|
1963
|
+
if ("string" == typeof t) return Je(t, e);
|
|
1758
1964
|
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) ?
|
|
1965
|
+
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) ? Je(t, e) : void 0;
|
|
1760
1966
|
}
|
|
1761
1967
|
}
|
|
1762
|
-
function
|
|
1968
|
+
function Je(t, e) {
|
|
1763
1969
|
(null == e || e > t.length) && (e = t.length);
|
|
1764
1970
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1765
1971
|
return n;
|
|
1766
1972
|
}
|
|
1767
1973
|
// ./src/moving-averages/bollingerBands.js
|
|
1768
|
-
function
|
|
1769
|
-
return
|
|
1974
|
+
function Ze(t) {
|
|
1975
|
+
return Ze = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1770
1976
|
return typeof t;
|
|
1771
1977
|
} : function(t) {
|
|
1772
1978
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1773
|
-
},
|
|
1979
|
+
}, Ze(t);
|
|
1774
1980
|
}
|
|
1775
|
-
function
|
|
1981
|
+
function Qe(t, e) {
|
|
1776
1982
|
var r = Object.keys(t);
|
|
1777
1983
|
if (Object.getOwnPropertySymbols) {
|
|
1778
1984
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -1782,19 +1988,19 @@ var OHLCV_INDICATORS;
|
|
|
1782
1988
|
}
|
|
1783
1989
|
return r;
|
|
1784
1990
|
}
|
|
1785
|
-
function
|
|
1991
|
+
function We(t, e, r) {
|
|
1786
1992
|
return (e = function(t) {
|
|
1787
1993
|
var e = function(t, e) {
|
|
1788
|
-
if ("object" !=
|
|
1994
|
+
if ("object" != Ze(t) || !t) return t;
|
|
1789
1995
|
var r = t[Symbol.toPrimitive];
|
|
1790
1996
|
if (void 0 !== r) {
|
|
1791
1997
|
var n = r.call(t, e || "default");
|
|
1792
|
-
if ("object" !=
|
|
1998
|
+
if ("object" != Ze(n)) return n;
|
|
1793
1999
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1794
2000
|
}
|
|
1795
2001
|
return ("string" === e ? String : Number)(t);
|
|
1796
2002
|
}(t, "string");
|
|
1797
|
-
return "symbol" ==
|
|
2003
|
+
return "symbol" == Ze(e) ? e : e + "";
|
|
1798
2004
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1799
2005
|
value: r,
|
|
1800
2006
|
enumerable: !0,
|
|
@@ -1802,14 +2008,14 @@ var OHLCV_INDICATORS;
|
|
|
1802
2008
|
writable: !0
|
|
1803
2009
|
}) : t[e] = r, t;
|
|
1804
2010
|
}
|
|
1805
|
-
function
|
|
2011
|
+
function Xe(t, e) {
|
|
1806
2012
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1807
2013
|
if (!r) {
|
|
1808
2014
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
1809
2015
|
if (t) {
|
|
1810
|
-
if ("string" == typeof t) return
|
|
2016
|
+
if ("string" == typeof t) return tr(t, e);
|
|
1811
2017
|
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) ?
|
|
2018
|
+
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) ? tr(t, e) : void 0;
|
|
1813
2019
|
}
|
|
1814
2020
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
1815
2021
|
r && (t = r);
|
|
@@ -1853,32 +2059,32 @@ var OHLCV_INDICATORS;
|
|
|
1853
2059
|
}
|
|
1854
2060
|
};
|
|
1855
2061
|
}
|
|
1856
|
-
function
|
|
2062
|
+
function tr(t, e) {
|
|
1857
2063
|
(null == e || e > t.length) && (e = t.length);
|
|
1858
2064
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1859
2065
|
return n;
|
|
1860
2066
|
}
|
|
1861
2067
|
// ./src/oscillators/volumeOscillator.js
|
|
1862
|
-
function
|
|
1863
|
-
return
|
|
2068
|
+
function er(t) {
|
|
2069
|
+
return er = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1864
2070
|
return typeof t;
|
|
1865
2071
|
} : function(t) {
|
|
1866
2072
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1867
|
-
},
|
|
2073
|
+
}, er(t);
|
|
1868
2074
|
}
|
|
1869
|
-
function
|
|
2075
|
+
function rr(t, e, r) {
|
|
1870
2076
|
return (e = function(t) {
|
|
1871
2077
|
var e = function(t, e) {
|
|
1872
|
-
if ("object" !=
|
|
2078
|
+
if ("object" != er(t) || !t) return t;
|
|
1873
2079
|
var r = t[Symbol.toPrimitive];
|
|
1874
2080
|
if (void 0 !== r) {
|
|
1875
2081
|
var n = r.call(t, e || "default");
|
|
1876
|
-
if ("object" !=
|
|
2082
|
+
if ("object" != er(n)) return n;
|
|
1877
2083
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1878
2084
|
}
|
|
1879
2085
|
return ("string" === e ? String : Number)(t);
|
|
1880
2086
|
}(t, "string");
|
|
1881
|
-
return "symbol" ==
|
|
2087
|
+
return "symbol" == er(e) ? e : e + "";
|
|
1882
2088
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1883
2089
|
value: r,
|
|
1884
2090
|
enumerable: !0,
|
|
@@ -1887,14 +2093,27 @@ var OHLCV_INDICATORS;
|
|
|
1887
2093
|
}) : t[e] = r, t;
|
|
1888
2094
|
}
|
|
1889
2095
|
// ./src/utilities/dateUtilities.js
|
|
1890
|
-
function
|
|
1891
|
-
return
|
|
2096
|
+
function nr(t) {
|
|
2097
|
+
return nr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1892
2098
|
return typeof t;
|
|
1893
2099
|
} : function(t) {
|
|
1894
2100
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1895
|
-
},
|
|
2101
|
+
}, nr(t);
|
|
1896
2102
|
}
|
|
1897
|
-
var
|
|
2103
|
+
var or = {
|
|
2104
|
+
string: function(t) {
|
|
2105
|
+
return t.toISOString();
|
|
2106
|
+
},
|
|
2107
|
+
milliseconds: function(t) {
|
|
2108
|
+
return t.getTime();
|
|
2109
|
+
},
|
|
2110
|
+
seconds: function(t) {
|
|
2111
|
+
return t.getTime() / 1e3;
|
|
2112
|
+
},
|
|
2113
|
+
object: function(t) {
|
|
2114
|
+
return t;
|
|
2115
|
+
}
|
|
2116
|
+
}, ir = {
|
|
1898
2117
|
dateObject: function(t) {
|
|
1899
2118
|
return t;
|
|
1900
2119
|
},
|
|
@@ -1910,14 +2129,14 @@ var OHLCV_INDICATORS;
|
|
|
1910
2129
|
dateCompleteDateString: function(t) {
|
|
1911
2130
|
return new Date(t);
|
|
1912
2131
|
}
|
|
1913
|
-
},
|
|
2132
|
+
}, ar = function(t) {
|
|
1914
2133
|
// Regex for a UTC Time Format where the string ends with "Z".
|
|
1915
2134
|
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(
|
|
2135
|
+
throw new Error('Invalid "'.concat(nr(t), '" date value passed in selectDateFormatter. Supported formats: \n-').concat(e.join("\n- ")));
|
|
1917
2136
|
};
|
|
1918
2137
|
// Regex for a Timezone Offset Format,
|
|
1919
2138
|
// which includes a plus or minus sign followed by HH:MM at the end.
|
|
1920
|
-
if ("object" ===
|
|
2139
|
+
if ("object" === nr(t)) {
|
|
1921
2140
|
if (t instanceof Date && !isNaN(t.valueOf())) return "dateObject";
|
|
1922
2141
|
r();
|
|
1923
2142
|
} else {
|
|
@@ -1934,7 +2153,7 @@ var OHLCV_INDICATORS;
|
|
|
1934
2153
|
}
|
|
1935
2154
|
};
|
|
1936
2155
|
// ./src/utilities/assignTypes.js
|
|
1937
|
-
function
|
|
2156
|
+
function ur(t, e) {
|
|
1938
2157
|
return function(t) {
|
|
1939
2158
|
if (Array.isArray(t)) return t;
|
|
1940
2159
|
}(t) || function(t, e) {
|
|
@@ -1959,24 +2178,24 @@ var OHLCV_INDICATORS;
|
|
|
1959
2178
|
}
|
|
1960
2179
|
}(t, e) || function(t, e) {
|
|
1961
2180
|
if (t) {
|
|
1962
|
-
if ("string" == typeof t) return
|
|
2181
|
+
if ("string" == typeof t) return lr(t, e);
|
|
1963
2182
|
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) ?
|
|
2183
|
+
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) ? lr(t, e) : void 0;
|
|
1965
2184
|
}
|
|
1966
2185
|
}(t, e) || function() {
|
|
1967
2186
|
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
2187
|
}();
|
|
1969
2188
|
}
|
|
1970
|
-
function
|
|
2189
|
+
function lr(t, e) {
|
|
1971
2190
|
(null == e || e > t.length) && (e = t.length);
|
|
1972
2191
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1973
2192
|
return n;
|
|
1974
2193
|
}
|
|
1975
|
-
var
|
|
2194
|
+
var cr = new Set([ "open", "high", "low", "close" ]), sr = function(t, e) {
|
|
1976
2195
|
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
2196
|
};
|
|
1978
2197
|
// ./src/studies/lag.js
|
|
1979
|
-
function
|
|
2198
|
+
function fr(t, e) {
|
|
1980
2199
|
return function(t) {
|
|
1981
2200
|
if (Array.isArray(t)) return t;
|
|
1982
2201
|
}(t) || function(t, e) {
|
|
@@ -1999,14 +2218,14 @@ var OHLCV_INDICATORS;
|
|
|
1999
2218
|
}
|
|
2000
2219
|
return u;
|
|
2001
2220
|
}
|
|
2002
|
-
}(t, e) ||
|
|
2221
|
+
}(t, e) || pr(t, e) || function() {
|
|
2003
2222
|
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
2223
|
}();
|
|
2005
2224
|
}
|
|
2006
|
-
function
|
|
2225
|
+
function yr(t, e) {
|
|
2007
2226
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2008
2227
|
if (!r) {
|
|
2009
|
-
if (Array.isArray(t) || (r =
|
|
2228
|
+
if (Array.isArray(t) || (r = pr(t)) || e && t && "number" == typeof t.length) {
|
|
2010
2229
|
r && (t = r);
|
|
2011
2230
|
var n = 0, o = function() {};
|
|
2012
2231
|
return {
|
|
@@ -2048,22 +2267,22 @@ var OHLCV_INDICATORS;
|
|
|
2048
2267
|
}
|
|
2049
2268
|
};
|
|
2050
2269
|
}
|
|
2051
|
-
function
|
|
2270
|
+
function pr(t, e) {
|
|
2052
2271
|
if (t) {
|
|
2053
|
-
if ("string" == typeof t) return
|
|
2272
|
+
if ("string" == typeof t) return hr(t, e);
|
|
2054
2273
|
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) ?
|
|
2274
|
+
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) ? hr(t, e) : void 0;
|
|
2056
2275
|
}
|
|
2057
2276
|
}
|
|
2058
|
-
function
|
|
2277
|
+
function hr(t, e) {
|
|
2059
2278
|
(null == e || e > t.length) && (e = t.length);
|
|
2060
2279
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2061
2280
|
return n;
|
|
2062
2281
|
}
|
|
2063
|
-
var
|
|
2282
|
+
var vr = function(t, e) {
|
|
2064
2283
|
var r = t.instances, n = t.verticalOhlcv, o = t.len, i = t.arrayTypes, a = t.priceBased;
|
|
2065
2284
|
if (0 === e) {
|
|
2066
|
-
var u, l = [], c =
|
|
2285
|
+
var u, l = [], c = yr(t.inputParams);
|
|
2067
2286
|
try {
|
|
2068
2287
|
for (c.s(); !(u = c.n()).done; ) {
|
|
2069
2288
|
var s = u.value;
|
|
@@ -2074,11 +2293,11 @@ var OHLCV_INDICATORS;
|
|
|
2074
2293
|
} finally {
|
|
2075
2294
|
c.f();
|
|
2076
2295
|
}
|
|
2077
|
-
for (var f = 0,
|
|
2078
|
-
var
|
|
2296
|
+
for (var f = 0, y = l; f < y.length; f++) {
|
|
2297
|
+
var p, h = fr(y[f], 2), v = h[0], m = h[1], d = yr(v);
|
|
2079
2298
|
try {
|
|
2080
|
-
for (d.s(); !(
|
|
2081
|
-
var b =
|
|
2299
|
+
for (d.s(); !(p = d.n()).done; ) {
|
|
2300
|
+
var b = p.value;
|
|
2082
2301
|
if (a.has(b)) for (var g = 1; g <= m; g++) a.add("".concat(b, "_lag_").concat(g));
|
|
2083
2302
|
}
|
|
2084
2303
|
} catch (t) {
|
|
@@ -2091,26 +2310,26 @@ var OHLCV_INDICATORS;
|
|
|
2091
2310
|
lagParams: l
|
|
2092
2311
|
};
|
|
2093
2312
|
}
|
|
2094
|
-
var w,
|
|
2313
|
+
var w, O = yr(r.lag.lagParams);
|
|
2095
2314
|
try {
|
|
2096
|
-
for (
|
|
2097
|
-
var
|
|
2315
|
+
for (O.s(); !(w = O.n()).done; ) {
|
|
2316
|
+
var S, j = fr(w.value, 2), P = j[0], _ = j[1], N = yr(P);
|
|
2098
2317
|
try {
|
|
2099
|
-
for (N.s(); !(
|
|
2100
|
-
var
|
|
2318
|
+
for (N.s(); !(S = N.n()).done; ) {
|
|
2319
|
+
var T = S.value, A = n[T];
|
|
2101
2320
|
// Initialize lagged arrays only on the first index
|
|
2102
2321
|
if (0 === e) for (var E = 1; E <= _; E++) {
|
|
2103
|
-
var
|
|
2104
|
-
if (!i.hasOwnProperty(
|
|
2105
|
-
n[
|
|
2322
|
+
var k = "".concat(T, "_lag_").concat(E);
|
|
2323
|
+
if (!i.hasOwnProperty(T)) throw new Error('Lag processing invoked by "'.concat(T, '" expected arrayTypes to have a "').concat(T, '" property, but it wasn’t found.'));
|
|
2324
|
+
n[k] = sr(i[T], o), i[k] = i[T];
|
|
2106
2325
|
}
|
|
2107
2326
|
// Populate lagged values
|
|
2108
|
-
for (var
|
|
2109
|
-
var I = "".concat(
|
|
2327
|
+
for (var x = 1; x <= _; x++) {
|
|
2328
|
+
var I = "".concat(T, "_lag_").concat(x), D = e - x, M = D <= 0 || void 0 === A[D] ? null : A[D];
|
|
2110
2329
|
t.pushToMain({
|
|
2111
2330
|
index: e,
|
|
2112
2331
|
key: I,
|
|
2113
|
-
value:
|
|
2332
|
+
value: M
|
|
2114
2333
|
});
|
|
2115
2334
|
}
|
|
2116
2335
|
}
|
|
@@ -2121,21 +2340,21 @@ var OHLCV_INDICATORS;
|
|
|
2121
2340
|
}
|
|
2122
2341
|
}
|
|
2123
2342
|
} catch (t) {
|
|
2124
|
-
|
|
2343
|
+
O.e(t);
|
|
2125
2344
|
} finally {
|
|
2126
|
-
|
|
2345
|
+
O.f();
|
|
2127
2346
|
}
|
|
2128
2347
|
return !0;
|
|
2129
2348
|
};
|
|
2130
2349
|
// ./src/studies/findCrosses.js
|
|
2131
|
-
function
|
|
2350
|
+
function mr(t, e) {
|
|
2132
2351
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2133
2352
|
if (!r) {
|
|
2134
2353
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
2135
2354
|
if (t) {
|
|
2136
|
-
if ("string" == typeof t) return
|
|
2355
|
+
if ("string" == typeof t) return dr(t, e);
|
|
2137
2356
|
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) ?
|
|
2357
|
+
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) ? dr(t, e) : void 0;
|
|
2139
2358
|
}
|
|
2140
2359
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
2141
2360
|
r && (t = r);
|
|
@@ -2179,43 +2398,43 @@ var OHLCV_INDICATORS;
|
|
|
2179
2398
|
}
|
|
2180
2399
|
};
|
|
2181
2400
|
}
|
|
2182
|
-
function
|
|
2401
|
+
function dr(t, e) {
|
|
2183
2402
|
(null == e || e > t.length) && (e = t.length);
|
|
2184
2403
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2185
2404
|
return n;
|
|
2186
2405
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
2406
|
+
function br(t) {
|
|
2407
|
+
return br = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2189
2408
|
return typeof t;
|
|
2190
2409
|
} : function(t) {
|
|
2191
2410
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2192
|
-
},
|
|
2411
|
+
}, br(t);
|
|
2193
2412
|
}
|
|
2194
|
-
function
|
|
2413
|
+
function gr(t, e) {
|
|
2195
2414
|
for (var r = 0; r < e.length; r++) {
|
|
2196
2415
|
var n = e[r];
|
|
2197
2416
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
2198
|
-
Object.defineProperty(t,
|
|
2417
|
+
Object.defineProperty(t, wr(n.key), n);
|
|
2199
2418
|
}
|
|
2200
2419
|
}
|
|
2201
|
-
function
|
|
2420
|
+
function wr(t) {
|
|
2202
2421
|
var e = function(t, e) {
|
|
2203
|
-
if ("object" !=
|
|
2422
|
+
if ("object" != br(t) || !t) return t;
|
|
2204
2423
|
var r = t[Symbol.toPrimitive];
|
|
2205
2424
|
if (void 0 !== r) {
|
|
2206
2425
|
var n = r.call(t, e || "default");
|
|
2207
|
-
if ("object" !=
|
|
2426
|
+
if ("object" != br(n)) return n;
|
|
2208
2427
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2209
2428
|
}
|
|
2210
2429
|
return ("string" === e ? String : Number)(t);
|
|
2211
2430
|
}(t, "string");
|
|
2212
|
-
return "symbol" ==
|
|
2431
|
+
return "symbol" == br(e) ? e : e + "";
|
|
2213
2432
|
}
|
|
2214
|
-
var
|
|
2433
|
+
var Or = function(t, e) {
|
|
2215
2434
|
return t > e;
|
|
2216
|
-
},
|
|
2435
|
+
}, Sr = function(t, e) {
|
|
2217
2436
|
return t < e;
|
|
2218
|
-
},
|
|
2437
|
+
}, jr = function() {
|
|
2219
2438
|
return t = function t() {
|
|
2220
2439
|
!function(t, e) {
|
|
2221
2440
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -2239,11 +2458,11 @@ var OHLCV_INDICATORS;
|
|
|
2239
2458
|
this.areHighAndLowUndefined || void 0 !== n && void 0 !== i || (this.areHighAndLowUndefined = !0),
|
|
2240
2459
|
Number.isNaN(r) || Number.isNaN(o) || function(t, e) {
|
|
2241
2460
|
return t === e;
|
|
2242
|
-
}(r, o) ? a = .5 :
|
|
2461
|
+
}(r, o) ? a = .5 : Or(r, o) ? a = this.areHighAndLowUndefined ? 1 : [ i, o, this.prevLow, this.prevSlow ].every((function(t) {
|
|
2243
2462
|
return !Number.isNaN(t);
|
|
2244
|
-
})) &&
|
|
2463
|
+
})) && Sr(i, o) && Or(this.prevLow, this.prevSlow) ? 0 : 1 : Sr(r, o) && (a = this.areHighAndLowUndefined ? 0 : [ n, o, this.prevHigh, this.prevSlow ].every((function(t) {
|
|
2245
2464
|
return !Number.isNaN(t);
|
|
2246
|
-
})) &&
|
|
2465
|
+
})) && Or(n, o) && Sr(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
2466
|
1 === this.interval && this.crossIndexes.up.push(t), -1 === this.interval && this.crossIndexes.down.push(t),
|
|
2248
2467
|
//save prev state
|
|
2249
2468
|
Object.assign(this, {
|
|
@@ -2259,21 +2478,21 @@ var OHLCV_INDICATORS;
|
|
|
2259
2478
|
value: function() {
|
|
2260
2479
|
return this.interval;
|
|
2261
2480
|
}
|
|
2262
|
-
} ]) &&
|
|
2481
|
+
} ]) && gr(t.prototype, e), r && gr(t, r), Object.defineProperty(t, "prototype", {
|
|
2263
2482
|
writable: !1
|
|
2264
2483
|
}), t;
|
|
2265
2484
|
var t, e, r;
|
|
2266
|
-
}(),
|
|
2485
|
+
}(), Pr = function(t, e) {
|
|
2267
2486
|
var r = t.verticalOhlcv, n = t.instances, o = t.len, i = t.arrayTypes, a = t.verticalOhlcvTempCols;
|
|
2268
2487
|
if (0 === e) {
|
|
2269
2488
|
var u = t.inputParams;
|
|
2270
2489
|
n.crossPairsList = u.reduce((function(t, e) {
|
|
2271
2490
|
var r = e.key, n = e.params;
|
|
2272
2491
|
if ("crossPairs" === r) {
|
|
2273
|
-
var o, i =
|
|
2492
|
+
var o, i = mr(n);
|
|
2274
2493
|
try {
|
|
2275
2494
|
for (i.s(); !(o = i.n()).done; ) {
|
|
2276
|
-
var a, u =
|
|
2495
|
+
var a, u = mr(o.value);
|
|
2277
2496
|
try {
|
|
2278
2497
|
for (u.s(); !(a = u.n()).done; ) {
|
|
2279
2498
|
var l = a.value;
|
|
@@ -2294,31 +2513,31 @@ var OHLCV_INDICATORS;
|
|
|
2294
2513
|
return t;
|
|
2295
2514
|
}), []);
|
|
2296
2515
|
}
|
|
2297
|
-
var l, c =
|
|
2516
|
+
var l, c = mr(n.crossPairsList);
|
|
2298
2517
|
try {
|
|
2299
2518
|
for (c.s(); !(l = c.n()).done; ) {
|
|
2300
|
-
var s = l.value, f = s.fast,
|
|
2301
|
-
if (null != f && null !=
|
|
2302
|
-
var
|
|
2519
|
+
var s = l.value, f = s.fast, y = s.slow;
|
|
2520
|
+
if (null != f && null != y) {
|
|
2521
|
+
var p = "".concat(f, "_x_").concat(y);
|
|
2303
2522
|
if (0 === e) {
|
|
2304
|
-
if ("number" == typeof
|
|
2523
|
+
if ("number" == typeof y && (a.add(y.toString()), r[y.toString()] = new Int32Array(o).fill(y)),
|
|
2305
2524
|
"price" !== f && !r.hasOwnProperty(f)) throw Error('fast "'.concat(f, ' not found in crossPairs"'));
|
|
2306
|
-
if (!r.hasOwnProperty(
|
|
2307
|
-
n[
|
|
2525
|
+
if (!r.hasOwnProperty(y)) throw Error('slow "'.concat(y, ' not found in crossPairs"'));
|
|
2526
|
+
n[p] = new jr, r[p] = new Int32Array(o).fill(NaN), i[p] = "Int32Array";
|
|
2308
2527
|
}
|
|
2309
|
-
var
|
|
2310
|
-
"price" === f ? (v = r.close[e], m = r.high[e], d = r.low[e], b = r[
|
|
2528
|
+
var h = void 0, v = void 0, m = void 0, d = void 0, b = void 0;
|
|
2529
|
+
"price" === f ? (v = r.close[e], m = r.high[e], d = r.low[e], b = r[y][e], n[p].update(e, {
|
|
2311
2530
|
fast: v,
|
|
2312
2531
|
slow: b,
|
|
2313
2532
|
high: m,
|
|
2314
2533
|
low: d
|
|
2315
|
-
})) : (
|
|
2316
|
-
fast:
|
|
2534
|
+
})) : (h = r[f][e], b = r[y][e], n[p].update(e, {
|
|
2535
|
+
fast: h,
|
|
2317
2536
|
slow: b
|
|
2318
2537
|
})), t.pushToMain({
|
|
2319
2538
|
index: e,
|
|
2320
|
-
key:
|
|
2321
|
-
value: n[
|
|
2539
|
+
key: p,
|
|
2540
|
+
value: n[p].getResult()
|
|
2322
2541
|
});
|
|
2323
2542
|
}
|
|
2324
2543
|
}
|
|
@@ -2329,14 +2548,14 @@ var OHLCV_INDICATORS;
|
|
|
2329
2548
|
}
|
|
2330
2549
|
};
|
|
2331
2550
|
// ./src/studies/dateTime.js
|
|
2332
|
-
function
|
|
2333
|
-
return
|
|
2551
|
+
function _r(t) {
|
|
2552
|
+
return _r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2334
2553
|
return typeof t;
|
|
2335
2554
|
} : function(t) {
|
|
2336
2555
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2337
|
-
},
|
|
2556
|
+
}, _r(t);
|
|
2338
2557
|
}
|
|
2339
|
-
function
|
|
2558
|
+
function Nr(t, e) {
|
|
2340
2559
|
var r = Object.keys(t);
|
|
2341
2560
|
if (Object.getOwnPropertySymbols) {
|
|
2342
2561
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -2346,19 +2565,19 @@ var OHLCV_INDICATORS;
|
|
|
2346
2565
|
}
|
|
2347
2566
|
return r;
|
|
2348
2567
|
}
|
|
2349
|
-
function
|
|
2568
|
+
function Tr(t, e, r) {
|
|
2350
2569
|
return (e = function(t) {
|
|
2351
2570
|
var e = function(t, e) {
|
|
2352
|
-
if ("object" !=
|
|
2571
|
+
if ("object" != _r(t) || !t) return t;
|
|
2353
2572
|
var r = t[Symbol.toPrimitive];
|
|
2354
2573
|
if (void 0 !== r) {
|
|
2355
2574
|
var n = r.call(t, e || "default");
|
|
2356
|
-
if ("object" !=
|
|
2575
|
+
if ("object" != _r(n)) return n;
|
|
2357
2576
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2358
2577
|
}
|
|
2359
2578
|
return ("string" === e ? String : Number)(t);
|
|
2360
2579
|
}(t, "string");
|
|
2361
|
-
return "symbol" ==
|
|
2580
|
+
return "symbol" == _r(e) ? e : e + "";
|
|
2362
2581
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
2363
2582
|
value: r,
|
|
2364
2583
|
enumerable: !0,
|
|
@@ -2366,7 +2585,7 @@ var OHLCV_INDICATORS;
|
|
|
2366
2585
|
writable: !0
|
|
2367
2586
|
}) : t[e] = r, t;
|
|
2368
2587
|
}
|
|
2369
|
-
var
|
|
2588
|
+
var Ar = function(t) {
|
|
2370
2589
|
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
2590
|
return {
|
|
2372
2591
|
month: e,
|
|
@@ -2379,19 +2598,19 @@ var OHLCV_INDICATORS;
|
|
|
2379
2598
|
};
|
|
2380
2599
|
};
|
|
2381
2600
|
// ./src/studies/scaler.js
|
|
2382
|
-
function
|
|
2601
|
+
function Er(t) {
|
|
2383
2602
|
return function(t) {
|
|
2384
|
-
if (Array.isArray(t)) return
|
|
2603
|
+
if (Array.isArray(t)) return Dr(t);
|
|
2385
2604
|
}(t) || function(t) {
|
|
2386
2605
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2387
|
-
}(t) ||
|
|
2606
|
+
}(t) || Ir(t) || function() {
|
|
2388
2607
|
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
2608
|
}();
|
|
2390
2609
|
}
|
|
2391
|
-
function
|
|
2610
|
+
function kr(t, e) {
|
|
2392
2611
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2393
2612
|
if (!r) {
|
|
2394
|
-
if (Array.isArray(t) || (r =
|
|
2613
|
+
if (Array.isArray(t) || (r = Ir(t)) || e && t && "number" == typeof t.length) {
|
|
2395
2614
|
r && (t = r);
|
|
2396
2615
|
var n = 0, o = function() {};
|
|
2397
2616
|
return {
|
|
@@ -2433,7 +2652,7 @@ var OHLCV_INDICATORS;
|
|
|
2433
2652
|
}
|
|
2434
2653
|
};
|
|
2435
2654
|
}
|
|
2436
|
-
function
|
|
2655
|
+
function xr(t, e) {
|
|
2437
2656
|
return function(t) {
|
|
2438
2657
|
if (Array.isArray(t)) return t;
|
|
2439
2658
|
}
|
|
@@ -2457,36 +2676,36 @@ var OHLCV_INDICATORS;
|
|
|
2457
2676
|
}
|
|
2458
2677
|
return u;
|
|
2459
2678
|
}
|
|
2460
|
-
}(t, e) ||
|
|
2679
|
+
}(t, e) || Ir(t, e) || function() {
|
|
2461
2680
|
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
2681
|
}();
|
|
2463
2682
|
}
|
|
2464
|
-
function
|
|
2683
|
+
function Ir(t, e) {
|
|
2465
2684
|
if (t) {
|
|
2466
|
-
if ("string" == typeof t) return
|
|
2685
|
+
if ("string" == typeof t) return Dr(t, e);
|
|
2467
2686
|
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) ?
|
|
2687
|
+
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) ? Dr(t, e) : void 0;
|
|
2469
2688
|
}
|
|
2470
2689
|
}
|
|
2471
|
-
function
|
|
2690
|
+
function Dr(t, e) {
|
|
2472
2691
|
(null == e || e > t.length) && (e = t.length);
|
|
2473
2692
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2474
2693
|
return n;
|
|
2475
2694
|
}
|
|
2476
2695
|
// ./src/core-functions/mainLoop.js
|
|
2477
|
-
function
|
|
2696
|
+
function Mr(t) {
|
|
2478
2697
|
return function(t) {
|
|
2479
|
-
if (Array.isArray(t)) return
|
|
2698
|
+
if (Array.isArray(t)) return Lr(t);
|
|
2480
2699
|
}(t) || function(t) {
|
|
2481
2700
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2482
|
-
}(t) ||
|
|
2701
|
+
}(t) || Fr(t) || function() {
|
|
2483
2702
|
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
2703
|
}();
|
|
2485
2704
|
}
|
|
2486
|
-
function
|
|
2705
|
+
function Rr(t, e) {
|
|
2487
2706
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2488
2707
|
if (!r) {
|
|
2489
|
-
if (Array.isArray(t) || (r =
|
|
2708
|
+
if (Array.isArray(t) || (r = Fr(t)) || e && t && "number" == typeof t.length) {
|
|
2490
2709
|
r && (t = r);
|
|
2491
2710
|
var n = 0, o = function() {};
|
|
2492
2711
|
return {
|
|
@@ -2528,7 +2747,7 @@ var OHLCV_INDICATORS;
|
|
|
2528
2747
|
}
|
|
2529
2748
|
};
|
|
2530
2749
|
}
|
|
2531
|
-
function
|
|
2750
|
+
function Cr(t, e) {
|
|
2532
2751
|
return function(t) {
|
|
2533
2752
|
if (Array.isArray(t)) return t;
|
|
2534
2753
|
}
|
|
@@ -2553,23 +2772,23 @@ var OHLCV_INDICATORS;
|
|
|
2553
2772
|
}
|
|
2554
2773
|
return u;
|
|
2555
2774
|
}
|
|
2556
|
-
}(t, e) ||
|
|
2775
|
+
}(t, e) || Fr(t, e) || function() {
|
|
2557
2776
|
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
2777
|
}();
|
|
2559
2778
|
}
|
|
2560
|
-
function
|
|
2779
|
+
function Fr(t, e) {
|
|
2561
2780
|
if (t) {
|
|
2562
|
-
if ("string" == typeof t) return
|
|
2781
|
+
if ("string" == typeof t) return Lr(t, e);
|
|
2563
2782
|
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) ?
|
|
2783
|
+
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) ? Lr(t, e) : void 0;
|
|
2565
2784
|
}
|
|
2566
2785
|
}
|
|
2567
|
-
function
|
|
2786
|
+
function Lr(t, e) {
|
|
2568
2787
|
(null == e || e > t.length) && (e = t.length);
|
|
2569
2788
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2570
2789
|
return n;
|
|
2571
2790
|
}
|
|
2572
|
-
var
|
|
2791
|
+
var Br = {
|
|
2573
2792
|
dateTime: function(t, e, r) {
|
|
2574
2793
|
var n = r.lag, o = t.instances, i = t.verticalOhlcv;
|
|
2575
2794
|
if (0 === e) {
|
|
@@ -2589,9 +2808,9 @@ var OHLCV_INDICATORS;
|
|
|
2589
2808
|
Object.assign(i, function(t) {
|
|
2590
2809
|
for (var e = 1; e < arguments.length; e++) {
|
|
2591
2810
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2592
|
-
e % 2 ?
|
|
2593
|
-
|
|
2594
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
2811
|
+
e % 2 ? Nr(Object(r), !0).forEach((function(e) {
|
|
2812
|
+
Tr(t, e, r[e]);
|
|
2813
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Nr(Object(r)).forEach((function(e) {
|
|
2595
2814
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2596
2815
|
}));
|
|
2597
2816
|
}
|
|
@@ -2600,8 +2819,8 @@ var OHLCV_INDICATORS;
|
|
|
2600
2819
|
return [ t, new Int32Array(a).fill(NaN) ];
|
|
2601
2820
|
}))))), n > 0 && t.lag(c, n);
|
|
2602
2821
|
}
|
|
2603
|
-
var
|
|
2604
|
-
|
|
2822
|
+
var y = i.date[e], p = Ar(y), h = p.day_of_the_week, v = p.day_of_the_month, m = p.week_of_the_month, d = p.month, b = p.year, g = p.hour, w = p.minute, O = y;
|
|
2823
|
+
O !== o.dateTime.prevDateStr && (o.dateTime.prevDateStr = O, o.dateTime.sessionDailyIndexCount++,
|
|
2605
2824
|
o.dateTime.sessionIntradayIndexCount = 0), t.pushToMain({
|
|
2606
2825
|
index: e,
|
|
2607
2826
|
key: "session_daily_index",
|
|
@@ -2613,7 +2832,7 @@ var OHLCV_INDICATORS;
|
|
|
2613
2832
|
}), t.pushToMain({
|
|
2614
2833
|
index: e,
|
|
2615
2834
|
key: "day_of_the_week",
|
|
2616
|
-
value:
|
|
2835
|
+
value: h
|
|
2617
2836
|
}), t.pushToMain({
|
|
2618
2837
|
index: e,
|
|
2619
2838
|
key: "day_of_the_month",
|
|
@@ -2644,17 +2863,17 @@ var OHLCV_INDICATORS;
|
|
|
2644
2863
|
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
2864
|
// Initialization on the first index.
|
|
2646
2865
|
if (0 === e) {
|
|
2647
|
-
var f = t.crossPairsList,
|
|
2866
|
+
var f = t.crossPairsList, y = t.len, p = t.arrayTypes;
|
|
2648
2867
|
if (!a.hasOwnProperty(o)) throw new Error("Target property ".concat(o, " not found in verticalOhlcv for rsi."));
|
|
2649
2868
|
f.push({
|
|
2650
2869
|
fast: c,
|
|
2651
2870
|
slow: s,
|
|
2652
2871
|
isDefault: !0
|
|
2653
|
-
}), Object.assign(u,
|
|
2654
|
-
var
|
|
2655
|
-
i > 0 && t.lag(
|
|
2656
|
-
for (var v = 0, m =
|
|
2657
|
-
|
|
2872
|
+
}), Object.assign(u, Me(Me({}, c, new Ie(r)), s, new ft(r))), Object.assign(a, Me(Me({}, c, new Float64Array(y).fill(NaN)), s, new Float64Array(y).fill(NaN)));
|
|
2873
|
+
var h = [ c, s ];
|
|
2874
|
+
i > 0 && t.lag(h, i);
|
|
2875
|
+
for (var v = 0, m = h; v < m.length; v++) {
|
|
2876
|
+
p[m[v]] = "Float64Array";
|
|
2658
2877
|
}
|
|
2659
2878
|
}
|
|
2660
2879
|
var d = a[o][e], b = NaN, g = NaN;
|
|
@@ -2685,15 +2904,41 @@ var OHLCV_INDICATORS;
|
|
|
2685
2904
|
value: g
|
|
2686
2905
|
});
|
|
2687
2906
|
},
|
|
2688
|
-
|
|
2689
|
-
|
|
2907
|
+
atr: function(t, e, r, n) {
|
|
2908
|
+
var o = n.lag, i = t.verticalOhlcv, a = t.instances, u = "atr_".concat(r);
|
|
2909
|
+
if (0 === e) {
|
|
2910
|
+
var l = t.instances, c = t.verticalOhlcv, s = t.arrayTypes, f = t.len, y = t.priceBased;
|
|
2911
|
+
l[u] = new Yt(r, jt), c[u] = new Float64Array(f).fill(NaN), y.add(u), o > 0 && t.lag([ u ], o),
|
|
2912
|
+
s[u] = "Float64Array";
|
|
2913
|
+
}
|
|
2914
|
+
// Retrieve the current price value.
|
|
2915
|
+
var p = {
|
|
2916
|
+
high: i.high[e],
|
|
2917
|
+
low: i.low[e],
|
|
2918
|
+
close: i.close[e]
|
|
2919
|
+
}, h = a[u];
|
|
2920
|
+
// Update the moving average instance.
|
|
2921
|
+
h.update(p);
|
|
2922
|
+
var v = NaN;
|
|
2923
|
+
try {
|
|
2924
|
+
v = h.getResult();
|
|
2925
|
+
} catch (t) {}
|
|
2926
|
+
// Always push the MA value (even if NaN).
|
|
2927
|
+
return t.pushToMain({
|
|
2928
|
+
index: e,
|
|
2929
|
+
key: u,
|
|
2930
|
+
value: v
|
|
2931
|
+
}), !0;
|
|
2932
|
+
},
|
|
2933
|
+
ema: Ce,
|
|
2934
|
+
sma: Ce,
|
|
2690
2935
|
macd: function(t, e, r, n, o, i) {
|
|
2691
2936
|
var a = i.target, u = i.lag, l = i.precomputed, c = t.verticalOhlcv, s = t.instances, f = l.instanceKey;
|
|
2692
2937
|
// Initialization on the first index.
|
|
2693
2938
|
if (0 === e) {
|
|
2694
|
-
var
|
|
2939
|
+
var y = t.inputParams, p = t.crossPairsList, h = t.priceBased, v = t.len, m = t.arrayTypes;
|
|
2695
2940
|
if (!c.hasOwnProperty(a)) throw new Error("Target property ".concat(a, " not found in verticalOhlcv for macd."));
|
|
2696
|
-
var d, b = 0, g =
|
|
2941
|
+
var d, b = 0, g = He(y);
|
|
2697
2942
|
try {
|
|
2698
2943
|
for (g.s(); !(d = g.n()).done; ) {
|
|
2699
2944
|
"macd" === d.value.key && b++;
|
|
@@ -2704,36 +2949,36 @@ var OHLCV_INDICATORS;
|
|
|
2704
2949
|
} finally {
|
|
2705
2950
|
g.f();
|
|
2706
2951
|
}
|
|
2707
|
-
var w = b > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd",
|
|
2952
|
+
var w = b > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", O = a === Ue ? "".concat(w, "_diff") : "".concat(w, "_diff_").concat(a), S = a === Ue ? "".concat(w, "_dea") : "".concat(w, "_dea_").concat(a), j = a === Ue ? "".concat(w, "_histogram") : "".concat(w, "_histogram_").concat(a);
|
|
2708
2953
|
// Build the keys.
|
|
2709
|
-
|
|
2710
|
-
fast:
|
|
2711
|
-
slow:
|
|
2954
|
+
p.push({
|
|
2955
|
+
fast: O,
|
|
2956
|
+
slow: S,
|
|
2712
2957
|
isDefault: !0
|
|
2713
2958
|
}), s.hasOwnProperty("macd") || (s.macd = {
|
|
2714
2959
|
numberOfIndicators: b,
|
|
2715
2960
|
settings: {}
|
|
2716
|
-
}), s.macd.settings[f] = new
|
|
2717
|
-
|
|
2961
|
+
}), s.macd.settings[f] = new we(new pe(r), new pe(n), new pe(o)), Object.assign(c, Be(Be(Be({}, O, new Float64Array(v).fill(NaN)), S, new Float64Array(v).fill(NaN)), j, new Float64Array(v).fill(NaN)))[j].forEach((function(t) {
|
|
2962
|
+
h.add(t);
|
|
2718
2963
|
}));
|
|
2719
|
-
var P = [
|
|
2964
|
+
var P = [ O, S, j ];
|
|
2720
2965
|
u > 0 && t.lag(P, u);
|
|
2721
2966
|
for (var _ = 0, N = P; _ < N.length; _++) {
|
|
2722
2967
|
m[N[_]] = "Float64Array";
|
|
2723
2968
|
}
|
|
2724
2969
|
}
|
|
2725
|
-
var
|
|
2726
|
-
|
|
2970
|
+
var T = s.macd, A = T.numberOfIndicators, E = T.settings, k = A > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", x = a === Ue ? "".concat(k, "_diff") : "".concat(k, "_diff_").concat(a), I = a === Ue ? "".concat(k, "_dea") : "".concat(k, "_dea_").concat(a), D = a === Ue ? "".concat(k, "_histogram") : "".concat(k, "_histogram_").concat(a), M = E[f], R = c[a][e];
|
|
2971
|
+
M.update(R);
|
|
2727
2972
|
var C = {};
|
|
2728
2973
|
try {
|
|
2729
|
-
C =
|
|
2974
|
+
C = M.getResult();
|
|
2730
2975
|
} catch (t) {
|
|
2731
2976
|
// If the result is unavailable, macdResult remains NaN.
|
|
2732
2977
|
}
|
|
2733
2978
|
// Always push values; use NaN as fallback when macdResult is missing.
|
|
2734
2979
|
return t.pushToMain({
|
|
2735
2980
|
index: e,
|
|
2736
|
-
key:
|
|
2981
|
+
key: x,
|
|
2737
2982
|
value: C ? C.macd : NaN
|
|
2738
2983
|
}), t.pushToMain({
|
|
2739
2984
|
index: e,
|
|
@@ -2741,7 +2986,7 @@ var OHLCV_INDICATORS;
|
|
|
2741
2986
|
value: C ? C.signal : NaN
|
|
2742
2987
|
}), t.pushToMain({
|
|
2743
2988
|
index: e,
|
|
2744
|
-
key:
|
|
2989
|
+
key: D,
|
|
2745
2990
|
value: C ? C.histogram : NaN
|
|
2746
2991
|
}), !0;
|
|
2747
2992
|
},
|
|
@@ -2750,26 +2995,26 @@ var OHLCV_INDICATORS;
|
|
|
2750
2995
|
if (0 === e) {
|
|
2751
2996
|
var l = t.len, c = t.arrayTypes;
|
|
2752
2997
|
a[i] = {
|
|
2753
|
-
instance: new
|
|
2998
|
+
instance: new ft(r),
|
|
2754
2999
|
prevRelativeVolumeSma: NaN
|
|
2755
3000
|
}, u[i] = new Float64Array(l).fill(NaN), o > 0 && t.lag([ i ], o), c[i] = "Float64Array";
|
|
2756
3001
|
}
|
|
2757
3002
|
var s = u.volume[e], f = a[i].instance;
|
|
2758
3003
|
f.update(s);
|
|
2759
|
-
var
|
|
3004
|
+
var y = NaN;
|
|
2760
3005
|
try {
|
|
2761
|
-
|
|
3006
|
+
y = f.getResult();
|
|
2762
3007
|
} catch (t) {}
|
|
2763
|
-
var
|
|
3008
|
+
var p = a[i].prevRelativeVolumeSma, h = NaN;
|
|
2764
3009
|
// Only calculate relative volume if both current SMA and previous SMA are valid numbers and prevSma is not zero.
|
|
2765
|
-
return Number.isNaN(
|
|
3010
|
+
return Number.isNaN(y) || Number.isNaN(p) || (h = s / p), t.pushToMain({
|
|
2766
3011
|
index: e,
|
|
2767
3012
|
key: i,
|
|
2768
|
-
value:
|
|
2769
|
-
}), a[i].prevRelativeVolumeSma =
|
|
3013
|
+
value: h
|
|
3014
|
+
}), a[i].prevRelativeVolumeSma = y, !0;
|
|
2770
3015
|
},
|
|
2771
3016
|
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,
|
|
3017
|
+
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, p = o.range, h = o.decimals, v = "".concat(r, "_").concat(n);
|
|
2773
3018
|
// ---- INIT (only at first bar) ----
|
|
2774
3019
|
if (0 === e) {
|
|
2775
3020
|
// how many donchianChannels calls in this session?
|
|
@@ -2778,11 +3023,11 @@ var OHLCV_INDICATORS;
|
|
|
2778
3023
|
})).length, d = "donchian_channel", b = m > 1 ? "".concat(d, "_").concat(v) : d, g = [ "upper", "basis", "lower" ].map((function(t) {
|
|
2779
3024
|
return "".concat(b, "_").concat(t);
|
|
2780
3025
|
}));
|
|
2781
|
-
|
|
2782
|
-
var w,
|
|
3026
|
+
y && g.push("".concat(b, "_height"));
|
|
3027
|
+
var w, O = function(t, e) {
|
|
2783
3028
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2784
3029
|
if (!r) {
|
|
2785
|
-
if (Array.isArray(t) || (r =
|
|
3030
|
+
if (Array.isArray(t) || (r = Ye(t)) || e && t && "number" == typeof t.length) {
|
|
2786
3031
|
r && (t = r);
|
|
2787
3032
|
var n = 0, o = function() {};
|
|
2788
3033
|
return {
|
|
@@ -2823,18 +3068,18 @@ var OHLCV_INDICATORS;
|
|
|
2823
3068
|
}
|
|
2824
3069
|
}
|
|
2825
3070
|
};
|
|
2826
|
-
}(
|
|
3071
|
+
}(p);
|
|
2827
3072
|
try {
|
|
2828
|
-
for (
|
|
2829
|
-
var
|
|
2830
|
-
if (!(
|
|
2831
|
-
g.push("".concat(b, "_range_").concat(
|
|
3073
|
+
for (O.s(); !(w = O.n()).done; ) {
|
|
3074
|
+
var S = w.value;
|
|
3075
|
+
if (!(S in i) || !c.has(S)) throw new Error('Invalid range key "'.concat(S, '". Only price-based keys are allowed: ').concat(Ke(c)));
|
|
3076
|
+
g.push("".concat(b, "_range_").concat(S));
|
|
2832
3077
|
}
|
|
2833
3078
|
// bootstrap instance
|
|
2834
3079
|
} catch (t) {
|
|
2835
|
-
|
|
3080
|
+
O.e(t);
|
|
2836
3081
|
} finally {
|
|
2837
|
-
|
|
3082
|
+
O.f();
|
|
2838
3083
|
}
|
|
2839
3084
|
a.donchian_channel || (a.donchian_channel = {
|
|
2840
3085
|
numberOfIndicators: m,
|
|
@@ -2857,34 +3102,34 @@ var OHLCV_INDICATORS;
|
|
|
2857
3102
|
}));
|
|
2858
3103
|
}
|
|
2859
3104
|
// ---- PER-BAR COMPUTATION ----
|
|
2860
|
-
var j = a.donchian_channel, P = j.numberOfIndicators, _ = j.settings, N = P > 1 ? "donchian_channel_".concat(v) : "donchian_channel",
|
|
3105
|
+
var j = a.donchian_channel, P = j.numberOfIndicators, _ = j.settings, N = P > 1 ? "donchian_channel_".concat(v) : "donchian_channel", T = _[v], A = T.maxDeque, E = T.minDeque, k = e - n, x = k - r + 1, I = [ "upper", "basis", "lower" ].map((function(t) {
|
|
2861
3106
|
return "".concat(N, "_").concat(t);
|
|
2862
3107
|
}));
|
|
2863
|
-
|
|
2864
|
-
var
|
|
3108
|
+
y && I.push("".concat(N, "_height"));
|
|
3109
|
+
var D = p.map((function(t) {
|
|
2865
3110
|
return "".concat(N, "_range_").concat(t);
|
|
2866
3111
|
}));
|
|
2867
3112
|
// not enough data → push NaNs
|
|
2868
|
-
if (
|
|
3113
|
+
if (x < 0 || k + 1 > u) return [].concat(Ke(I), Ke(D)).forEach((function(r) {
|
|
2869
3114
|
return t.pushToMain({
|
|
2870
3115
|
index: e,
|
|
2871
3116
|
key: r,
|
|
2872
3117
|
value: NaN
|
|
2873
3118
|
});
|
|
2874
3119
|
})), !0;
|
|
2875
|
-
var
|
|
2876
|
-
for (;t.length && t[0] <
|
|
2877
|
-
for (;t.length && r(e[t.at(-1)], e[
|
|
2878
|
-
t.push(
|
|
3120
|
+
var M = i.high, R = i.low, C = function(t, e, r) {
|
|
3121
|
+
for (;t.length && t[0] < x; ) t.shift();
|
|
3122
|
+
for (;t.length && r(e[t.at(-1)], e[k]); ) t.pop();
|
|
3123
|
+
t.push(k);
|
|
2879
3124
|
};
|
|
2880
3125
|
// tiny helper to keep deques up-to-date
|
|
2881
|
-
C(
|
|
3126
|
+
C(A, M, (function(t, e) {
|
|
2882
3127
|
return t <= e;
|
|
2883
3128
|
})), C(E, R, (function(t, e) {
|
|
2884
3129
|
return t >= e;
|
|
2885
3130
|
}));
|
|
2886
3131
|
// single “bounds exist?” flag instead of repeated isNaN
|
|
2887
|
-
var F =
|
|
3132
|
+
var F = A.length && E.length, L = F ? M[A[0]] : NaN, B = F ? R[E[0]] : NaN, H = F ? (L + B) / 2 : NaN;
|
|
2888
3133
|
if (t.pushToMain({
|
|
2889
3134
|
index: e,
|
|
2890
3135
|
key: "".concat(N, "_upper"),
|
|
@@ -2897,89 +3142,89 @@ var OHLCV_INDICATORS;
|
|
|
2897
3142
|
index: e,
|
|
2898
3143
|
key: "".concat(N, "_lower"),
|
|
2899
3144
|
value: B
|
|
2900
|
-
}),
|
|
3145
|
+
}), y) {
|
|
2901
3146
|
// avoid divide-by-zero
|
|
2902
3147
|
var V = F && B ? (L - B) / B : NaN;
|
|
2903
3148
|
t.pushToMain({
|
|
2904
3149
|
index: e,
|
|
2905
3150
|
key: "".concat(N, "_height"),
|
|
2906
|
-
value: null ===
|
|
3151
|
+
value: null === h ? V : Ge(V, h)
|
|
2907
3152
|
});
|
|
2908
3153
|
}
|
|
2909
3154
|
// precompute spread once
|
|
2910
3155
|
// for each extra range key, use price===price to skip NaNs
|
|
2911
|
-
for (var U = F ? L - B : NaN, $ = 0; $ <
|
|
2912
|
-
var q = i[
|
|
3156
|
+
for (var U = F ? L - B : NaN, $ = 0; $ < p.length; $++) {
|
|
3157
|
+
var q = i[p[$]][e], z = F && q == q && U ? (q - B) / U : NaN;
|
|
2913
3158
|
t.pushToMain({
|
|
2914
3159
|
index: e,
|
|
2915
|
-
key:
|
|
2916
|
-
value: null ===
|
|
3160
|
+
key: D[$],
|
|
3161
|
+
value: null === h ? z : Ge(z, h)
|
|
2917
3162
|
});
|
|
2918
3163
|
}
|
|
2919
3164
|
return !0;
|
|
2920
3165
|
},
|
|
2921
3166
|
bollingerBands: function(t, e, r, n, o) {
|
|
2922
|
-
var i, a, u, l, c, s, f,
|
|
3167
|
+
var i, a, u, l, c, s, f, y = o.height, p = o.range, h = void 0 === p ? [] : p, v = o.target, m = o.lag, d = o.decimals, b = t.verticalOhlcv, g = t.instances, w = "close" === v ? "" : "_".concat(v), O = "".concat(r, "_").concat(n).concat(w);
|
|
2923
3168
|
// Initialization on the first call.
|
|
2924
3169
|
if (0 === e) {
|
|
2925
|
-
var
|
|
3170
|
+
var S = t.priceBased, j = t.inputParams, P = t.verticalOhlcv, _ = t.len, N = t.arrayTypes;
|
|
2926
3171
|
if (!(v in P)) throw new Error('bollingerBands could not find target "'.concat(v, '"'));
|
|
2927
|
-
var
|
|
3172
|
+
var T, A = 0, E = Xe(j);
|
|
2928
3173
|
try {
|
|
2929
|
-
for (E.s(); !(
|
|
2930
|
-
"bollingerBands" ===
|
|
3174
|
+
for (E.s(); !(T = E.n()).done; ) {
|
|
3175
|
+
"bollingerBands" === T.value.key && A++;
|
|
2931
3176
|
}
|
|
2932
3177
|
} catch (t) {
|
|
2933
3178
|
E.e(t);
|
|
2934
3179
|
} finally {
|
|
2935
3180
|
E.f();
|
|
2936
3181
|
}
|
|
2937
|
-
f =
|
|
3182
|
+
f = A > 1 ? "bollinger_bands_".concat(O) : "bollinger_bands".concat(w),
|
|
2938
3183
|
// Only create the container if it doesn't already exist.
|
|
2939
3184
|
g.bollinger_bands || (g.bollinger_bands = {
|
|
2940
|
-
numberOfIndicators:
|
|
3185
|
+
numberOfIndicators: A,
|
|
2941
3186
|
settings: {}
|
|
2942
3187
|
}),
|
|
2943
3188
|
// Add (or override) the indicator instance keyed by indicatorKey.
|
|
2944
|
-
g.bollinger_bands.settings[
|
|
2945
|
-
var
|
|
2946
|
-
|
|
3189
|
+
g.bollinger_bands.settings[O] = new ee(r, n);
|
|
3190
|
+
var k = [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ];
|
|
3191
|
+
y && k.push("".concat(f, "_height"));
|
|
2947
3192
|
// Set up additional arrays for each range property.
|
|
2948
|
-
var
|
|
3193
|
+
var x, I = Xe(h);
|
|
2949
3194
|
try {
|
|
2950
|
-
for (I.s(); !(
|
|
2951
|
-
var
|
|
2952
|
-
if (!(
|
|
2953
|
-
|
|
3195
|
+
for (I.s(); !(x = I.n()).done; ) {
|
|
3196
|
+
var D = x.value;
|
|
3197
|
+
if (!(D in P) || !S.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(S)));
|
|
3198
|
+
k.push("".concat(f, "_range_").concat(D));
|
|
2954
3199
|
}
|
|
2955
3200
|
} catch (t) {
|
|
2956
3201
|
I.e(t);
|
|
2957
3202
|
} finally {
|
|
2958
3203
|
I.f();
|
|
2959
3204
|
}
|
|
2960
|
-
var
|
|
3205
|
+
var M = Object.fromEntries(k.map((function(t) {
|
|
2961
3206
|
return [ t, new Float64Array(_).fill(NaN) ];
|
|
2962
3207
|
})));
|
|
2963
3208
|
Object.assign(P, function(t) {
|
|
2964
3209
|
for (var e = 1; e < arguments.length; e++) {
|
|
2965
3210
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2966
|
-
e % 2 ?
|
|
2967
|
-
|
|
2968
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
3211
|
+
e % 2 ? Qe(Object(r), !0).forEach((function(e) {
|
|
3212
|
+
We(t, e, r[e]);
|
|
3213
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Qe(Object(r)).forEach((function(e) {
|
|
2969
3214
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2970
3215
|
}));
|
|
2971
3216
|
}
|
|
2972
3217
|
return t;
|
|
2973
|
-
}({},
|
|
2974
|
-
|
|
3218
|
+
}({}, M)), m > 0 && t.lag(k, m), [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ].forEach((function(t) {
|
|
3219
|
+
S.add(t);
|
|
2975
3220
|
}));
|
|
2976
|
-
for (var R = 0, C =
|
|
3221
|
+
for (var R = 0, C = k; R < C.length; R++) {
|
|
2977
3222
|
N[C[R]] = "Float64Array";
|
|
2978
3223
|
}
|
|
2979
3224
|
}
|
|
2980
3225
|
// Derive prefix for subsequent calls if not set.
|
|
2981
|
-
f || (f = g.bollinger_bands.numberOfIndicators > 1 ? "bollinger_bands_".concat(
|
|
2982
|
-
var F = f, L = g.bollinger_bands.settings[
|
|
3226
|
+
f || (f = g.bollinger_bands.numberOfIndicators > 1 ? "bollinger_bands_".concat(O) : "bollinger_bands".concat(w));
|
|
3227
|
+
var F = f, L = g.bollinger_bands.settings[O], B = b[v][e];
|
|
2983
3228
|
// Update the indicator with the current value.
|
|
2984
3229
|
L.update(B);
|
|
2985
3230
|
// Attempt to retrieve the result.
|
|
@@ -3006,16 +3251,16 @@ var OHLCV_INDICATORS;
|
|
|
3006
3251
|
index: e,
|
|
3007
3252
|
key: "".concat(F, "_lower"),
|
|
3008
3253
|
value: $
|
|
3009
|
-
}),
|
|
3254
|
+
}), y) {
|
|
3010
3255
|
var q = NaN;
|
|
3011
3256
|
Number.isNaN($) || Number.isNaN(V) || (q = (V - $) / $), t.pushToMain({
|
|
3012
3257
|
index: e,
|
|
3013
3258
|
key: "".concat(F, "_height"),
|
|
3014
|
-
value: null === d ? q :
|
|
3259
|
+
value: null === d ? q : Ge(q, d)
|
|
3015
3260
|
});
|
|
3016
3261
|
}
|
|
3017
3262
|
// Process each range property.
|
|
3018
|
-
var z, G =
|
|
3263
|
+
var z, G = Xe(h);
|
|
3019
3264
|
try {
|
|
3020
3265
|
for (G.s(); !(z = G.n()).done; ) {
|
|
3021
3266
|
var K = z.value, Y = NaN, J = b[K][e];
|
|
@@ -3023,7 +3268,7 @@ var OHLCV_INDICATORS;
|
|
|
3023
3268
|
t.pushToMain({
|
|
3024
3269
|
index: e,
|
|
3025
3270
|
key: "".concat(F, "_range_").concat(K),
|
|
3026
|
-
value: null === d ? Y :
|
|
3271
|
+
value: null === d ? Y : Ge(Y, d)
|
|
3027
3272
|
});
|
|
3028
3273
|
}
|
|
3029
3274
|
} catch (t) {
|
|
@@ -3036,21 +3281,21 @@ var OHLCV_INDICATORS;
|
|
|
3036
3281
|
volumeOscillator: function(t, e, r, n, o) {
|
|
3037
3282
|
var i = o.lag, a = t.verticalOhlcv, u = t.instances, l = a.volume[e], c = "volume_oscillator_".concat(r, "_").concat(n);
|
|
3038
3283
|
if (0 === e) {
|
|
3039
|
-
var s = t.crossPairsList, f = t.len,
|
|
3040
|
-
Object.assign(u,
|
|
3041
|
-
fastEMA: new
|
|
3042
|
-
slowEMA: new
|
|
3284
|
+
var s = t.crossPairsList, f = t.len, y = t.arrayTypes;
|
|
3285
|
+
Object.assign(u, rr({}, c, {
|
|
3286
|
+
fastEMA: new pe(r),
|
|
3287
|
+
slowEMA: new pe(n)
|
|
3043
3288
|
})), a[c] = new Float64Array(f).fill(NaN), s.push({
|
|
3044
3289
|
fast: c,
|
|
3045
3290
|
slow: 0,
|
|
3046
3291
|
isDefault: !0
|
|
3047
|
-
}), i > 0 && t.lag([ c ], i),
|
|
3292
|
+
}), i > 0 && t.lag([ c ], i), y[c] = "Float64Array";
|
|
3048
3293
|
}
|
|
3049
|
-
var
|
|
3050
|
-
|
|
3294
|
+
var p = u[c], h = p.fastEMA, v = p.slowEMA;
|
|
3295
|
+
h.update(l), v.update(l);
|
|
3051
3296
|
var m = NaN, d = NaN;
|
|
3052
3297
|
try {
|
|
3053
|
-
m =
|
|
3298
|
+
m = h.getResult();
|
|
3054
3299
|
} catch (t) {}
|
|
3055
3300
|
try {
|
|
3056
3301
|
d = v.getResult();
|
|
@@ -3063,21 +3308,21 @@ var OHLCV_INDICATORS;
|
|
|
3063
3308
|
}), !0;
|
|
3064
3309
|
},
|
|
3065
3310
|
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,
|
|
3311
|
+
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, p = t.verticalOhlcv, h = t.instances, v = t.arrayTypes, m = "".concat(i, "_").concat(r);
|
|
3067
3312
|
if (0 === e) {
|
|
3068
3313
|
var d = t.len;
|
|
3069
|
-
|
|
3314
|
+
h.hasOwnProperty("scaler") || (h.scaler = {
|
|
3070
3315
|
windows: {}
|
|
3071
3316
|
});
|
|
3072
|
-
var b, g =
|
|
3317
|
+
var b, g = kr(n);
|
|
3073
3318
|
try {
|
|
3074
3319
|
var w = function() {
|
|
3075
3320
|
var e = b.value;
|
|
3076
|
-
if (!
|
|
3321
|
+
if (!p.hasOwnProperty(e)) throw new Error('Target property "'.concat(e, '" not found in verticalOhlcv'));
|
|
3077
3322
|
var r = "".concat(m, "_").concat(e);
|
|
3078
|
-
|
|
3323
|
+
p[r] = new Float64Array(d).fill(NaN), v[r] = "Float64Array";
|
|
3079
3324
|
var n = a ? f : e;
|
|
3080
|
-
if (
|
|
3325
|
+
if (h.scaler.windows[n] = [], a && (t.scaledGroups[f] || (t.scaledGroups[f] = []),
|
|
3081
3326
|
t.scaledGroups[f].push(r)), l > 0) {
|
|
3082
3327
|
if (a) {
|
|
3083
3328
|
var o, i = Array.from({
|
|
@@ -3085,7 +3330,7 @@ var OHLCV_INDICATORS;
|
|
|
3085
3330
|
}).map((function(t, e) {
|
|
3086
3331
|
return "".concat(r, "_lag_").concat(e + 1);
|
|
3087
3332
|
}));
|
|
3088
|
-
(o = t.scaledGroups[f]).push.apply(o,
|
|
3333
|
+
(o = t.scaledGroups[f]).push.apply(o, Er(i));
|
|
3089
3334
|
}
|
|
3090
3335
|
t.lag([ r ], l);
|
|
3091
3336
|
}
|
|
@@ -3097,28 +3342,28 @@ var OHLCV_INDICATORS;
|
|
|
3097
3342
|
g.f();
|
|
3098
3343
|
}
|
|
3099
3344
|
}
|
|
3100
|
-
var
|
|
3345
|
+
var O, S = h.scaler.windows, j = kr(n);
|
|
3101
3346
|
// update windows with current values
|
|
3102
3347
|
try {
|
|
3103
|
-
for (j.s(); !(
|
|
3104
|
-
var P =
|
|
3105
|
-
N.push(_), N.length > (a ? r *
|
|
3348
|
+
for (j.s(); !(O = j.n()).done; ) {
|
|
3349
|
+
var P = O.value, _ = p[P][e], N = S[a ? f : P];
|
|
3350
|
+
N.push(_), N.length > (a ? r * y : r) && N.shift();
|
|
3106
3351
|
}
|
|
3107
3352
|
} catch (t) {
|
|
3108
3353
|
j.e(t);
|
|
3109
3354
|
} finally {
|
|
3110
3355
|
j.f();
|
|
3111
3356
|
}
|
|
3112
|
-
var
|
|
3357
|
+
var T, A = e + 1 >= r, E = kr(n);
|
|
3113
3358
|
// scale values once enough data
|
|
3114
3359
|
try {
|
|
3115
|
-
var
|
|
3116
|
-
var r, n, o, l, c,
|
|
3117
|
-
if (
|
|
3118
|
-
var g =
|
|
3360
|
+
var k = function() {
|
|
3361
|
+
var r, n, o, l, c, y, h = T.value, v = p[h][e], d = "".concat(m, "_").concat(h), b = null;
|
|
3362
|
+
if (A) {
|
|
3363
|
+
var g = S[a ? f : h];
|
|
3119
3364
|
if ("minmax" === i) {
|
|
3120
|
-
var w = Math.min.apply(Math,
|
|
3121
|
-
r = v, n = w, o =
|
|
3365
|
+
var w = Math.min.apply(Math, Er(g)), O = Math.max.apply(Math, Er(g));
|
|
3366
|
+
r = v, n = w, o = O, l = xr(u, 2), c = l[0], y = l[1], b = (Math.min(Math.max(r, n), o) - n) / (o - n) * (y - c) + c;
|
|
3122
3367
|
} else {
|
|
3123
3368
|
if ("zscore" !== i) throw new Error('Unknown scaler type "'.concat(i, '"'));
|
|
3124
3369
|
var j = g.reduce((function(t, e) {
|
|
@@ -3134,53 +3379,53 @@ var OHLCV_INDICATORS;
|
|
|
3134
3379
|
t.pushToMain({
|
|
3135
3380
|
index: e,
|
|
3136
3381
|
key: d,
|
|
3137
|
-
value: null === s ? b :
|
|
3382
|
+
value: null === s ? b : Ge(b, s)
|
|
3138
3383
|
});
|
|
3139
3384
|
};
|
|
3140
|
-
for (E.s(); !(
|
|
3385
|
+
for (E.s(); !(T = E.n()).done; ) k();
|
|
3141
3386
|
} catch (t) {
|
|
3142
3387
|
E.e(t);
|
|
3143
3388
|
} finally {
|
|
3144
3389
|
E.f();
|
|
3145
3390
|
}
|
|
3146
3391
|
}
|
|
3147
|
-
},
|
|
3148
|
-
for (var r = t.length, n = new
|
|
3392
|
+
}, Hr = function(t, e) {
|
|
3393
|
+
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
3394
|
n.isStable) {
|
|
3150
3395
|
var c = n.getResult();
|
|
3151
3396
|
o[l] = c, i += c, a += c * c, u++;
|
|
3152
3397
|
} else o[l] = null;
|
|
3153
|
-
var s = i / u, f = a / u - s * s,
|
|
3398
|
+
var s = i / u, f = a / u - s * s, y = Math.sqrt(f);
|
|
3154
3399
|
return o.map((function(t) {
|
|
3155
|
-
return null !== t ? (t - s) /
|
|
3400
|
+
return null !== t ? (t - s) / y : null;
|
|
3156
3401
|
}));
|
|
3157
|
-
},
|
|
3402
|
+
}, Vr = function(t, e) {
|
|
3158
3403
|
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5;
|
|
3159
3404
|
if (t.length !== e.length) throw new Error("Both arrays must have the same length");
|
|
3160
|
-
for (var n =
|
|
3161
|
-
if (null !== n[
|
|
3162
|
-
|
|
3405
|
+
for (var n = Hr(t, r), o = Hr(e, r), i = t.length, a = [], u = 0, l = 0, c = 0, s = 0, f = 0, y = 0, p = -1, h = 0; h < i; h++) {
|
|
3406
|
+
if (null !== n[h] && null !== o[h]) {
|
|
3407
|
+
p = h;
|
|
3163
3408
|
break;
|
|
3164
3409
|
}
|
|
3165
3410
|
a.push(0);
|
|
3166
3411
|
}
|
|
3167
|
-
if (-1 ===
|
|
3412
|
+
if (-1 === p)
|
|
3168
3413
|
// No valid data points
|
|
3169
3414
|
return new Array(i).fill(0);
|
|
3170
|
-
for (var v =
|
|
3415
|
+
for (var v = p; v < i; v++) {
|
|
3171
3416
|
var m = n[v], d = o[v];
|
|
3172
3417
|
if (null !== m && null !== d) if (u += m, l += d, c += m * d, s += m * m, f += d * d,
|
|
3173
|
-
++
|
|
3174
|
-
var b =
|
|
3418
|
+
++y < 2) a.push(0); else {
|
|
3419
|
+
var b = y * c - u * l, g = Math.sqrt((y * s - u * u) * (y * f - l * l)), w = 0 === g ? 0 : b / g;
|
|
3175
3420
|
a.push(w);
|
|
3176
3421
|
} else
|
|
3177
3422
|
// Reset sums and counts when encountering null values
|
|
3178
|
-
u = l = c = s = f =
|
|
3423
|
+
u = l = c = s = f = y = 0, a.push(0);
|
|
3179
3424
|
}
|
|
3180
3425
|
return a;
|
|
3181
3426
|
};
|
|
3182
3427
|
// ./src/utilities/verticalToHorizontal.js
|
|
3183
|
-
function
|
|
3428
|
+
function Ur(t, e) {
|
|
3184
3429
|
return function(t) {
|
|
3185
3430
|
if (Array.isArray(t)) return t;
|
|
3186
3431
|
}(t) || function(t, e) {
|
|
@@ -3205,33 +3450,33 @@ var OHLCV_INDICATORS;
|
|
|
3205
3450
|
}
|
|
3206
3451
|
}(t, e) || function(t, e) {
|
|
3207
3452
|
if (t) {
|
|
3208
|
-
if ("string" == typeof t) return
|
|
3453
|
+
if ("string" == typeof t) return $r(t, e);
|
|
3209
3454
|
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) ?
|
|
3455
|
+
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) ? $r(t, e) : void 0;
|
|
3211
3456
|
}
|
|
3212
3457
|
}(t, e) || function() {
|
|
3213
3458
|
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
3459
|
}();
|
|
3215
3460
|
}
|
|
3216
|
-
function
|
|
3461
|
+
function $r(t, e) {
|
|
3217
3462
|
(null == e || e > t.length) && (e = t.length);
|
|
3218
3463
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3219
3464
|
return n;
|
|
3220
3465
|
}
|
|
3221
|
-
var
|
|
3222
|
-
var t =
|
|
3223
|
-
if (0 ===
|
|
3224
|
-
for (var
|
|
3225
|
-
length:
|
|
3466
|
+
var qr = function(t) {
|
|
3467
|
+
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, p = e.verticalOhlcvKeyNames, h = e.verticalOhlcvTempCols;
|
|
3468
|
+
if (0 === p.length) return [];
|
|
3469
|
+
for (var v = n && f >= 0 ? f + 1 : 0, m = Math.max(v, i), d = y - m, b = Array.from({
|
|
3470
|
+
length: d
|
|
3226
3471
|
}, (function() {
|
|
3227
3472
|
return {};
|
|
3228
|
-
})),
|
|
3229
|
-
var
|
|
3230
|
-
if (!
|
|
3473
|
+
})), g = 0, w = Object.entries(s); g < w.length; g++) {
|
|
3474
|
+
var O = Ur(w[g], 2), S = O[0], j = O[1];
|
|
3475
|
+
if (!h.has(S)) for (var P = l.has(S) && c, _ = m; _ < y; _++) b[_ - m][S] = P ? j[_] / u : "date" === S ? or[a](j[_]) : j[_];
|
|
3231
3476
|
}
|
|
3232
|
-
return
|
|
3477
|
+
return b;
|
|
3233
3478
|
};
|
|
3234
|
-
function
|
|
3479
|
+
function zr(t, e) {
|
|
3235
3480
|
return function(t) {
|
|
3236
3481
|
if (Array.isArray(t)) return t;
|
|
3237
3482
|
}(t) || function(t, e) {
|
|
@@ -3254,30 +3499,30 @@ var OHLCV_INDICATORS;
|
|
|
3254
3499
|
}
|
|
3255
3500
|
return u;
|
|
3256
3501
|
}
|
|
3257
|
-
}(t, e) ||
|
|
3502
|
+
}(t, e) || Gr(t, e) || function() {
|
|
3258
3503
|
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
3504
|
}();
|
|
3260
3505
|
}
|
|
3261
|
-
function
|
|
3506
|
+
function Gr(t, e) {
|
|
3262
3507
|
if (t) {
|
|
3263
|
-
if ("string" == typeof t) return
|
|
3508
|
+
if ("string" == typeof t) return Kr(t, e);
|
|
3264
3509
|
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) ?
|
|
3510
|
+
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) ? Kr(t, e) : void 0;
|
|
3266
3511
|
}
|
|
3267
3512
|
}
|
|
3268
|
-
function
|
|
3513
|
+
function Kr(t, e) {
|
|
3269
3514
|
(null == e || e > t.length) && (e = t.length);
|
|
3270
3515
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3271
3516
|
return n;
|
|
3272
3517
|
}
|
|
3273
|
-
var
|
|
3518
|
+
var Yr = function(t, e) {
|
|
3274
3519
|
var r = t.precision, n = t.priceBased;
|
|
3275
3520
|
if (!1 === r) return 1;
|
|
3276
3521
|
var o, i = 1, a = // ./src/utilities/precisionMultiplier.js
|
|
3277
3522
|
function(t, e) {
|
|
3278
3523
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
3279
3524
|
if (!r) {
|
|
3280
|
-
if (Array.isArray(t) || (r =
|
|
3525
|
+
if (Array.isArray(t) || (r = Gr(t)) || e && t && "number" == typeof t.length) {
|
|
3281
3526
|
r && (t = r);
|
|
3282
3527
|
var n = 0, o = function() {};
|
|
3283
3528
|
return {
|
|
@@ -3319,17 +3564,17 @@ var OHLCV_INDICATORS;
|
|
|
3319
3564
|
}
|
|
3320
3565
|
};
|
|
3321
3566
|
}(Object.entries(e).filter((function(t) {
|
|
3322
|
-
var e =
|
|
3567
|
+
var e = zr(t, 2), r = e[0];
|
|
3323
3568
|
e[1];
|
|
3324
3569
|
return n.has(r);
|
|
3325
3570
|
})).map((function(t) {
|
|
3326
|
-
var e =
|
|
3571
|
+
var e = zr(t, 2);
|
|
3327
3572
|
e[0];
|
|
3328
3573
|
return e[1];
|
|
3329
3574
|
})));
|
|
3330
3575
|
try {
|
|
3331
3576
|
for (a.s(); !(o = a.n()).done; ) {
|
|
3332
|
-
var u = o.value, l =
|
|
3577
|
+
var u = o.value, l = zr(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
3578
|
f > i && (i = f);
|
|
3334
3579
|
}
|
|
3335
3580
|
} catch (t) {
|
|
@@ -3340,23 +3585,23 @@ var OHLCV_INDICATORS;
|
|
|
3340
3585
|
return i;
|
|
3341
3586
|
};
|
|
3342
3587
|
// ./index.js
|
|
3343
|
-
function
|
|
3344
|
-
return
|
|
3588
|
+
function Jr(t) {
|
|
3589
|
+
return Jr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
3345
3590
|
return typeof t;
|
|
3346
3591
|
} : function(t) {
|
|
3347
3592
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
3348
|
-
},
|
|
3593
|
+
}, Jr(t);
|
|
3349
3594
|
}
|
|
3350
|
-
function
|
|
3595
|
+
function Zr(t) {
|
|
3351
3596
|
return function(t) {
|
|
3352
|
-
if (Array.isArray(t)) return
|
|
3597
|
+
if (Array.isArray(t)) return Xr(t);
|
|
3353
3598
|
}(t) || function(t) {
|
|
3354
3599
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
3355
|
-
}(t) ||
|
|
3600
|
+
}(t) || Wr(t) || function() {
|
|
3356
3601
|
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
3602
|
}();
|
|
3358
3603
|
}
|
|
3359
|
-
function
|
|
3604
|
+
function Qr(t, e) {
|
|
3360
3605
|
return function(t) {
|
|
3361
3606
|
if (Array.isArray(t)) return t;
|
|
3362
3607
|
}(t) || function(t, e) {
|
|
@@ -3379,36 +3624,36 @@ var OHLCV_INDICATORS;
|
|
|
3379
3624
|
}
|
|
3380
3625
|
return u;
|
|
3381
3626
|
}
|
|
3382
|
-
}(t, e) ||
|
|
3627
|
+
}(t, e) || Wr(t, e) || function() {
|
|
3383
3628
|
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
3629
|
}();
|
|
3385
3630
|
}
|
|
3386
|
-
function
|
|
3631
|
+
function Wr(t, e) {
|
|
3387
3632
|
if (t) {
|
|
3388
|
-
if ("string" == typeof t) return
|
|
3633
|
+
if ("string" == typeof t) return Xr(t, e);
|
|
3389
3634
|
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) ?
|
|
3635
|
+
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) ? Xr(t, e) : void 0;
|
|
3391
3636
|
}
|
|
3392
3637
|
}
|
|
3393
|
-
function
|
|
3638
|
+
function Xr(t, e) {
|
|
3394
3639
|
(null == e || e > t.length) && (e = t.length);
|
|
3395
3640
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3396
3641
|
return n;
|
|
3397
3642
|
}
|
|
3398
|
-
function
|
|
3643
|
+
function tn(t, e) {
|
|
3399
3644
|
for (var r = 0; r < e.length; r++) {
|
|
3400
3645
|
var n = e[r];
|
|
3401
3646
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
3402
|
-
Object.defineProperty(t,
|
|
3647
|
+
Object.defineProperty(t, en(n.key), n);
|
|
3403
3648
|
}
|
|
3404
3649
|
}
|
|
3405
|
-
function
|
|
3650
|
+
function en(t) {
|
|
3406
3651
|
var e = function(t, e) {
|
|
3407
|
-
if ("object" !=
|
|
3652
|
+
if ("object" != Jr(t) || !t) return t;
|
|
3408
3653
|
var r = t[Symbol.toPrimitive];
|
|
3409
3654
|
if (void 0 !== r) {
|
|
3410
3655
|
var n = r.call(t, e || "default");
|
|
3411
|
-
if ("object" !=
|
|
3656
|
+
if ("object" != Jr(n)) return n;
|
|
3412
3657
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3413
3658
|
}
|
|
3414
3659
|
return ("string" === e ? String : Number)(t);
|
|
@@ -3422,26 +3667,26 @@ var OHLCV_INDICATORS;
|
|
|
3422
3667
|
* to parallel compute various technical indicators in 1 single loop.
|
|
3423
3668
|
* OHLCV datasets.
|
|
3424
3669
|
*/ (t, "string");
|
|
3425
|
-
return "symbol" ==
|
|
3670
|
+
return "symbol" == Jr(e) ? e : e + "";
|
|
3426
3671
|
}
|
|
3427
|
-
var
|
|
3672
|
+
var rn = function() {
|
|
3428
3673
|
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,
|
|
3674
|
+
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, h = e.chunkProcess, v = void 0 === h ? 2e3 : h;
|
|
3430
3675
|
if (function(t, e) {
|
|
3431
3676
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
3432
3677
|
}(this, t), c(n, "input", null !== i ? "contructor ".concat(i) : "constuctor"),
|
|
3433
3678
|
0 === n.length) throw Error("input OHLCV must not be empty: " + i);
|
|
3434
|
-
|
|
3679
|
+
y(l, "precision", "constructor"), p(v, {
|
|
3435
3680
|
min: 100,
|
|
3436
3681
|
max: 5e4,
|
|
3437
3682
|
allowDecimals: !1
|
|
3438
3683
|
}, "chunkProcess", "constructor"), this.chunkProcess = v, this.firstRow = n[0];
|
|
3439
3684
|
var m = function(t) {
|
|
3440
3685
|
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 =
|
|
3686
|
+
var i = ur(o[n], 2), a = i[0], u = i[1];
|
|
3687
|
+
if ("date" === a) e[a] = ar(u), r[a] = "Array"; else if ("volume" === a) e[a] = ze(u, !0),
|
|
3688
|
+
r[a] = "Int32Array"; else if (cr.has(a)) e[a] = ze(u, !0), r[a] = "Float64Array"; else {
|
|
3689
|
+
var l = ze(u, !1);
|
|
3445
3690
|
e[a] = l, r[a] = "number" === l ? "Float64Array" : "Array";
|
|
3446
3691
|
}
|
|
3447
3692
|
}
|
|
@@ -3455,8 +3700,8 @@ var OHLCV_INDICATORS;
|
|
|
3455
3700
|
this.input = n, this.priceBased = new Set([ "open", "high", "low", "close" ]), this.len = n.length,
|
|
3456
3701
|
this.instances = {}, this.crossPairsList = [], this.verticalOhlcv = {}, this.verticalOhlcvKeyNames = [],
|
|
3457
3702
|
this.verticalOhlcvTempCols = new Set, this.utilities = {
|
|
3458
|
-
correlation:
|
|
3459
|
-
}, this.invalidValueIndex = -1, this.precision = l, this.precisionMultiplier =
|
|
3703
|
+
correlation: Vr
|
|
3704
|
+
}, this.invalidValueIndex = -1, this.precision = l, this.precisionMultiplier = Yr(this, this.firstRow),
|
|
3460
3705
|
this.scaledGroups = {}, this.pushToMain = function(t) {
|
|
3461
3706
|
var e = t.index, n = t.key, o = t.value;
|
|
3462
3707
|
return function(t) {
|
|
@@ -3469,34 +3714,52 @@ var OHLCV_INDICATORS;
|
|
|
3469
3714
|
key: n,
|
|
3470
3715
|
value: o
|
|
3471
3716
|
});
|
|
3472
|
-
}, null !==
|
|
3717
|
+
}, null !== f && (u(f, this.len), this.inputParams = f, this.compute()), this.inputParams = [],
|
|
3473
3718
|
this;
|
|
3474
3719
|
}, e = [ {
|
|
3475
3720
|
key: "getDataAsCols",
|
|
3476
3721
|
value: function() {
|
|
3477
|
-
var t =
|
|
3722
|
+
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3478
3723
|
this.compute();
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3724
|
+
var e = t.skipNull, r = void 0 === e || e, n = t.dateFormat, o = void 0 === n ? "string" : n;
|
|
3725
|
+
f(Object.keys(or), o, "dateFormat", "getDataAsCols"), s(t, "options", "getDataAsCols");
|
|
3726
|
+
for (var i = this.precisionMultiplier, a = this.precision, u = this.invalidValueIndex, l = this.len, c = this.verticalOhlcv, y = this.priceBased, p = this.arrayTypes, h = this.verticalOhlcvTempCols, v = {}, m = r ? u + 1 : 0, d = l - m, b = 0, g = Object.entries(c); b < g.length; b++) {
|
|
3727
|
+
var w = Qr(g[b], 2), O = w[0], S = w[1];
|
|
3728
|
+
if (!h.has(O)) {
|
|
3729
|
+
var j = y.has(O) && a;
|
|
3730
|
+
v[O] = sr(p[O], d);
|
|
3731
|
+
for (var P = m; P < l; P++) v[O][P] = j ? S[P] / i : "date" === O ? or[o](S[P]) : S[P];
|
|
3485
3732
|
}
|
|
3486
3733
|
}
|
|
3487
|
-
return
|
|
3734
|
+
return v;
|
|
3488
3735
|
}
|
|
3489
3736
|
}, {
|
|
3490
3737
|
key: "getData",
|
|
3491
3738
|
value: function() {
|
|
3492
|
-
var t =
|
|
3739
|
+
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3493
3740
|
//getData method returns the last object (row) of the new OHLCV with indicators: {open, high, low, close, rsi_14, bollinger_bands_upper}
|
|
3494
|
-
|
|
3741
|
+
this.compute();
|
|
3742
|
+
var e = t.skipNull, r = void 0 === e || e, n = t.dateFormat, o = void 0 === n ? "string" : n;
|
|
3743
|
+
return f(Object.keys(or), o, "dateFormat", "getData"), s(t, "options", "getData"),
|
|
3744
|
+
qr({
|
|
3745
|
+
main: this,
|
|
3746
|
+
skipNull: r,
|
|
3747
|
+
startIndex: 0,
|
|
3748
|
+
dateFormat: o
|
|
3749
|
+
});
|
|
3495
3750
|
}
|
|
3496
3751
|
}, {
|
|
3497
3752
|
key: "getLastValues",
|
|
3498
3753
|
value: function() {
|
|
3499
|
-
|
|
3754
|
+
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3755
|
+
this.compute();
|
|
3756
|
+
var e = t.dateFormat, r = void 0 === e ? "string" : e;
|
|
3757
|
+
return f(Object.keys(or), r, "dateFormat", "getData"), qr({
|
|
3758
|
+
skipNull: !1,
|
|
3759
|
+
main: this,
|
|
3760
|
+
startIndex: this.len - 1,
|
|
3761
|
+
dateFormat: r
|
|
3762
|
+
})[0];
|
|
3500
3763
|
}
|
|
3501
3764
|
}, {
|
|
3502
3765
|
key: "compute",
|
|
@@ -3511,49 +3774,49 @@ var OHLCV_INDICATORS;
|
|
|
3511
3774
|
this.len > 0 && (function(t, e) {
|
|
3512
3775
|
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
3776
|
u(n, r);
|
|
3514
|
-
for (var
|
|
3515
|
-
var
|
|
3516
|
-
l[
|
|
3777
|
+
for (var y = 0, p = Object.keys(s); y < p.length; y++) {
|
|
3778
|
+
var h = p[y];
|
|
3779
|
+
l[h] = sr(a[h], r);
|
|
3517
3780
|
}
|
|
3518
3781
|
// Process each row in the input
|
|
3519
3782
|
for (var v = 0; v < r; v += f) for (var m = Math.min(v + f, r), d = v; d < m; d++) {
|
|
3520
3783
|
for (var b = t[d], g = 0, w = Object.entries(s); g < w.length; g++) {
|
|
3521
|
-
var
|
|
3522
|
-
if (
|
|
3523
|
-
var _ =
|
|
3524
|
-
i > 1 && o.has(
|
|
3784
|
+
var O = Cr(w[g], 2), S = O[0], j = O[1], P = b[S];
|
|
3785
|
+
if (qe.hasOwnProperty(j)) {
|
|
3786
|
+
var _ = qe[j](P);
|
|
3787
|
+
i > 1 && o.has(S) && (_ *= i), e.pushToMain({
|
|
3525
3788
|
index: d,
|
|
3526
|
-
key:
|
|
3789
|
+
key: S,
|
|
3527
3790
|
value: _
|
|
3528
3791
|
});
|
|
3529
|
-
} else
|
|
3792
|
+
} else ir.hasOwnProperty(j) ? e.pushToMain({
|
|
3530
3793
|
index: d,
|
|
3531
|
-
key:
|
|
3532
|
-
value:
|
|
3794
|
+
key: S,
|
|
3795
|
+
value: ir[j](P)
|
|
3533
3796
|
}) : e.pushToMain({
|
|
3534
3797
|
index: d,
|
|
3535
|
-
key:
|
|
3798
|
+
key: S,
|
|
3536
3799
|
value: P
|
|
3537
3800
|
});
|
|
3538
3801
|
}
|
|
3539
3802
|
// Run all indicator functions except for the ones processed later
|
|
3540
|
-
var N,
|
|
3803
|
+
var N, T = Rr(n);
|
|
3541
3804
|
try {
|
|
3542
|
-
for (
|
|
3543
|
-
var
|
|
3805
|
+
for (T.s(); !(N = T.n()).done; ) {
|
|
3806
|
+
var A = N.value, E = A.key, k = A.params;
|
|
3544
3807
|
"lag" !== E && "crossPairs" !== E &&
|
|
3545
3808
|
// resolve fn on-demand, no per-item object allocation here
|
|
3546
|
-
|
|
3809
|
+
Br[E].apply(Br, [ e, d ].concat(Mr(k)));
|
|
3547
3810
|
}
|
|
3548
3811
|
// Process these indicators separately (ensuring their execution order)
|
|
3549
3812
|
} catch (t) {
|
|
3550
|
-
|
|
3813
|
+
T.e(t);
|
|
3551
3814
|
} finally {
|
|
3552
|
-
|
|
3815
|
+
T.f();
|
|
3553
3816
|
}
|
|
3554
|
-
|
|
3817
|
+
vr(e, d), Pr(e, d), t[d] = null;
|
|
3555
3818
|
}
|
|
3556
|
-
c.push.apply(c,
|
|
3819
|
+
c.push.apply(c, Mr(Object.keys(l)));
|
|
3557
3820
|
}(this.input, this), this.isComputed = !0,
|
|
3558
3821
|
//flushing after mainLoop
|
|
3559
3822
|
this.input = [], this.instances = {}, this.firstRow = [])), this;
|
|
@@ -3562,7 +3825,7 @@ var OHLCV_INDICATORS;
|
|
|
3562
3825
|
key: "crossPairs",
|
|
3563
3826
|
value: function() {
|
|
3564
3827
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], e = "crossPairs";
|
|
3565
|
-
return l(this), c(t, "arr", e), this.crossPairsList = [].concat(
|
|
3828
|
+
return l(this), c(t, "arr", e), this.crossPairsList = [].concat(Zr(this.crossPairsList), Zr(t)),
|
|
3566
3829
|
this.inputParams.push({
|
|
3567
3830
|
key: e,
|
|
3568
3831
|
params: [ this.crossPairsList ]
|
|
@@ -3572,7 +3835,7 @@ var OHLCV_INDICATORS;
|
|
|
3572
3835
|
key: "lag",
|
|
3573
3836
|
value: function() {
|
|
3574
3837
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [ "close" ], e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, r = "lag";
|
|
3575
|
-
l(this), c(t, "colKeys", r),
|
|
3838
|
+
l(this), c(t, "colKeys", r), p(e, {
|
|
3576
3839
|
min: 1,
|
|
3577
3840
|
max: this.len,
|
|
3578
3841
|
allowDecimals: !1
|
|
@@ -3583,7 +3846,7 @@ var OHLCV_INDICATORS;
|
|
|
3583
3846
|
var n, o = function(t, e) {
|
|
3584
3847
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
3585
3848
|
if (!r) {
|
|
3586
|
-
if (Array.isArray(t) || (r =
|
|
3849
|
+
if (Array.isArray(t) || (r = Wr(t)) || e && t && "number" == typeof t.length) {
|
|
3587
3850
|
r && (t = r);
|
|
3588
3851
|
var n = 0, o = function() {};
|
|
3589
3852
|
return {
|
|
@@ -3642,13 +3905,34 @@ var OHLCV_INDICATORS;
|
|
|
3642
3905
|
value: function() {
|
|
3643
3906
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 10, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = "relativeVolume";
|
|
3644
3907
|
if (!this.inputTypes.hasOwnProperty("volume")) throw new Error('If "relativeVolume" is called the input ohlcv must contain valid volume properties.');
|
|
3645
|
-
l(this),
|
|
3908
|
+
l(this), p(t, {
|
|
3646
3909
|
min: 1,
|
|
3647
3910
|
max: this.len,
|
|
3648
3911
|
allowDecimals: !1
|
|
3649
3912
|
}, "size", r), s(e, "options", r);
|
|
3650
3913
|
var n = e.lag, o = void 0 === n ? 0 : n;
|
|
3651
|
-
return
|
|
3914
|
+
return p(o, {
|
|
3915
|
+
min: 0,
|
|
3916
|
+
max: this.len,
|
|
3917
|
+
allowDecimals: !1
|
|
3918
|
+
}, "options.lag", r), this.inputParams.push({
|
|
3919
|
+
key: r,
|
|
3920
|
+
params: [ t, {
|
|
3921
|
+
lag: o
|
|
3922
|
+
} ]
|
|
3923
|
+
}), this;
|
|
3924
|
+
}
|
|
3925
|
+
}, {
|
|
3926
|
+
key: "atr",
|
|
3927
|
+
value: function() {
|
|
3928
|
+
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 14, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = "atr";
|
|
3929
|
+
l(this), p(t, {
|
|
3930
|
+
min: 1,
|
|
3931
|
+
max: this.len,
|
|
3932
|
+
allowDecimals: !1
|
|
3933
|
+
}, "size", r), s(e, "options", r);
|
|
3934
|
+
var n = e.lag, o = void 0 === n ? 0 : n;
|
|
3935
|
+
return p(o, {
|
|
3652
3936
|
min: 0,
|
|
3653
3937
|
max: this.len,
|
|
3654
3938
|
allowDecimals: !1
|
|
@@ -3663,18 +3947,18 @@ var OHLCV_INDICATORS;
|
|
|
3663
3947
|
key: "ema",
|
|
3664
3948
|
value: function() {
|
|
3665
3949
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 5, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = "ema";
|
|
3666
|
-
l(this),
|
|
3950
|
+
l(this), p(t, {
|
|
3667
3951
|
min: 1,
|
|
3668
3952
|
max: this.len,
|
|
3669
3953
|
allowDecimals: !1
|
|
3670
3954
|
}, "size", r), s(e, "options", r);
|
|
3671
3955
|
var n = e.target, o = void 0 === n ? "close" : n, i = e.lag, a = void 0 === i ? 0 : i;
|
|
3672
|
-
|
|
3956
|
+
p(a, {
|
|
3673
3957
|
min: 0,
|
|
3674
3958
|
max: this.len,
|
|
3675
3959
|
allowDecimals: !1
|
|
3676
3960
|
}, "options.lag", r);
|
|
3677
|
-
var u =
|
|
3961
|
+
var u = Fe({
|
|
3678
3962
|
main: this,
|
|
3679
3963
|
size: t,
|
|
3680
3964
|
target: o,
|
|
@@ -3694,18 +3978,18 @@ var OHLCV_INDICATORS;
|
|
|
3694
3978
|
key: "sma",
|
|
3695
3979
|
value: function() {
|
|
3696
3980
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 5, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = "sma";
|
|
3697
|
-
l(this),
|
|
3981
|
+
l(this), p(t, {
|
|
3698
3982
|
min: 1,
|
|
3699
3983
|
max: this.len,
|
|
3700
3984
|
allowDecimals: !1
|
|
3701
3985
|
}, "size", r), s(e, "options", r);
|
|
3702
3986
|
var n = e.target, o = void 0 === n ? "close" : n, i = e.lag, a = void 0 === i ? 0 : i;
|
|
3703
|
-
|
|
3987
|
+
p(a, {
|
|
3704
3988
|
min: 0,
|
|
3705
3989
|
max: this.len,
|
|
3706
3990
|
allowDecimals: !1
|
|
3707
3991
|
}, "options.lag", r);
|
|
3708
|
-
var u =
|
|
3992
|
+
var u = Fe({
|
|
3709
3993
|
main: this,
|
|
3710
3994
|
size: t,
|
|
3711
3995
|
target: o,
|
|
@@ -3725,21 +4009,21 @@ var OHLCV_INDICATORS;
|
|
|
3725
4009
|
key: "macd",
|
|
3726
4010
|
value: function() {
|
|
3727
4011
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 12, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 26, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 9, n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, o = "macd";
|
|
3728
|
-
l(this),
|
|
4012
|
+
l(this), p(t, {
|
|
3729
4013
|
min: 1,
|
|
3730
4014
|
max: this.len,
|
|
3731
4015
|
allowDecimals: !1
|
|
3732
|
-
}, "fast", o),
|
|
4016
|
+
}, "fast", o), p(e, {
|
|
3733
4017
|
min: 1,
|
|
3734
4018
|
max: this.len,
|
|
3735
4019
|
allowDecimals: !1
|
|
3736
|
-
}, "slow", o),
|
|
4020
|
+
}, "slow", o), p(r, {
|
|
3737
4021
|
min: 1,
|
|
3738
4022
|
max: this.len,
|
|
3739
4023
|
allowDecimals: !1
|
|
3740
4024
|
}, "signal", o), s(n, "options", o);
|
|
3741
4025
|
var i = n.target, a = void 0 === i ? "close" : i, u = n.lag, c = void 0 === u ? 0 : u;
|
|
3742
|
-
|
|
4026
|
+
p(c, {
|
|
3743
4027
|
min: 0,
|
|
3744
4028
|
max: this.len,
|
|
3745
4029
|
allowDecimals: !1
|
|
@@ -3760,21 +4044,21 @@ var OHLCV_INDICATORS;
|
|
|
3760
4044
|
key: "bollingerBands",
|
|
3761
4045
|
value: function() {
|
|
3762
4046
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 20, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n = "bollingerBands";
|
|
3763
|
-
l(this),
|
|
4047
|
+
l(this), p(t, {
|
|
3764
4048
|
min: 1,
|
|
3765
4049
|
max: this.len,
|
|
3766
4050
|
allowDecimals: !1
|
|
3767
|
-
}, "size", n),
|
|
4051
|
+
}, "size", n), p(e, {
|
|
3768
4052
|
min: .01,
|
|
3769
4053
|
max: 50,
|
|
3770
4054
|
allowDecimals: !0
|
|
3771
4055
|
}, "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,
|
|
3773
|
-
return c(
|
|
4056
|
+
var o = r.target, i = void 0 === o ? "close" : o, a = r.height, u = void 0 !== a && a, f = r.range, h = void 0 === f ? [] : f, v = r.lag, m = void 0 === v ? 0 : v, d = r.decimals, b = void 0 === d ? null : d;
|
|
4057
|
+
return c(h, "options.range", n), p(m, {
|
|
3774
4058
|
min: 0,
|
|
3775
4059
|
max: this.len,
|
|
3776
4060
|
allowDecimals: !1
|
|
3777
|
-
}, "options.lag", n),
|
|
4061
|
+
}, "options.lag", n), y(u, "options.height", n), null !== b && p(b, {
|
|
3778
4062
|
min: 1,
|
|
3779
4063
|
max: 15,
|
|
3780
4064
|
allowDecimals: !1
|
|
@@ -3783,7 +4067,7 @@ var OHLCV_INDICATORS;
|
|
|
3783
4067
|
params: [ t, e, {
|
|
3784
4068
|
target: i,
|
|
3785
4069
|
height: u,
|
|
3786
|
-
range:
|
|
4070
|
+
range: h,
|
|
3787
4071
|
lag: m,
|
|
3788
4072
|
decimals: b
|
|
3789
4073
|
} ]
|
|
@@ -3793,13 +4077,13 @@ var OHLCV_INDICATORS;
|
|
|
3793
4077
|
key: "rsi",
|
|
3794
4078
|
value: function() {
|
|
3795
4079
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 14, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = "rsi";
|
|
3796
|
-
l(this),
|
|
4080
|
+
l(this), p(t, {
|
|
3797
4081
|
min: 1,
|
|
3798
4082
|
max: this.len,
|
|
3799
4083
|
allowDecimals: !1
|
|
3800
4084
|
}, "size", r), s(e, "options", r);
|
|
3801
4085
|
var n = e.target, o = void 0 === n ? "close" : n, i = e.lag, a = void 0 === i ? 0 : i;
|
|
3802
|
-
return
|
|
4086
|
+
return p(a, {
|
|
3803
4087
|
min: 0,
|
|
3804
4088
|
max: this.len,
|
|
3805
4089
|
allowDecimals: !1
|
|
@@ -3815,21 +4099,21 @@ var OHLCV_INDICATORS;
|
|
|
3815
4099
|
key: "donchianChannels",
|
|
3816
4100
|
value: function() {
|
|
3817
4101
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 20, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n = "donchianChannels";
|
|
3818
|
-
l(this),
|
|
4102
|
+
l(this), p(t, {
|
|
3819
4103
|
min: 1,
|
|
3820
4104
|
max: this.len,
|
|
3821
4105
|
allowDecimals: !1
|
|
3822
|
-
}, "size", n),
|
|
4106
|
+
}, "size", n), p(e, {
|
|
3823
4107
|
min: 0,
|
|
3824
4108
|
max: this.len,
|
|
3825
4109
|
allowDecimals: !1
|
|
3826
4110
|
}, "offset", n), s(r, "options", n);
|
|
3827
|
-
var o = r.height, i = void 0 !== o && o, a = r.range, u = void 0 === a ? [] : a,
|
|
3828
|
-
return c(u, "options.range", n), h
|
|
4111
|
+
var o = r.height, i = void 0 !== o && o, a = r.range, u = void 0 === a ? [] : a, f = r.lag, h = void 0 === f ? 0 : f, v = r.decimals, m = void 0 === v ? null : v;
|
|
4112
|
+
return c(u, "options.range", n), p(h, {
|
|
3829
4113
|
min: 0,
|
|
3830
4114
|
max: this.len,
|
|
3831
4115
|
allowDecimals: !1
|
|
3832
|
-
}, "options.lag", n),
|
|
4116
|
+
}, "options.lag", n), y(i, "options.height", n), null !== m && p(m, {
|
|
3833
4117
|
min: 1,
|
|
3834
4118
|
max: 15,
|
|
3835
4119
|
allowDecimals: !1
|
|
@@ -3838,7 +4122,7 @@ var OHLCV_INDICATORS;
|
|
|
3838
4122
|
params: [ t, e, {
|
|
3839
4123
|
height: i,
|
|
3840
4124
|
range: u,
|
|
3841
|
-
lag:
|
|
4125
|
+
lag: h,
|
|
3842
4126
|
decimals: m
|
|
3843
4127
|
} ]
|
|
3844
4128
|
}), this;
|
|
@@ -3848,17 +4132,17 @@ var OHLCV_INDICATORS;
|
|
|
3848
4132
|
value: function() {
|
|
3849
4133
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 5, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 10, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n = "volumeOscillator";
|
|
3850
4134
|
if (!this.inputTypes.hasOwnProperty("volume")) throw new Error('If "volumeOscillator" is called the input ohlcv must contain valid volume properties.');
|
|
3851
|
-
l(this),
|
|
4135
|
+
l(this), p(t, {
|
|
3852
4136
|
min: 1,
|
|
3853
4137
|
max: this.len,
|
|
3854
4138
|
allowDecimals: !1
|
|
3855
|
-
}, "fastSize", n),
|
|
4139
|
+
}, "fastSize", n), p(e, {
|
|
3856
4140
|
min: t,
|
|
3857
4141
|
max: this.len,
|
|
3858
4142
|
allowDecimals: !1
|
|
3859
4143
|
}, "slowSize", n), s(r, "options", n);
|
|
3860
4144
|
var o = r.lag, i = void 0 === o ? 0 : o;
|
|
3861
|
-
return
|
|
4145
|
+
return p(i, {
|
|
3862
4146
|
min: 0,
|
|
3863
4147
|
max: this.len,
|
|
3864
4148
|
allowDecimals: !1
|
|
@@ -3875,7 +4159,7 @@ var OHLCV_INDICATORS;
|
|
|
3875
4159
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, e = "dateTime";
|
|
3876
4160
|
l(this), s(t, "options", e);
|
|
3877
4161
|
var r = t.lag, n = void 0 === r ? 0 : r;
|
|
3878
|
-
return
|
|
4162
|
+
return p(n, {
|
|
3879
4163
|
min: 0,
|
|
3880
4164
|
max: this.len,
|
|
3881
4165
|
allowDecimals: !1
|
|
@@ -3890,49 +4174,46 @@ var OHLCV_INDICATORS;
|
|
|
3890
4174
|
key: "scaler",
|
|
3891
4175
|
value: function(t) {
|
|
3892
4176
|
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, o = "scaler";
|
|
3893
|
-
l(this),
|
|
4177
|
+
l(this), p(t, {
|
|
3894
4178
|
min: 1,
|
|
3895
4179
|
max: this.len,
|
|
3896
4180
|
allowDecimals: !1
|
|
3897
4181
|
}, "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
|
-
|
|
4182
|
+
var i = n.group, a = void 0 !== i && i, u = n.range, s = void 0 === u ? [ 0, 1 ] : u, h = n.lag, v = void 0 === h ? 0 : h, m = n.type, d = void 0 === m ? "minmax" : m, b = n.decimals, g = void 0 === b ? null : b;
|
|
4183
|
+
y(a, "options.group", o), function(t, e, n) {
|
|
3900
4184
|
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
4185
|
var o = r(t, 2), i = o[0], a = o[1];
|
|
3902
|
-
if (
|
|
4186
|
+
if (p(i, {
|
|
3903
4187
|
min: -100,
|
|
3904
4188
|
max: a,
|
|
3905
4189
|
allowDecimals: !1
|
|
3906
|
-
}, "min", n),
|
|
4190
|
+
}, "min", n), p(a, {
|
|
3907
4191
|
min: i,
|
|
3908
4192
|
max: 100,
|
|
3909
4193
|
allowDecimals: !1
|
|
3910
4194
|
}, "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, {
|
|
4195
|
+
}(s, "options.range", o), f([ "minmax", "zscore" ], d, "options.type", o), null !== g && p(g, {
|
|
3915
4196
|
min: 1,
|
|
3916
4197
|
max: 15,
|
|
3917
4198
|
allowDecimals: !1
|
|
3918
4199
|
}, "decimals", o);
|
|
3919
|
-
var
|
|
3920
|
-
groupKey: a ? "".concat(
|
|
4200
|
+
var w = {
|
|
4201
|
+
groupKey: a ? "".concat(d, "_").concat(t, "_group_").concat(e.join("_")) : "",
|
|
3921
4202
|
groupKeyLen: e.length
|
|
3922
4203
|
};
|
|
3923
4204
|
return this.inputParams.push({
|
|
3924
4205
|
key: o,
|
|
3925
4206
|
params: [ t, e, {
|
|
3926
|
-
type:
|
|
4207
|
+
type: d,
|
|
3927
4208
|
group: a,
|
|
3928
4209
|
range: s,
|
|
3929
|
-
lag:
|
|
3930
|
-
precomputed:
|
|
3931
|
-
decimals:
|
|
4210
|
+
lag: v,
|
|
4211
|
+
precomputed: w,
|
|
4212
|
+
decimals: g
|
|
3932
4213
|
} ]
|
|
3933
4214
|
}), this;
|
|
3934
4215
|
}
|
|
3935
|
-
} ], e &&
|
|
4216
|
+
} ], e && tn(t.prototype, e), n && tn(t, n), Object.defineProperty(t, "prototype", {
|
|
3936
4217
|
writable: !1
|
|
3937
4218
|
}), t;
|
|
3938
4219
|
var t, e, n;
|