ohlcv-indicators 3.4.7 → 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 +778 -529
- package/index.js +18 -0
- package/package.json +1 -1
- package/src/core-functions/mainLoop.js +2 -0
- package/src/moving-averages/movingAverages.js +8 -7
- 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".');
|
|
@@ -169,7 +169,7 @@ var OHLCV_INDICATORS;
|
|
|
169
169
|
}, y = function(t, e, r) {
|
|
170
170
|
if ("boolean" != typeof t) throw new Error('Param "'.concat(e, '" must be an boolean in "').concat(r, '".'));
|
|
171
171
|
return !0;
|
|
172
|
-
},
|
|
172
|
+
}, p = function(t, e, r, n) {
|
|
173
173
|
s(e, "options", "".concat(n, ".").concat(r, ".validateNumber"));
|
|
174
174
|
var o = e.allowDecimals, i = void 0 !== o && o, a = e.min, u = e.max, l = i ? "number" : "integer";
|
|
175
175
|
if ("number" != typeof t || !1 === i && !Number.isInteger(t)) throw new Error('Param "'.concat(r, '" must be an integer in "').concat(n, '".'));
|
|
@@ -179,14 +179,14 @@ var OHLCV_INDICATORS;
|
|
|
179
179
|
return !0;
|
|
180
180
|
}, // 0, 1, 2 or 3
|
|
181
181
|
// The maximum value of DP and Big.DP.
|
|
182
|
-
|
|
182
|
+
h = 1e6, // 0 to 1000000
|
|
183
183
|
// The maximum magnitude of the exponent argument to the pow method.
|
|
184
184
|
v = 1e6, // true or false
|
|
185
185
|
/**************************************************************************************************/
|
|
186
186
|
// Error messages.
|
|
187
187
|
m = "[big.js] ", d = m + "Invalid ", b = d + "decimal places", g = d + "rounding mode", w = m + "Division by zero",
|
|
188
188
|
// The shared prototype object.
|
|
189
|
-
|
|
189
|
+
O = {}, S = void 0, j = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
190
190
|
/*
|
|
191
191
|
* Round Big x to a maximum of sd significant digits using rounding mode rm.
|
|
192
192
|
*
|
|
@@ -197,8 +197,8 @@ var OHLCV_INDICATORS;
|
|
|
197
197
|
*/
|
|
198
198
|
function P(t, e, r, n) {
|
|
199
199
|
var o = t.c;
|
|
200
|
-
if (r ===
|
|
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] !==
|
|
200
|
+
if (r === S && (r = t.constructor.RM), 0 !== r && 1 !== r && 2 !== r && 3 !== r) throw Error(g);
|
|
201
|
+
if (e < 1) n = 3 === r && (n || !!o[0]) || 0 === e && (1 === r && o[0] >= 5 || 2 === r && (o[0] > 5 || 5 === o[0] && (n || o[1] !== S))),
|
|
202
202
|
o.length = 1, n ? (
|
|
203
203
|
// 1, 0.1, 0.01, 0.001, 0.0001 etc.
|
|
204
204
|
t.e = t.e - e + 1, o[0] = 1) :
|
|
@@ -207,7 +207,7 @@ var OHLCV_INDICATORS;
|
|
|
207
207
|
// Round up?
|
|
208
208
|
if (
|
|
209
209
|
// xc[sd] is the digit after the digit that may be rounded up.
|
|
210
|
-
n = 1 === r && o[e] >= 5 || 2 === r && (o[e] > 5 || 5 === o[e] && (n || o[e + 1] !==
|
|
210
|
+
n = 1 === r && o[e] >= 5 || 2 === r && (o[e] > 5 || 5 === o[e] && (n || o[e + 1] !== S || 1 & o[e - 1])) || 3 === r && (n || !!o[0]),
|
|
211
211
|
// Remove any digits after the required precision.
|
|
212
212
|
o.length = e, n)
|
|
213
213
|
// Rounding up may mean the previous digit has to be rounded up.
|
|
@@ -237,7 +237,7 @@ var OHLCV_INDICATORS;
|
|
|
237
237
|
// Prototype/instance methods
|
|
238
238
|
/*
|
|
239
239
|
* Return a new Big whose value is the absolute value of this Big.
|
|
240
|
-
*/
|
|
240
|
+
*/ O.abs = function() {
|
|
241
241
|
var t = new this.constructor(this);
|
|
242
242
|
return t.s = 1, t;
|
|
243
243
|
},
|
|
@@ -246,7 +246,7 @@ var OHLCV_INDICATORS;
|
|
|
246
246
|
* -1 if the value of this Big is less than the value of Big y, or
|
|
247
247
|
* 0 if they have the same value.
|
|
248
248
|
*/
|
|
249
|
-
|
|
249
|
+
O.cmp = function(t) {
|
|
250
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;
|
|
251
251
|
// Either zero?
|
|
252
252
|
if (!n[0] || !o[0]) return n[0] ? i : o[0] ? -a : 0;
|
|
@@ -263,18 +263,18 @@ var OHLCV_INDICATORS;
|
|
|
263
263
|
* Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,
|
|
264
264
|
* if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
|
|
265
265
|
*/
|
|
266
|
-
|
|
266
|
+
O.div = function(t) {
|
|
267
267
|
var e = this, r = e.constructor, n = e.c, // dividend
|
|
268
268
|
o = (t = new r(t)).c, // divisor
|
|
269
269
|
i = e.s == t.s ? 1 : -1, a = r.DP;
|
|
270
|
-
if (a !== ~~a || a < 0 || a >
|
|
270
|
+
if (a !== ~~a || a < 0 || a > h) throw Error(b);
|
|
271
271
|
// Divisor is zero?
|
|
272
272
|
if (!o[0]) throw Error(w);
|
|
273
273
|
// Dividend is 0? Return +-0.
|
|
274
274
|
if (!n[0]) return t.s = i, t.c = [ t.e = 0 ], t;
|
|
275
|
-
var u, l, c, s, f, y = o.slice(),
|
|
275
|
+
var u, l, c, s, f, y = o.slice(), p = u = o.length, v = n.length, m = n.slice(0, u), // remainder
|
|
276
276
|
d = m.length, g = t, // quotient
|
|
277
|
-
|
|
277
|
+
O = g.c = [], j = 0, _ = a + (g.e = e.e - t.e) + 1;
|
|
278
278
|
// precision of the result
|
|
279
279
|
// Add zeros to make remainder as long as divisor.
|
|
280
280
|
for (g.s = i, i = _ < 0 ? 0 : _,
|
|
@@ -302,54 +302,54 @@ var OHLCV_INDICATORS;
|
|
|
302
302
|
for (;!m[0]; ) m.shift();
|
|
303
303
|
}
|
|
304
304
|
// Add the digit n to the result array.
|
|
305
|
-
|
|
305
|
+
O[j++] = s ? c : ++c,
|
|
306
306
|
// Update the remainder.
|
|
307
|
-
m[0] && s ? m[d] = n[
|
|
308
|
-
} while ((
|
|
307
|
+
m[0] && s ? m[d] = n[p] || 0 : m = [ n[p] ];
|
|
308
|
+
} while ((p++ < v || m[0] !== S) && i--);
|
|
309
309
|
// Leading zero? Do not remove if result is simply zero (qi == 1).
|
|
310
|
-
return
|
|
310
|
+
return O[0] || 1 == j || (
|
|
311
311
|
// There can't be more than one zero.
|
|
312
|
-
|
|
312
|
+
O.shift(), g.e--, _--),
|
|
313
313
|
// Round?
|
|
314
|
-
j > _ && P(g, _, r.RM, m[0] !==
|
|
314
|
+
j > _ && P(g, _, r.RM, m[0] !== S), g;
|
|
315
315
|
},
|
|
316
316
|
/*
|
|
317
317
|
* Return true if the value of this Big is equal to the value of Big y, otherwise return false.
|
|
318
318
|
*/
|
|
319
|
-
|
|
319
|
+
O.eq = function(t) {
|
|
320
320
|
return 0 === this.cmp(t);
|
|
321
321
|
},
|
|
322
322
|
/*
|
|
323
323
|
* Return true if the value of this Big is greater than the value of Big y, otherwise return
|
|
324
324
|
* false.
|
|
325
325
|
*/
|
|
326
|
-
|
|
326
|
+
O.gt = function(t) {
|
|
327
327
|
return this.cmp(t) > 0;
|
|
328
328
|
},
|
|
329
329
|
/*
|
|
330
330
|
* Return true if the value of this Big is greater than or equal to the value of Big y, otherwise
|
|
331
331
|
* return false.
|
|
332
332
|
*/
|
|
333
|
-
|
|
333
|
+
O.gte = function(t) {
|
|
334
334
|
return this.cmp(t) > -1;
|
|
335
335
|
},
|
|
336
336
|
/*
|
|
337
337
|
* Return true if the value of this Big is less than the value of Big y, otherwise return false.
|
|
338
338
|
*/
|
|
339
|
-
|
|
339
|
+
O.lt = function(t) {
|
|
340
340
|
return this.cmp(t) < 0;
|
|
341
341
|
},
|
|
342
342
|
/*
|
|
343
343
|
* Return true if the value of this Big is less than or equal to the value of Big y, otherwise
|
|
344
344
|
* return false.
|
|
345
345
|
*/
|
|
346
|
-
|
|
346
|
+
O.lte = function(t) {
|
|
347
347
|
return this.cmp(t) < 1;
|
|
348
348
|
},
|
|
349
349
|
/*
|
|
350
350
|
* Return a new Big whose value is the value of this Big minus the value of Big y.
|
|
351
351
|
*/
|
|
352
|
-
|
|
352
|
+
O.minus = O.sub = function(t) {
|
|
353
353
|
var e, r, n, o, i = this, a = i.constructor, u = i.s, l = (t = new a(t)).s;
|
|
354
354
|
// Signs differ?
|
|
355
355
|
if (u != l) return t.s = -l, i.plus(t);
|
|
@@ -394,7 +394,7 @@ var OHLCV_INDICATORS;
|
|
|
394
394
|
/*
|
|
395
395
|
* Return a new Big whose value is the value of this Big modulo the value of Big y.
|
|
396
396
|
*/
|
|
397
|
-
|
|
397
|
+
O.mod = function(t) {
|
|
398
398
|
var e, r = this, n = r.constructor, o = r.s, i = (t = new n(t)).s;
|
|
399
399
|
if (!t.c[0]) throw Error(w);
|
|
400
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,
|
|
@@ -403,14 +403,14 @@ var OHLCV_INDICATORS;
|
|
|
403
403
|
/*
|
|
404
404
|
* Return a new Big whose value is the value of this Big negated.
|
|
405
405
|
*/
|
|
406
|
-
|
|
406
|
+
O.neg = function() {
|
|
407
407
|
var t = new this.constructor(this);
|
|
408
408
|
return t.s = -t.s, t;
|
|
409
409
|
},
|
|
410
410
|
/*
|
|
411
411
|
* Return a new Big whose value is the value of this Big plus the value of Big y.
|
|
412
412
|
*/
|
|
413
|
-
|
|
413
|
+
O.plus = O.add = function(t) {
|
|
414
414
|
var e, r, n, o = this, i = o.constructor;
|
|
415
415
|
// Signs differ?
|
|
416
416
|
if (t = new i(t), o.s != t.s) return t.s = -t.s, o.minus(t);
|
|
@@ -439,7 +439,7 @@ var OHLCV_INDICATORS;
|
|
|
439
439
|
*
|
|
440
440
|
* n {number} Integer, -MAX_POWER to MAX_POWER inclusive.
|
|
441
441
|
*/
|
|
442
|
-
|
|
442
|
+
O.pow = function(t) {
|
|
443
443
|
var e = this, r = new e.constructor("1"), n = r, o = t < 0;
|
|
444
444
|
if (t !== ~~t || t < -1e6 || t > v) throw Error(d + "exponent");
|
|
445
445
|
for (o && (t = -t); 1 & t && (n = n.times(e)), t >>= 1; ) e = e.times(e);
|
|
@@ -452,8 +452,8 @@ var OHLCV_INDICATORS;
|
|
|
452
452
|
* sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
|
|
453
453
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
454
454
|
*/
|
|
455
|
-
|
|
456
|
-
if (t !== ~~t || t < 1 || t >
|
|
455
|
+
O.prec = function(t, e) {
|
|
456
|
+
if (t !== ~~t || t < 1 || t > h) throw Error(d + "precision");
|
|
457
457
|
return P(new this.constructor(this), t, e);
|
|
458
458
|
},
|
|
459
459
|
/*
|
|
@@ -465,15 +465,15 @@ var OHLCV_INDICATORS;
|
|
|
465
465
|
* dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
|
|
466
466
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
467
467
|
*/
|
|
468
|
-
|
|
469
|
-
if (t ===
|
|
468
|
+
O.round = function(t, e) {
|
|
469
|
+
if (t === S) t = 0; else if (t !== ~~t || t < -h || t > h) throw Error(b);
|
|
470
470
|
return P(new this.constructor(this), t + this.e + 1, e);
|
|
471
471
|
},
|
|
472
472
|
/*
|
|
473
473
|
* Return a new Big whose value is the square root of the value of this Big, rounded, if
|
|
474
474
|
* necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
|
|
475
475
|
*/
|
|
476
|
-
|
|
476
|
+
O.sqrt = function() {
|
|
477
477
|
var t, e, r, n = this, o = n.constructor, i = n.s, a = n.e, u = new o("0.5");
|
|
478
478
|
// Zero?
|
|
479
479
|
if (!n.c[0]) return new o(n);
|
|
@@ -494,7 +494,7 @@ var OHLCV_INDICATORS;
|
|
|
494
494
|
/*
|
|
495
495
|
* Return a new Big whose value is the value of this Big times the value of Big y.
|
|
496
496
|
*/
|
|
497
|
-
|
|
497
|
+
O.times = O.mul = function(t) {
|
|
498
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;
|
|
499
499
|
// Determine sign of result.
|
|
500
500
|
// Return signed 0 if either 0.
|
|
@@ -527,10 +527,10 @@ var OHLCV_INDICATORS;
|
|
|
527
527
|
* dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
|
|
528
528
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
529
529
|
*/
|
|
530
|
-
|
|
530
|
+
O.toExponential = function(t, e) {
|
|
531
531
|
var r = this, n = r.c[0];
|
|
532
|
-
if (t !==
|
|
533
|
-
if (t !== ~~t || t < 0 || t >
|
|
532
|
+
if (t !== S) {
|
|
533
|
+
if (t !== ~~t || t < 0 || t > h) throw Error(b);
|
|
534
534
|
for (r = P(new r.constructor(r), ++t, e); r.c.length < t; ) r.c.push(0);
|
|
535
535
|
}
|
|
536
536
|
return _(r, !0, !!n);
|
|
@@ -545,10 +545,10 @@ var OHLCV_INDICATORS;
|
|
|
545
545
|
* (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
|
|
546
546
|
* (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
|
|
547
547
|
*/
|
|
548
|
-
|
|
548
|
+
O.toFixed = function(t, e) {
|
|
549
549
|
var r = this, n = r.c[0];
|
|
550
|
-
if (t !==
|
|
551
|
-
if (t !== ~~t || t < 0 || t >
|
|
550
|
+
if (t !== S) {
|
|
551
|
+
if (t !== ~~t || t < 0 || t > h) throw Error(b);
|
|
552
552
|
// x.e may have changed if the value is rounded up.
|
|
553
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);
|
|
554
554
|
}
|
|
@@ -560,14 +560,14 @@ var OHLCV_INDICATORS;
|
|
|
560
560
|
* Big.PE, or a negative exponent equal to or less than Big.NE.
|
|
561
561
|
* Omit the sign for negative zero.
|
|
562
562
|
*/
|
|
563
|
-
|
|
563
|
+
O[Symbol.for("nodejs.util.inspect.custom")] = O.toJSON = O.toString = function() {
|
|
564
564
|
var t = this, e = t.constructor;
|
|
565
565
|
return _(t, t.e <= e.NE || t.e >= e.PE, !!t.c[0]);
|
|
566
566
|
},
|
|
567
567
|
/*
|
|
568
568
|
* Return the value of this Big as a primitve number.
|
|
569
569
|
*/
|
|
570
|
-
|
|
570
|
+
O.toNumber = function() {
|
|
571
571
|
var t = Number(_(this, !0, !0));
|
|
572
572
|
if (!0 === this.constructor.strict && !this.eq(t.toString())) throw Error(m + "Imprecise conversion");
|
|
573
573
|
return t;
|
|
@@ -581,10 +581,10 @@ var OHLCV_INDICATORS;
|
|
|
581
581
|
* sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
|
|
582
582
|
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
583
583
|
*/
|
|
584
|
-
|
|
584
|
+
O.toPrecision = function(t, e) {
|
|
585
585
|
var r = this, n = r.constructor, o = r.c[0];
|
|
586
|
-
if (t !==
|
|
587
|
-
if (t !== ~~t || t < 1 || t >
|
|
586
|
+
if (t !== S) {
|
|
587
|
+
if (t !== ~~t || t < 1 || t > h) throw Error(d + "precision");
|
|
588
588
|
for (r = P(new n(r), t, e); r.c.length < t; ) r.c.push(0);
|
|
589
589
|
}
|
|
590
590
|
return _(r, t <= r.e || r.e <= n.NE || r.e >= n.PE, !!o);
|
|
@@ -595,7 +595,7 @@ var OHLCV_INDICATORS;
|
|
|
595
595
|
* Big.PE, or a negative exponent equal to or less than Big.NE.
|
|
596
596
|
* Include the sign for negative zero.
|
|
597
597
|
*/
|
|
598
|
-
|
|
598
|
+
O.valueOf = function() {
|
|
599
599
|
var t = this, e = t.constructor;
|
|
600
600
|
if (!0 === e.strict) throw Error(m + "valueOf disallowed");
|
|
601
601
|
return _(t, t.e <= e.NE || t.e >= e.PE, !0);
|
|
@@ -615,7 +615,7 @@ var OHLCV_INDICATORS;
|
|
|
615
615
|
function e(r) {
|
|
616
616
|
var n = this;
|
|
617
617
|
// Enable constructor usage without new.
|
|
618
|
-
if (!(n instanceof e)) return r ===
|
|
618
|
+
if (!(n instanceof e)) return r === S ? t() : new e(r);
|
|
619
619
|
// Duplicate.
|
|
620
620
|
if (r instanceof e) n.s = r.s, n.e = r.e, n.c = r.c.slice(); else {
|
|
621
621
|
if ("string" != typeof r) {
|
|
@@ -658,7 +658,7 @@ var OHLCV_INDICATORS;
|
|
|
658
658
|
// Shadow Big.prototype.constructor which points to Object.
|
|
659
659
|
n.constructor = e;
|
|
660
660
|
}
|
|
661
|
-
return e.prototype =
|
|
661
|
+
return e.prototype = O, e.DP = 20, e.RM = 1, e.NE = -7, e.PE = 21, e.strict = false,
|
|
662
662
|
e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
|
|
663
663
|
})();
|
|
664
664
|
/// <reference types="https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/big.js/index.d.ts" />
|
|
@@ -670,14 +670,14 @@ var OHLCV_INDICATORS;
|
|
|
670
670
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
671
671
|
}, N(t);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function T(t, e) {
|
|
674
674
|
for (var r = 0; r < e.length; r++) {
|
|
675
675
|
var n = e[r];
|
|
676
676
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
677
|
-
Object.defineProperty(t,
|
|
677
|
+
Object.defineProperty(t, A(n.key), n);
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function A(t) {
|
|
681
681
|
var e = function(t, e) {
|
|
682
682
|
if ("object" != N(t) || !t) return t;
|
|
683
683
|
var r = t[Symbol.toPrimitive];
|
|
@@ -771,7 +771,7 @@ var OHLCV_INDICATORS;
|
|
|
771
771
|
}), Object.defineProperty(t, "prototype", {
|
|
772
772
|
writable: !1
|
|
773
773
|
}), e && I(t, e);
|
|
774
|
-
}(e, t), r = e, n &&
|
|
774
|
+
}(e, t), r = e, n && T(r.prototype, n), o && T(r, o), Object.defineProperty(r, "prototype", {
|
|
775
775
|
writable: !1
|
|
776
776
|
}), r;
|
|
777
777
|
var r, n, o;
|
|
@@ -1068,18 +1068,18 @@ var OHLCV_INDICATORS;
|
|
|
1068
1068
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1069
1069
|
}, yt(t);
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function pt(t, e) {
|
|
1072
1072
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1074
|
+
function ht(t, e) {
|
|
1075
1075
|
for (var r = 0; r < e.length; r++) {
|
|
1076
1076
|
var n = e[r];
|
|
1077
1077
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1078
|
-
Object.defineProperty(t,
|
|
1078
|
+
Object.defineProperty(t, St(n.key), n);
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
1081
|
function vt(t, e, r) {
|
|
1082
|
-
return e &&
|
|
1082
|
+
return e && ht(t.prototype, e), r && ht(t, r), Object.defineProperty(t, "prototype", {
|
|
1083
1083
|
writable: !1
|
|
1084
1084
|
}), t;
|
|
1085
1085
|
}
|
|
@@ -1123,15 +1123,15 @@ var OHLCV_INDICATORS;
|
|
|
1123
1123
|
return t.__proto__ = e, t;
|
|
1124
1124
|
}, wt(t, e);
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1127
|
-
return (e =
|
|
1126
|
+
function Ot(t, e, r) {
|
|
1127
|
+
return (e = St(e)) in t ? Object.defineProperty(t, e, {
|
|
1128
1128
|
value: r,
|
|
1129
1129
|
enumerable: !0,
|
|
1130
1130
|
configurable: !0,
|
|
1131
1131
|
writable: !0
|
|
1132
1132
|
}) : t[e] = r, t;
|
|
1133
1133
|
}
|
|
1134
|
-
function
|
|
1134
|
+
function St(t) {
|
|
1135
1135
|
var e = function(t, e) {
|
|
1136
1136
|
if ("object" != yt(t) || !t) return t;
|
|
1137
1137
|
var r = t[Symbol.toPrimitive];
|
|
@@ -1147,8 +1147,8 @@ var OHLCV_INDICATORS;
|
|
|
1147
1147
|
var jt = function(t) {
|
|
1148
1148
|
function e(t) {
|
|
1149
1149
|
var r;
|
|
1150
|
-
return
|
|
1151
|
-
|
|
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,
|
|
1152
1152
|
r;
|
|
1153
1153
|
}
|
|
1154
1154
|
return gt(e, t), vt(e, [ {
|
|
@@ -1180,7 +1180,7 @@ var OHLCV_INDICATORS;
|
|
|
1180
1180
|
return t + e;
|
|
1181
1181
|
}), 0) / t.length : 0;
|
|
1182
1182
|
}
|
|
1183
|
-
// ./node_modules/trading-signals/dist/
|
|
1183
|
+
// ./node_modules/trading-signals/dist/TR/TR.js
|
|
1184
1184
|
function _t(t) {
|
|
1185
1185
|
return _t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1186
1186
|
return typeof t;
|
|
@@ -1191,27 +1191,67 @@ var OHLCV_INDICATORS;
|
|
|
1191
1191
|
function Nt(t, e) {
|
|
1192
1192
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function Tt(t, e) {
|
|
1195
1195
|
for (var r = 0; r < e.length; r++) {
|
|
1196
1196
|
var n = e[r];
|
|
1197
1197
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1198
|
-
Object.defineProperty(t,
|
|
1198
|
+
Object.defineProperty(t, Rt(n.key), n);
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
return e &&
|
|
1201
|
+
function At(t, e, r) {
|
|
1202
|
+
return e && Tt(t.prototype, e), r && Tt(t, r), Object.defineProperty(t, "prototype", {
|
|
1203
1203
|
writable: !1
|
|
1204
1204
|
}), t;
|
|
1205
1205
|
}
|
|
1206
1206
|
function Et(t, e, r) {
|
|
1207
|
-
return
|
|
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, {
|
|
1208
1248
|
value: r,
|
|
1209
1249
|
enumerable: !0,
|
|
1210
1250
|
configurable: !0,
|
|
1211
1251
|
writable: !0
|
|
1212
1252
|
}) : t[e] = r, t;
|
|
1213
1253
|
}
|
|
1214
|
-
function
|
|
1254
|
+
function Rt(t) {
|
|
1215
1255
|
var e = function(t, e) {
|
|
1216
1256
|
if ("object" != _t(t) || !t) return t;
|
|
1217
1257
|
var r = t[Symbol.toPrimitive];
|
|
@@ -1224,11 +1264,175 @@ var OHLCV_INDICATORS;
|
|
|
1224
1264
|
}(t, "string");
|
|
1225
1265
|
return "symbol" == _t(e) ? e : e + "";
|
|
1226
1266
|
}
|
|
1227
|
-
var
|
|
1228
|
-
|
|
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) {
|
|
1229
1433
|
var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2;
|
|
1230
|
-
|
|
1231
|
-
|
|
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;
|
|
1232
1436
|
}), [ {
|
|
1233
1437
|
key: "update",
|
|
1234
1438
|
value: function(t) {
|
|
@@ -1263,52 +1467,52 @@ var OHLCV_INDICATORS;
|
|
|
1263
1467
|
} ]);
|
|
1264
1468
|
}();
|
|
1265
1469
|
// ./node_modules/trading-signals/dist/EMA/EMA.js
|
|
1266
|
-
function
|
|
1267
|
-
return
|
|
1470
|
+
function re(t) {
|
|
1471
|
+
return re = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1268
1472
|
return typeof t;
|
|
1269
1473
|
} : function(t) {
|
|
1270
1474
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1271
|
-
},
|
|
1475
|
+
}, re(t);
|
|
1272
1476
|
}
|
|
1273
|
-
function
|
|
1477
|
+
function ne(t, e) {
|
|
1274
1478
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1275
1479
|
}
|
|
1276
|
-
function
|
|
1480
|
+
function oe(t, e) {
|
|
1277
1481
|
for (var r = 0; r < e.length; r++) {
|
|
1278
1482
|
var n = e[r];
|
|
1279
1483
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1280
|
-
Object.defineProperty(t,
|
|
1484
|
+
Object.defineProperty(t, ye(n.key), n);
|
|
1281
1485
|
}
|
|
1282
1486
|
}
|
|
1283
|
-
function
|
|
1284
|
-
return e &&
|
|
1487
|
+
function ie(t, e, r) {
|
|
1488
|
+
return e && oe(t.prototype, e), r && oe(t, r), Object.defineProperty(t, "prototype", {
|
|
1285
1489
|
writable: !1
|
|
1286
1490
|
}), t;
|
|
1287
1491
|
}
|
|
1288
|
-
function
|
|
1289
|
-
return e =
|
|
1290
|
-
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;
|
|
1291
1495
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1292
1496
|
return function(t) {
|
|
1293
1497
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1294
1498
|
return t;
|
|
1295
1499
|
}(t);
|
|
1296
|
-
}(t,
|
|
1500
|
+
}(t, ue() ? Reflect.construct(e, r || [], le(t).constructor) : e.apply(t, r));
|
|
1297
1501
|
}
|
|
1298
|
-
function
|
|
1502
|
+
function ue() {
|
|
1299
1503
|
try {
|
|
1300
1504
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1301
1505
|
} catch (t) {}
|
|
1302
|
-
return (
|
|
1506
|
+
return (ue = function() {
|
|
1303
1507
|
return !!t;
|
|
1304
1508
|
})();
|
|
1305
1509
|
}
|
|
1306
|
-
function
|
|
1307
|
-
return
|
|
1510
|
+
function le(t) {
|
|
1511
|
+
return le = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1308
1512
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1309
|
-
},
|
|
1513
|
+
}, le(t);
|
|
1310
1514
|
}
|
|
1311
|
-
function
|
|
1515
|
+
function ce(t, e) {
|
|
1312
1516
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1313
1517
|
t.prototype = Object.create(e && e.prototype, {
|
|
1314
1518
|
constructor: {
|
|
@@ -1318,42 +1522,42 @@ var OHLCV_INDICATORS;
|
|
|
1318
1522
|
}
|
|
1319
1523
|
}), Object.defineProperty(t, "prototype", {
|
|
1320
1524
|
writable: !1
|
|
1321
|
-
}), e &&
|
|
1525
|
+
}), e && se(t, e);
|
|
1322
1526
|
}
|
|
1323
|
-
function
|
|
1324
|
-
return
|
|
1527
|
+
function se(t, e) {
|
|
1528
|
+
return se = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1325
1529
|
return t.__proto__ = e, t;
|
|
1326
|
-
},
|
|
1530
|
+
}, se(t, e);
|
|
1327
1531
|
}
|
|
1328
|
-
function
|
|
1329
|
-
return (e =
|
|
1532
|
+
function fe(t, e, r) {
|
|
1533
|
+
return (e = ye(e)) in t ? Object.defineProperty(t, e, {
|
|
1330
1534
|
value: r,
|
|
1331
1535
|
enumerable: !0,
|
|
1332
1536
|
configurable: !0,
|
|
1333
1537
|
writable: !0
|
|
1334
1538
|
}) : t[e] = r, t;
|
|
1335
1539
|
}
|
|
1336
|
-
function
|
|
1540
|
+
function ye(t) {
|
|
1337
1541
|
var e = function(t, e) {
|
|
1338
|
-
if ("object" !=
|
|
1542
|
+
if ("object" != re(t) || !t) return t;
|
|
1339
1543
|
var r = t[Symbol.toPrimitive];
|
|
1340
1544
|
if (void 0 !== r) {
|
|
1341
1545
|
var n = r.call(t, e || "default");
|
|
1342
|
-
if ("object" !=
|
|
1546
|
+
if ("object" != re(n)) return n;
|
|
1343
1547
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1344
1548
|
}
|
|
1345
1549
|
return ("string" === e ? String : Number)(t);
|
|
1346
1550
|
}(t, "string");
|
|
1347
|
-
return "symbol" ==
|
|
1551
|
+
return "symbol" == re(e) ? e : e + "";
|
|
1348
1552
|
}
|
|
1349
|
-
var
|
|
1553
|
+
var pe = function(t) {
|
|
1350
1554
|
function e(t) {
|
|
1351
1555
|
var r;
|
|
1352
|
-
return
|
|
1353
|
-
|
|
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),
|
|
1354
1558
|
r;
|
|
1355
1559
|
}
|
|
1356
|
-
return
|
|
1560
|
+
return ce(e, t), ie(e, [ {
|
|
1357
1561
|
key: "update",
|
|
1358
1562
|
value: function(t) {
|
|
1359
1563
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
@@ -1378,53 +1582,53 @@ var OHLCV_INDICATORS;
|
|
|
1378
1582
|
} ]);
|
|
1379
1583
|
}(X);
|
|
1380
1584
|
// ./node_modules/trading-signals/dist/MACD/MACD.js
|
|
1381
|
-
function
|
|
1382
|
-
return
|
|
1585
|
+
function he(t) {
|
|
1586
|
+
return he = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1383
1587
|
return typeof t;
|
|
1384
1588
|
} : function(t) {
|
|
1385
1589
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1386
|
-
},
|
|
1590
|
+
}, he(t);
|
|
1387
1591
|
}
|
|
1388
|
-
function
|
|
1592
|
+
function ve(t, e) {
|
|
1389
1593
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1390
1594
|
}
|
|
1391
|
-
function
|
|
1595
|
+
function me(t, e) {
|
|
1392
1596
|
for (var r = 0; r < e.length; r++) {
|
|
1393
1597
|
var n = e[r];
|
|
1394
1598
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1395
|
-
Object.defineProperty(t,
|
|
1599
|
+
Object.defineProperty(t, ge(n.key), n);
|
|
1396
1600
|
}
|
|
1397
1601
|
}
|
|
1398
|
-
function
|
|
1399
|
-
return e &&
|
|
1602
|
+
function de(t, e, r) {
|
|
1603
|
+
return e && me(t.prototype, e), r && me(t, r), Object.defineProperty(t, "prototype", {
|
|
1400
1604
|
writable: !1
|
|
1401
1605
|
}), t;
|
|
1402
1606
|
}
|
|
1403
|
-
function
|
|
1404
|
-
return (e =
|
|
1607
|
+
function be(t, e, r) {
|
|
1608
|
+
return (e = ge(e)) in t ? Object.defineProperty(t, e, {
|
|
1405
1609
|
value: r,
|
|
1406
1610
|
enumerable: !0,
|
|
1407
1611
|
configurable: !0,
|
|
1408
1612
|
writable: !0
|
|
1409
1613
|
}) : t[e] = r, t;
|
|
1410
1614
|
}
|
|
1411
|
-
function
|
|
1615
|
+
function ge(t) {
|
|
1412
1616
|
var e = function(t, e) {
|
|
1413
|
-
if ("object" !=
|
|
1617
|
+
if ("object" != he(t) || !t) return t;
|
|
1414
1618
|
var r = t[Symbol.toPrimitive];
|
|
1415
1619
|
if (void 0 !== r) {
|
|
1416
1620
|
var n = r.call(t, e || "default");
|
|
1417
|
-
if ("object" !=
|
|
1621
|
+
if ("object" != he(n)) return n;
|
|
1418
1622
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1419
1623
|
}
|
|
1420
1624
|
return ("string" === e ? String : Number)(t);
|
|
1421
1625
|
}(t, "string");
|
|
1422
|
-
return "symbol" ==
|
|
1626
|
+
return "symbol" == he(e) ? e : e + "";
|
|
1423
1627
|
}
|
|
1424
|
-
var
|
|
1425
|
-
return
|
|
1426
|
-
|
|
1427
|
-
|
|
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,
|
|
1428
1632
|
this.signal = n;
|
|
1429
1633
|
}), [ {
|
|
1430
1634
|
key: "getResult",
|
|
@@ -1455,52 +1659,52 @@ var OHLCV_INDICATORS;
|
|
|
1455
1659
|
} ]);
|
|
1456
1660
|
}();
|
|
1457
1661
|
// ./node_modules/trading-signals/dist/RSI/RSI.js
|
|
1458
|
-
function
|
|
1459
|
-
return
|
|
1662
|
+
function Oe(t) {
|
|
1663
|
+
return Oe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1460
1664
|
return typeof t;
|
|
1461
1665
|
} : function(t) {
|
|
1462
1666
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1463
|
-
},
|
|
1667
|
+
}, Oe(t);
|
|
1464
1668
|
}
|
|
1465
|
-
function
|
|
1669
|
+
function Se(t, e) {
|
|
1466
1670
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
1467
1671
|
}
|
|
1468
|
-
function
|
|
1672
|
+
function je(t, e) {
|
|
1469
1673
|
for (var r = 0; r < e.length; r++) {
|
|
1470
1674
|
var n = e[r];
|
|
1471
1675
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
1472
|
-
Object.defineProperty(t,
|
|
1676
|
+
Object.defineProperty(t, xe(n.key), n);
|
|
1473
1677
|
}
|
|
1474
1678
|
}
|
|
1475
|
-
function
|
|
1476
|
-
return e &&
|
|
1679
|
+
function Pe(t, e, r) {
|
|
1680
|
+
return e && je(t.prototype, e), r && je(t, r), Object.defineProperty(t, "prototype", {
|
|
1477
1681
|
writable: !1
|
|
1478
1682
|
}), t;
|
|
1479
1683
|
}
|
|
1480
|
-
function
|
|
1481
|
-
return e =
|
|
1482
|
-
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;
|
|
1483
1687
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1484
1688
|
return function(t) {
|
|
1485
1689
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1486
1690
|
return t;
|
|
1487
1691
|
}(t);
|
|
1488
|
-
}(t,
|
|
1692
|
+
}(t, Ne() ? Reflect.construct(e, r || [], Te(t).constructor) : e.apply(t, r));
|
|
1489
1693
|
}
|
|
1490
|
-
function
|
|
1694
|
+
function Ne() {
|
|
1491
1695
|
try {
|
|
1492
1696
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
1493
1697
|
} catch (t) {}
|
|
1494
|
-
return (
|
|
1698
|
+
return (Ne = function() {
|
|
1495
1699
|
return !!t;
|
|
1496
1700
|
})();
|
|
1497
1701
|
}
|
|
1498
|
-
function
|
|
1499
|
-
return
|
|
1702
|
+
function Te(t) {
|
|
1703
|
+
return Te = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
1500
1704
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
1501
|
-
},
|
|
1705
|
+
}, Te(t);
|
|
1502
1706
|
}
|
|
1503
|
-
function
|
|
1707
|
+
function Ae(t, e) {
|
|
1504
1708
|
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
1505
1709
|
t.prototype = Object.create(e && e.prototype, {
|
|
1506
1710
|
constructor: {
|
|
@@ -1510,42 +1714,42 @@ var OHLCV_INDICATORS;
|
|
|
1510
1714
|
}
|
|
1511
1715
|
}), Object.defineProperty(t, "prototype", {
|
|
1512
1716
|
writable: !1
|
|
1513
|
-
}), e &&
|
|
1717
|
+
}), e && Ee(t, e);
|
|
1514
1718
|
}
|
|
1515
|
-
function
|
|
1516
|
-
return
|
|
1719
|
+
function Ee(t, e) {
|
|
1720
|
+
return Ee = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
1517
1721
|
return t.__proto__ = e, t;
|
|
1518
|
-
},
|
|
1722
|
+
}, Ee(t, e);
|
|
1519
1723
|
}
|
|
1520
|
-
function
|
|
1521
|
-
return (e =
|
|
1724
|
+
function ke(t, e, r) {
|
|
1725
|
+
return (e = xe(e)) in t ? Object.defineProperty(t, e, {
|
|
1522
1726
|
value: r,
|
|
1523
1727
|
enumerable: !0,
|
|
1524
1728
|
configurable: !0,
|
|
1525
1729
|
writable: !0
|
|
1526
1730
|
}) : t[e] = r, t;
|
|
1527
1731
|
}
|
|
1528
|
-
function
|
|
1732
|
+
function xe(t) {
|
|
1529
1733
|
var e = function(t, e) {
|
|
1530
|
-
if ("object" !=
|
|
1734
|
+
if ("object" != Oe(t) || !t) return t;
|
|
1531
1735
|
var r = t[Symbol.toPrimitive];
|
|
1532
1736
|
if (void 0 !== r) {
|
|
1533
1737
|
var n = r.call(t, e || "default");
|
|
1534
|
-
if ("object" !=
|
|
1738
|
+
if ("object" != Oe(n)) return n;
|
|
1535
1739
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1536
1740
|
}
|
|
1537
1741
|
return ("string" === e ? String : Number)(t);
|
|
1538
1742
|
}(t, "string");
|
|
1539
|
-
return "symbol" ==
|
|
1743
|
+
return "symbol" == Oe(e) ? e : e + "";
|
|
1540
1744
|
}
|
|
1541
|
-
var
|
|
1745
|
+
var Ie = function(t) {
|
|
1542
1746
|
function e(t) {
|
|
1543
1747
|
var r, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : jt;
|
|
1544
|
-
return
|
|
1545
|
-
|
|
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,
|
|
1546
1750
|
r.avgGain = new n(r.interval), r.avgLoss = new n(r.interval), r;
|
|
1547
1751
|
}
|
|
1548
|
-
return
|
|
1752
|
+
return Ae(e, t), Pe(e, [ {
|
|
1549
1753
|
key: "update",
|
|
1550
1754
|
value: function(t) {
|
|
1551
1755
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
@@ -1564,26 +1768,26 @@ var OHLCV_INDICATORS;
|
|
|
1564
1768
|
} ]);
|
|
1565
1769
|
}(V);
|
|
1566
1770
|
// ./src/oscillators/rsi.js
|
|
1567
|
-
function
|
|
1568
|
-
return
|
|
1771
|
+
function De(t) {
|
|
1772
|
+
return De = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1569
1773
|
return typeof t;
|
|
1570
1774
|
} : function(t) {
|
|
1571
1775
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1572
|
-
},
|
|
1776
|
+
}, De(t);
|
|
1573
1777
|
}
|
|
1574
|
-
function
|
|
1778
|
+
function Me(t, e, r) {
|
|
1575
1779
|
return (e = function(t) {
|
|
1576
1780
|
var e = function(t, e) {
|
|
1577
|
-
if ("object" !=
|
|
1781
|
+
if ("object" != De(t) || !t) return t;
|
|
1578
1782
|
var r = t[Symbol.toPrimitive];
|
|
1579
1783
|
if (void 0 !== r) {
|
|
1580
1784
|
var n = r.call(t, e || "default");
|
|
1581
|
-
if ("object" !=
|
|
1785
|
+
if ("object" != De(n)) return n;
|
|
1582
1786
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1583
1787
|
}
|
|
1584
1788
|
return ("string" === e ? String : Number)(t);
|
|
1585
1789
|
}(t, "string");
|
|
1586
|
-
return "symbol" ==
|
|
1790
|
+
return "symbol" == De(e) ? e : e + "";
|
|
1587
1791
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1588
1792
|
value: r,
|
|
1589
1793
|
enumerable: !0,
|
|
@@ -1591,14 +1795,14 @@ var OHLCV_INDICATORS;
|
|
|
1591
1795
|
writable: !0
|
|
1592
1796
|
}) : t[e] = r, t;
|
|
1593
1797
|
}
|
|
1594
|
-
var
|
|
1595
|
-
ema:
|
|
1798
|
+
var Re = {
|
|
1799
|
+
ema: pe,
|
|
1596
1800
|
sma: ft
|
|
1597
|
-
},
|
|
1801
|
+
}, Ce = function(t, e, r, n, o) {
|
|
1598
1802
|
var i = o.target, a = (o.lag, o.precomputed), u = t.verticalOhlcv, l = t.instances, c = a.keyName;
|
|
1599
1803
|
if (0 === e && !u.hasOwnProperty(i)) throw new Error("Target property ".concat(i, " not found in verticalOhlcv for ").concat(r, "."));
|
|
1600
1804
|
// Retrieve the current price value.
|
|
1601
|
-
var s = u[i][e], f = l[c]
|
|
1805
|
+
var s = u[i][e], f = l[c];
|
|
1602
1806
|
// Update the moving average instance.
|
|
1603
1807
|
f.update(s);
|
|
1604
1808
|
var y = NaN;
|
|
@@ -1611,37 +1815,35 @@ var OHLCV_INDICATORS;
|
|
|
1611
1815
|
key: c,
|
|
1612
1816
|
value: y
|
|
1613
1817
|
}), !0;
|
|
1614
|
-
},
|
|
1818
|
+
}, Fe = function(t) {
|
|
1615
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);
|
|
1616
1820
|
// Create the main moving average instance.
|
|
1617
|
-
return a[y] =
|
|
1618
|
-
|
|
1619
|
-
}, u[y] = new Float64Array(s).fill(NaN), l.add(y), o > 0 && e.lag([ y ], o), c[y] = "Float64Array",
|
|
1620
|
-
{
|
|
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", {
|
|
1621
1823
|
keyName: y
|
|
1622
1824
|
};
|
|
1623
1825
|
};
|
|
1624
1826
|
// ./src/moving-averages/macd.js
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1827
|
+
function Le(t) {
|
|
1828
|
+
return Le = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1627
1829
|
return typeof t;
|
|
1628
1830
|
} : function(t) {
|
|
1629
1831
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1630
|
-
},
|
|
1832
|
+
}, Le(t);
|
|
1631
1833
|
}
|
|
1632
|
-
function
|
|
1834
|
+
function Be(t, e, r) {
|
|
1633
1835
|
return (e = function(t) {
|
|
1634
1836
|
var e = function(t, e) {
|
|
1635
|
-
if ("object" !=
|
|
1837
|
+
if ("object" != Le(t) || !t) return t;
|
|
1636
1838
|
var r = t[Symbol.toPrimitive];
|
|
1637
1839
|
if (void 0 !== r) {
|
|
1638
1840
|
var n = r.call(t, e || "default");
|
|
1639
|
-
if ("object" !=
|
|
1841
|
+
if ("object" != Le(n)) return n;
|
|
1640
1842
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1641
1843
|
}
|
|
1642
1844
|
return ("string" === e ? String : Number)(t);
|
|
1643
1845
|
}(t, "string");
|
|
1644
|
-
return "symbol" ==
|
|
1846
|
+
return "symbol" == Le(e) ? e : e + "";
|
|
1645
1847
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1646
1848
|
value: r,
|
|
1647
1849
|
enumerable: !0,
|
|
@@ -1649,14 +1851,14 @@ var OHLCV_INDICATORS;
|
|
|
1649
1851
|
writable: !0
|
|
1650
1852
|
}) : t[e] = r, t;
|
|
1651
1853
|
}
|
|
1652
|
-
function
|
|
1854
|
+
function He(t, e) {
|
|
1653
1855
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1654
1856
|
if (!r) {
|
|
1655
1857
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
1656
1858
|
if (t) {
|
|
1657
|
-
if ("string" == typeof t) return
|
|
1859
|
+
if ("string" == typeof t) return Ve(t, e);
|
|
1658
1860
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1659
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
1660
1862
|
}
|
|
1661
1863
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
1662
1864
|
r && (t = r);
|
|
@@ -1700,22 +1902,22 @@ var OHLCV_INDICATORS;
|
|
|
1700
1902
|
}
|
|
1701
1903
|
};
|
|
1702
1904
|
}
|
|
1703
|
-
function
|
|
1905
|
+
function Ve(t, e) {
|
|
1704
1906
|
(null == e || e > t.length) && (e = t.length);
|
|
1705
1907
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1706
1908
|
return n;
|
|
1707
1909
|
}
|
|
1708
|
-
var
|
|
1910
|
+
var Ue = "close";
|
|
1709
1911
|
// ./src/utilities/numberUtilities.js
|
|
1710
|
-
function
|
|
1711
|
-
return
|
|
1912
|
+
function $e(t) {
|
|
1913
|
+
return $e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1712
1914
|
return typeof t;
|
|
1713
1915
|
} : function(t) {
|
|
1714
1916
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1715
|
-
},
|
|
1917
|
+
}, $e(t);
|
|
1716
1918
|
}
|
|
1717
1919
|
// Helper to clean non-numeric characters (except "-" at the start and decimal point)
|
|
1718
|
-
var
|
|
1920
|
+
var qe = {
|
|
1719
1921
|
number: function(t) {
|
|
1720
1922
|
return t;
|
|
1721
1923
|
},
|
|
@@ -1725,7 +1927,7 @@ var OHLCV_INDICATORS;
|
|
|
1725
1927
|
numberDirtyString: function(t) {
|
|
1726
1928
|
return Number(t.replace(/(?!^-)[^0-9.]/g, ""));
|
|
1727
1929
|
}
|
|
1728
|
-
},
|
|
1930
|
+
}, ze = function(t) {
|
|
1729
1931
|
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
|
1730
1932
|
// 1) true numbers
|
|
1731
1933
|
if ("number" == typeof t && !Number.isNaN(t)) return "number";
|
|
@@ -1740,43 +1942,43 @@ var OHLCV_INDICATORS;
|
|
|
1740
1942
|
if (o && n.test(o)) return "numberDirtyString";
|
|
1741
1943
|
}
|
|
1742
1944
|
if (e) throw new TypeError("Invalid input: expected a number or numeric string");
|
|
1743
|
-
return
|
|
1744
|
-
},
|
|
1945
|
+
return $e(t);
|
|
1946
|
+
}, Ge = function(t, e) {
|
|
1745
1947
|
var r = Math.pow(10, e);
|
|
1746
1948
|
// add a tiny epsilon to mitigate floating-point quirks around .5
|
|
1747
1949
|
return Math.round((t + Number.EPSILON) * r) / r;
|
|
1748
1950
|
};
|
|
1749
1951
|
// ./src/moving-averages/donchianChannel.js
|
|
1750
|
-
function
|
|
1952
|
+
function Ke(t) {
|
|
1751
1953
|
return function(t) {
|
|
1752
|
-
if (Array.isArray(t)) return
|
|
1954
|
+
if (Array.isArray(t)) return Je(t);
|
|
1753
1955
|
}(t) || function(t) {
|
|
1754
1956
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1755
|
-
}(t) ||
|
|
1957
|
+
}(t) || Ye(t) || function() {
|
|
1756
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.");
|
|
1757
1959
|
}();
|
|
1758
1960
|
}
|
|
1759
|
-
function
|
|
1961
|
+
function Ye(t, e) {
|
|
1760
1962
|
if (t) {
|
|
1761
|
-
if ("string" == typeof t) return
|
|
1963
|
+
if ("string" == typeof t) return Je(t, e);
|
|
1762
1964
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1763
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
1764
1966
|
}
|
|
1765
1967
|
}
|
|
1766
|
-
function
|
|
1968
|
+
function Je(t, e) {
|
|
1767
1969
|
(null == e || e > t.length) && (e = t.length);
|
|
1768
1970
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1769
1971
|
return n;
|
|
1770
1972
|
}
|
|
1771
1973
|
// ./src/moving-averages/bollingerBands.js
|
|
1772
|
-
function
|
|
1773
|
-
return
|
|
1974
|
+
function Ze(t) {
|
|
1975
|
+
return Ze = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1774
1976
|
return typeof t;
|
|
1775
1977
|
} : function(t) {
|
|
1776
1978
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1777
|
-
},
|
|
1979
|
+
}, Ze(t);
|
|
1778
1980
|
}
|
|
1779
|
-
function
|
|
1981
|
+
function Qe(t, e) {
|
|
1780
1982
|
var r = Object.keys(t);
|
|
1781
1983
|
if (Object.getOwnPropertySymbols) {
|
|
1782
1984
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -1786,19 +1988,19 @@ var OHLCV_INDICATORS;
|
|
|
1786
1988
|
}
|
|
1787
1989
|
return r;
|
|
1788
1990
|
}
|
|
1789
|
-
function
|
|
1991
|
+
function We(t, e, r) {
|
|
1790
1992
|
return (e = function(t) {
|
|
1791
1993
|
var e = function(t, e) {
|
|
1792
|
-
if ("object" !=
|
|
1994
|
+
if ("object" != Ze(t) || !t) return t;
|
|
1793
1995
|
var r = t[Symbol.toPrimitive];
|
|
1794
1996
|
if (void 0 !== r) {
|
|
1795
1997
|
var n = r.call(t, e || "default");
|
|
1796
|
-
if ("object" !=
|
|
1998
|
+
if ("object" != Ze(n)) return n;
|
|
1797
1999
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1798
2000
|
}
|
|
1799
2001
|
return ("string" === e ? String : Number)(t);
|
|
1800
2002
|
}(t, "string");
|
|
1801
|
-
return "symbol" ==
|
|
2003
|
+
return "symbol" == Ze(e) ? e : e + "";
|
|
1802
2004
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1803
2005
|
value: r,
|
|
1804
2006
|
enumerable: !0,
|
|
@@ -1806,14 +2008,14 @@ var OHLCV_INDICATORS;
|
|
|
1806
2008
|
writable: !0
|
|
1807
2009
|
}) : t[e] = r, t;
|
|
1808
2010
|
}
|
|
1809
|
-
function
|
|
2011
|
+
function Xe(t, e) {
|
|
1810
2012
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1811
2013
|
if (!r) {
|
|
1812
2014
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
1813
2015
|
if (t) {
|
|
1814
|
-
if ("string" == typeof t) return
|
|
2016
|
+
if ("string" == typeof t) return tr(t, e);
|
|
1815
2017
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1816
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
1817
2019
|
}
|
|
1818
2020
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
1819
2021
|
r && (t = r);
|
|
@@ -1857,32 +2059,32 @@ var OHLCV_INDICATORS;
|
|
|
1857
2059
|
}
|
|
1858
2060
|
};
|
|
1859
2061
|
}
|
|
1860
|
-
function
|
|
2062
|
+
function tr(t, e) {
|
|
1861
2063
|
(null == e || e > t.length) && (e = t.length);
|
|
1862
2064
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1863
2065
|
return n;
|
|
1864
2066
|
}
|
|
1865
2067
|
// ./src/oscillators/volumeOscillator.js
|
|
1866
|
-
function
|
|
1867
|
-
return
|
|
2068
|
+
function er(t) {
|
|
2069
|
+
return er = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1868
2070
|
return typeof t;
|
|
1869
2071
|
} : function(t) {
|
|
1870
2072
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1871
|
-
},
|
|
2073
|
+
}, er(t);
|
|
1872
2074
|
}
|
|
1873
|
-
function
|
|
2075
|
+
function rr(t, e, r) {
|
|
1874
2076
|
return (e = function(t) {
|
|
1875
2077
|
var e = function(t, e) {
|
|
1876
|
-
if ("object" !=
|
|
2078
|
+
if ("object" != er(t) || !t) return t;
|
|
1877
2079
|
var r = t[Symbol.toPrimitive];
|
|
1878
2080
|
if (void 0 !== r) {
|
|
1879
2081
|
var n = r.call(t, e || "default");
|
|
1880
|
-
if ("object" !=
|
|
2082
|
+
if ("object" != er(n)) return n;
|
|
1881
2083
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1882
2084
|
}
|
|
1883
2085
|
return ("string" === e ? String : Number)(t);
|
|
1884
2086
|
}(t, "string");
|
|
1885
|
-
return "symbol" ==
|
|
2087
|
+
return "symbol" == er(e) ? e : e + "";
|
|
1886
2088
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1887
2089
|
value: r,
|
|
1888
2090
|
enumerable: !0,
|
|
@@ -1891,14 +2093,14 @@ var OHLCV_INDICATORS;
|
|
|
1891
2093
|
}) : t[e] = r, t;
|
|
1892
2094
|
}
|
|
1893
2095
|
// ./src/utilities/dateUtilities.js
|
|
1894
|
-
function
|
|
1895
|
-
return
|
|
2096
|
+
function nr(t) {
|
|
2097
|
+
return nr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1896
2098
|
return typeof t;
|
|
1897
2099
|
} : function(t) {
|
|
1898
2100
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1899
|
-
},
|
|
2101
|
+
}, nr(t);
|
|
1900
2102
|
}
|
|
1901
|
-
var
|
|
2103
|
+
var or = {
|
|
1902
2104
|
string: function(t) {
|
|
1903
2105
|
return t.toISOString();
|
|
1904
2106
|
},
|
|
@@ -1911,7 +2113,7 @@ var OHLCV_INDICATORS;
|
|
|
1911
2113
|
object: function(t) {
|
|
1912
2114
|
return t;
|
|
1913
2115
|
}
|
|
1914
|
-
},
|
|
2116
|
+
}, ir = {
|
|
1915
2117
|
dateObject: function(t) {
|
|
1916
2118
|
return t;
|
|
1917
2119
|
},
|
|
@@ -1927,14 +2129,14 @@ var OHLCV_INDICATORS;
|
|
|
1927
2129
|
dateCompleteDateString: function(t) {
|
|
1928
2130
|
return new Date(t);
|
|
1929
2131
|
}
|
|
1930
|
-
},
|
|
2132
|
+
}, ar = function(t) {
|
|
1931
2133
|
// Regex for a UTC Time Format where the string ends with "Z".
|
|
1932
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() {
|
|
1933
|
-
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- ")));
|
|
1934
2136
|
};
|
|
1935
2137
|
// Regex for a Timezone Offset Format,
|
|
1936
2138
|
// which includes a plus or minus sign followed by HH:MM at the end.
|
|
1937
|
-
if ("object" ===
|
|
2139
|
+
if ("object" === nr(t)) {
|
|
1938
2140
|
if (t instanceof Date && !isNaN(t.valueOf())) return "dateObject";
|
|
1939
2141
|
r();
|
|
1940
2142
|
} else {
|
|
@@ -1951,7 +2153,7 @@ var OHLCV_INDICATORS;
|
|
|
1951
2153
|
}
|
|
1952
2154
|
};
|
|
1953
2155
|
// ./src/utilities/assignTypes.js
|
|
1954
|
-
function
|
|
2156
|
+
function ur(t, e) {
|
|
1955
2157
|
return function(t) {
|
|
1956
2158
|
if (Array.isArray(t)) return t;
|
|
1957
2159
|
}(t) || function(t, e) {
|
|
@@ -1976,24 +2178,24 @@ var OHLCV_INDICATORS;
|
|
|
1976
2178
|
}
|
|
1977
2179
|
}(t, e) || function(t, e) {
|
|
1978
2180
|
if (t) {
|
|
1979
|
-
if ("string" == typeof t) return
|
|
2181
|
+
if ("string" == typeof t) return lr(t, e);
|
|
1980
2182
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1981
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
1982
2184
|
}
|
|
1983
2185
|
}(t, e) || function() {
|
|
1984
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.");
|
|
1985
2187
|
}();
|
|
1986
2188
|
}
|
|
1987
|
-
function
|
|
2189
|
+
function lr(t, e) {
|
|
1988
2190
|
(null == e || e > t.length) && (e = t.length);
|
|
1989
2191
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1990
2192
|
return n;
|
|
1991
2193
|
}
|
|
1992
|
-
var
|
|
2194
|
+
var cr = new Set([ "open", "high", "low", "close" ]), sr = function(t, e) {
|
|
1993
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;
|
|
1994
2196
|
};
|
|
1995
2197
|
// ./src/studies/lag.js
|
|
1996
|
-
function
|
|
2198
|
+
function fr(t, e) {
|
|
1997
2199
|
return function(t) {
|
|
1998
2200
|
if (Array.isArray(t)) return t;
|
|
1999
2201
|
}(t) || function(t, e) {
|
|
@@ -2016,14 +2218,14 @@ var OHLCV_INDICATORS;
|
|
|
2016
2218
|
}
|
|
2017
2219
|
return u;
|
|
2018
2220
|
}
|
|
2019
|
-
}(t, e) ||
|
|
2221
|
+
}(t, e) || pr(t, e) || function() {
|
|
2020
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.");
|
|
2021
2223
|
}();
|
|
2022
2224
|
}
|
|
2023
|
-
function
|
|
2225
|
+
function yr(t, e) {
|
|
2024
2226
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2025
2227
|
if (!r) {
|
|
2026
|
-
if (Array.isArray(t) || (r =
|
|
2228
|
+
if (Array.isArray(t) || (r = pr(t)) || e && t && "number" == typeof t.length) {
|
|
2027
2229
|
r && (t = r);
|
|
2028
2230
|
var n = 0, o = function() {};
|
|
2029
2231
|
return {
|
|
@@ -2065,22 +2267,22 @@ var OHLCV_INDICATORS;
|
|
|
2065
2267
|
}
|
|
2066
2268
|
};
|
|
2067
2269
|
}
|
|
2068
|
-
function
|
|
2270
|
+
function pr(t, e) {
|
|
2069
2271
|
if (t) {
|
|
2070
|
-
if ("string" == typeof t) return
|
|
2272
|
+
if ("string" == typeof t) return hr(t, e);
|
|
2071
2273
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2072
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
2073
2275
|
}
|
|
2074
2276
|
}
|
|
2075
|
-
function
|
|
2277
|
+
function hr(t, e) {
|
|
2076
2278
|
(null == e || e > t.length) && (e = t.length);
|
|
2077
2279
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2078
2280
|
return n;
|
|
2079
2281
|
}
|
|
2080
|
-
var
|
|
2282
|
+
var vr = function(t, e) {
|
|
2081
2283
|
var r = t.instances, n = t.verticalOhlcv, o = t.len, i = t.arrayTypes, a = t.priceBased;
|
|
2082
2284
|
if (0 === e) {
|
|
2083
|
-
var u, l = [], c =
|
|
2285
|
+
var u, l = [], c = yr(t.inputParams);
|
|
2084
2286
|
try {
|
|
2085
2287
|
for (c.s(); !(u = c.n()).done; ) {
|
|
2086
2288
|
var s = u.value;
|
|
@@ -2092,10 +2294,10 @@ var OHLCV_INDICATORS;
|
|
|
2092
2294
|
c.f();
|
|
2093
2295
|
}
|
|
2094
2296
|
for (var f = 0, y = l; f < y.length; f++) {
|
|
2095
|
-
var
|
|
2297
|
+
var p, h = fr(y[f], 2), v = h[0], m = h[1], d = yr(v);
|
|
2096
2298
|
try {
|
|
2097
|
-
for (d.s(); !(
|
|
2098
|
-
var b =
|
|
2299
|
+
for (d.s(); !(p = d.n()).done; ) {
|
|
2300
|
+
var b = p.value;
|
|
2099
2301
|
if (a.has(b)) for (var g = 1; g <= m; g++) a.add("".concat(b, "_lag_").concat(g));
|
|
2100
2302
|
}
|
|
2101
2303
|
} catch (t) {
|
|
@@ -2108,22 +2310,22 @@ var OHLCV_INDICATORS;
|
|
|
2108
2310
|
lagParams: l
|
|
2109
2311
|
};
|
|
2110
2312
|
}
|
|
2111
|
-
var w,
|
|
2313
|
+
var w, O = yr(r.lag.lagParams);
|
|
2112
2314
|
try {
|
|
2113
|
-
for (
|
|
2114
|
-
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);
|
|
2115
2317
|
try {
|
|
2116
|
-
for (N.s(); !(
|
|
2117
|
-
var
|
|
2318
|
+
for (N.s(); !(S = N.n()).done; ) {
|
|
2319
|
+
var T = S.value, A = n[T];
|
|
2118
2320
|
// Initialize lagged arrays only on the first index
|
|
2119
2321
|
if (0 === e) for (var E = 1; E <= _; E++) {
|
|
2120
|
-
var k = "".concat(
|
|
2121
|
-
if (!i.hasOwnProperty(
|
|
2122
|
-
n[k] =
|
|
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];
|
|
2123
2325
|
}
|
|
2124
2326
|
// Populate lagged values
|
|
2125
2327
|
for (var x = 1; x <= _; x++) {
|
|
2126
|
-
var I = "".concat(
|
|
2328
|
+
var I = "".concat(T, "_lag_").concat(x), D = e - x, M = D <= 0 || void 0 === A[D] ? null : A[D];
|
|
2127
2329
|
t.pushToMain({
|
|
2128
2330
|
index: e,
|
|
2129
2331
|
key: I,
|
|
@@ -2138,21 +2340,21 @@ var OHLCV_INDICATORS;
|
|
|
2138
2340
|
}
|
|
2139
2341
|
}
|
|
2140
2342
|
} catch (t) {
|
|
2141
|
-
|
|
2343
|
+
O.e(t);
|
|
2142
2344
|
} finally {
|
|
2143
|
-
|
|
2345
|
+
O.f();
|
|
2144
2346
|
}
|
|
2145
2347
|
return !0;
|
|
2146
2348
|
};
|
|
2147
2349
|
// ./src/studies/findCrosses.js
|
|
2148
|
-
function
|
|
2350
|
+
function mr(t, e) {
|
|
2149
2351
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2150
2352
|
if (!r) {
|
|
2151
2353
|
if (Array.isArray(t) || (r = function(t, e) {
|
|
2152
2354
|
if (t) {
|
|
2153
|
-
if ("string" == typeof t) return
|
|
2355
|
+
if ("string" == typeof t) return dr(t, e);
|
|
2154
2356
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2155
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
2156
2358
|
}
|
|
2157
2359
|
}(t)) || e && t && "number" == typeof t.length) {
|
|
2158
2360
|
r && (t = r);
|
|
@@ -2196,43 +2398,43 @@ var OHLCV_INDICATORS;
|
|
|
2196
2398
|
}
|
|
2197
2399
|
};
|
|
2198
2400
|
}
|
|
2199
|
-
function
|
|
2401
|
+
function dr(t, e) {
|
|
2200
2402
|
(null == e || e > t.length) && (e = t.length);
|
|
2201
2403
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2202
2404
|
return n;
|
|
2203
2405
|
}
|
|
2204
|
-
function
|
|
2205
|
-
return
|
|
2406
|
+
function br(t) {
|
|
2407
|
+
return br = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2206
2408
|
return typeof t;
|
|
2207
2409
|
} : function(t) {
|
|
2208
2410
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2209
|
-
},
|
|
2411
|
+
}, br(t);
|
|
2210
2412
|
}
|
|
2211
|
-
function
|
|
2413
|
+
function gr(t, e) {
|
|
2212
2414
|
for (var r = 0; r < e.length; r++) {
|
|
2213
2415
|
var n = e[r];
|
|
2214
2416
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
2215
|
-
Object.defineProperty(t,
|
|
2417
|
+
Object.defineProperty(t, wr(n.key), n);
|
|
2216
2418
|
}
|
|
2217
2419
|
}
|
|
2218
|
-
function
|
|
2420
|
+
function wr(t) {
|
|
2219
2421
|
var e = function(t, e) {
|
|
2220
|
-
if ("object" !=
|
|
2422
|
+
if ("object" != br(t) || !t) return t;
|
|
2221
2423
|
var r = t[Symbol.toPrimitive];
|
|
2222
2424
|
if (void 0 !== r) {
|
|
2223
2425
|
var n = r.call(t, e || "default");
|
|
2224
|
-
if ("object" !=
|
|
2426
|
+
if ("object" != br(n)) return n;
|
|
2225
2427
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2226
2428
|
}
|
|
2227
2429
|
return ("string" === e ? String : Number)(t);
|
|
2228
2430
|
}(t, "string");
|
|
2229
|
-
return "symbol" ==
|
|
2431
|
+
return "symbol" == br(e) ? e : e + "";
|
|
2230
2432
|
}
|
|
2231
|
-
var
|
|
2433
|
+
var Or = function(t, e) {
|
|
2232
2434
|
return t > e;
|
|
2233
|
-
},
|
|
2435
|
+
}, Sr = function(t, e) {
|
|
2234
2436
|
return t < e;
|
|
2235
|
-
},
|
|
2437
|
+
}, jr = function() {
|
|
2236
2438
|
return t = function t() {
|
|
2237
2439
|
!function(t, e) {
|
|
2238
2440
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -2256,11 +2458,11 @@ var OHLCV_INDICATORS;
|
|
|
2256
2458
|
this.areHighAndLowUndefined || void 0 !== n && void 0 !== i || (this.areHighAndLowUndefined = !0),
|
|
2257
2459
|
Number.isNaN(r) || Number.isNaN(o) || function(t, e) {
|
|
2258
2460
|
return t === e;
|
|
2259
|
-
}(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) {
|
|
2260
2462
|
return !Number.isNaN(t);
|
|
2261
|
-
})) &&
|
|
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) {
|
|
2262
2464
|
return !Number.isNaN(t);
|
|
2263
|
-
})) &&
|
|
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--),
|
|
2264
2466
|
1 === this.interval && this.crossIndexes.up.push(t), -1 === this.interval && this.crossIndexes.down.push(t),
|
|
2265
2467
|
//save prev state
|
|
2266
2468
|
Object.assign(this, {
|
|
@@ -2276,21 +2478,21 @@ var OHLCV_INDICATORS;
|
|
|
2276
2478
|
value: function() {
|
|
2277
2479
|
return this.interval;
|
|
2278
2480
|
}
|
|
2279
|
-
} ]) &&
|
|
2481
|
+
} ]) && gr(t.prototype, e), r && gr(t, r), Object.defineProperty(t, "prototype", {
|
|
2280
2482
|
writable: !1
|
|
2281
2483
|
}), t;
|
|
2282
2484
|
var t, e, r;
|
|
2283
|
-
}(),
|
|
2485
|
+
}(), Pr = function(t, e) {
|
|
2284
2486
|
var r = t.verticalOhlcv, n = t.instances, o = t.len, i = t.arrayTypes, a = t.verticalOhlcvTempCols;
|
|
2285
2487
|
if (0 === e) {
|
|
2286
2488
|
var u = t.inputParams;
|
|
2287
2489
|
n.crossPairsList = u.reduce((function(t, e) {
|
|
2288
2490
|
var r = e.key, n = e.params;
|
|
2289
2491
|
if ("crossPairs" === r) {
|
|
2290
|
-
var o, i =
|
|
2492
|
+
var o, i = mr(n);
|
|
2291
2493
|
try {
|
|
2292
2494
|
for (i.s(); !(o = i.n()).done; ) {
|
|
2293
|
-
var a, u =
|
|
2495
|
+
var a, u = mr(o.value);
|
|
2294
2496
|
try {
|
|
2295
2497
|
for (u.s(); !(a = u.n()).done; ) {
|
|
2296
2498
|
var l = a.value;
|
|
@@ -2311,31 +2513,31 @@ var OHLCV_INDICATORS;
|
|
|
2311
2513
|
return t;
|
|
2312
2514
|
}), []);
|
|
2313
2515
|
}
|
|
2314
|
-
var l, c =
|
|
2516
|
+
var l, c = mr(n.crossPairsList);
|
|
2315
2517
|
try {
|
|
2316
2518
|
for (c.s(); !(l = c.n()).done; ) {
|
|
2317
2519
|
var s = l.value, f = s.fast, y = s.slow;
|
|
2318
2520
|
if (null != f && null != y) {
|
|
2319
|
-
var
|
|
2521
|
+
var p = "".concat(f, "_x_").concat(y);
|
|
2320
2522
|
if (0 === e) {
|
|
2321
2523
|
if ("number" == typeof y && (a.add(y.toString()), r[y.toString()] = new Int32Array(o).fill(y)),
|
|
2322
2524
|
"price" !== f && !r.hasOwnProperty(f)) throw Error('fast "'.concat(f, ' not found in crossPairs"'));
|
|
2323
2525
|
if (!r.hasOwnProperty(y)) throw Error('slow "'.concat(y, ' not found in crossPairs"'));
|
|
2324
|
-
n[
|
|
2526
|
+
n[p] = new jr, r[p] = new Int32Array(o).fill(NaN), i[p] = "Int32Array";
|
|
2325
2527
|
}
|
|
2326
|
-
var
|
|
2327
|
-
"price" === f ? (v = r.close[e], m = r.high[e], d = r.low[e], b = r[y][e], n[
|
|
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, {
|
|
2328
2530
|
fast: v,
|
|
2329
2531
|
slow: b,
|
|
2330
2532
|
high: m,
|
|
2331
2533
|
low: d
|
|
2332
|
-
})) : (
|
|
2333
|
-
fast:
|
|
2534
|
+
})) : (h = r[f][e], b = r[y][e], n[p].update(e, {
|
|
2535
|
+
fast: h,
|
|
2334
2536
|
slow: b
|
|
2335
2537
|
})), t.pushToMain({
|
|
2336
2538
|
index: e,
|
|
2337
|
-
key:
|
|
2338
|
-
value: n[
|
|
2539
|
+
key: p,
|
|
2540
|
+
value: n[p].getResult()
|
|
2339
2541
|
});
|
|
2340
2542
|
}
|
|
2341
2543
|
}
|
|
@@ -2346,14 +2548,14 @@ var OHLCV_INDICATORS;
|
|
|
2346
2548
|
}
|
|
2347
2549
|
};
|
|
2348
2550
|
// ./src/studies/dateTime.js
|
|
2349
|
-
function
|
|
2350
|
-
return
|
|
2551
|
+
function _r(t) {
|
|
2552
|
+
return _r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2351
2553
|
return typeof t;
|
|
2352
2554
|
} : function(t) {
|
|
2353
2555
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2354
|
-
},
|
|
2556
|
+
}, _r(t);
|
|
2355
2557
|
}
|
|
2356
|
-
function
|
|
2558
|
+
function Nr(t, e) {
|
|
2357
2559
|
var r = Object.keys(t);
|
|
2358
2560
|
if (Object.getOwnPropertySymbols) {
|
|
2359
2561
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -2363,19 +2565,19 @@ var OHLCV_INDICATORS;
|
|
|
2363
2565
|
}
|
|
2364
2566
|
return r;
|
|
2365
2567
|
}
|
|
2366
|
-
function
|
|
2568
|
+
function Tr(t, e, r) {
|
|
2367
2569
|
return (e = function(t) {
|
|
2368
2570
|
var e = function(t, e) {
|
|
2369
|
-
if ("object" !=
|
|
2571
|
+
if ("object" != _r(t) || !t) return t;
|
|
2370
2572
|
var r = t[Symbol.toPrimitive];
|
|
2371
2573
|
if (void 0 !== r) {
|
|
2372
2574
|
var n = r.call(t, e || "default");
|
|
2373
|
-
if ("object" !=
|
|
2575
|
+
if ("object" != _r(n)) return n;
|
|
2374
2576
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2375
2577
|
}
|
|
2376
2578
|
return ("string" === e ? String : Number)(t);
|
|
2377
2579
|
}(t, "string");
|
|
2378
|
-
return "symbol" ==
|
|
2580
|
+
return "symbol" == _r(e) ? e : e + "";
|
|
2379
2581
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
2380
2582
|
value: r,
|
|
2381
2583
|
enumerable: !0,
|
|
@@ -2383,7 +2585,7 @@ var OHLCV_INDICATORS;
|
|
|
2383
2585
|
writable: !0
|
|
2384
2586
|
}) : t[e] = r, t;
|
|
2385
2587
|
}
|
|
2386
|
-
var
|
|
2588
|
+
var Ar = function(t) {
|
|
2387
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();
|
|
2388
2590
|
return {
|
|
2389
2591
|
month: e,
|
|
@@ -2396,19 +2598,19 @@ var OHLCV_INDICATORS;
|
|
|
2396
2598
|
};
|
|
2397
2599
|
};
|
|
2398
2600
|
// ./src/studies/scaler.js
|
|
2399
|
-
function
|
|
2601
|
+
function Er(t) {
|
|
2400
2602
|
return function(t) {
|
|
2401
|
-
if (Array.isArray(t)) return
|
|
2603
|
+
if (Array.isArray(t)) return Dr(t);
|
|
2402
2604
|
}(t) || function(t) {
|
|
2403
2605
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2404
|
-
}(t) ||
|
|
2606
|
+
}(t) || Ir(t) || function() {
|
|
2405
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.");
|
|
2406
2608
|
}();
|
|
2407
2609
|
}
|
|
2408
|
-
function
|
|
2610
|
+
function kr(t, e) {
|
|
2409
2611
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2410
2612
|
if (!r) {
|
|
2411
|
-
if (Array.isArray(t) || (r =
|
|
2613
|
+
if (Array.isArray(t) || (r = Ir(t)) || e && t && "number" == typeof t.length) {
|
|
2412
2614
|
r && (t = r);
|
|
2413
2615
|
var n = 0, o = function() {};
|
|
2414
2616
|
return {
|
|
@@ -2450,7 +2652,7 @@ var OHLCV_INDICATORS;
|
|
|
2450
2652
|
}
|
|
2451
2653
|
};
|
|
2452
2654
|
}
|
|
2453
|
-
function
|
|
2655
|
+
function xr(t, e) {
|
|
2454
2656
|
return function(t) {
|
|
2455
2657
|
if (Array.isArray(t)) return t;
|
|
2456
2658
|
}
|
|
@@ -2474,36 +2676,36 @@ var OHLCV_INDICATORS;
|
|
|
2474
2676
|
}
|
|
2475
2677
|
return u;
|
|
2476
2678
|
}
|
|
2477
|
-
}(t, e) ||
|
|
2679
|
+
}(t, e) || Ir(t, e) || function() {
|
|
2478
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.");
|
|
2479
2681
|
}();
|
|
2480
2682
|
}
|
|
2481
|
-
function
|
|
2683
|
+
function Ir(t, e) {
|
|
2482
2684
|
if (t) {
|
|
2483
|
-
if ("string" == typeof t) return
|
|
2685
|
+
if ("string" == typeof t) return Dr(t, e);
|
|
2484
2686
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2485
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
2486
2688
|
}
|
|
2487
2689
|
}
|
|
2488
|
-
function
|
|
2690
|
+
function Dr(t, e) {
|
|
2489
2691
|
(null == e || e > t.length) && (e = t.length);
|
|
2490
2692
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2491
2693
|
return n;
|
|
2492
2694
|
}
|
|
2493
2695
|
// ./src/core-functions/mainLoop.js
|
|
2494
|
-
function
|
|
2696
|
+
function Mr(t) {
|
|
2495
2697
|
return function(t) {
|
|
2496
|
-
if (Array.isArray(t)) return
|
|
2698
|
+
if (Array.isArray(t)) return Lr(t);
|
|
2497
2699
|
}(t) || function(t) {
|
|
2498
2700
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2499
|
-
}(t) ||
|
|
2701
|
+
}(t) || Fr(t) || function() {
|
|
2500
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.");
|
|
2501
2703
|
}();
|
|
2502
2704
|
}
|
|
2503
|
-
function
|
|
2705
|
+
function Rr(t, e) {
|
|
2504
2706
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2505
2707
|
if (!r) {
|
|
2506
|
-
if (Array.isArray(t) || (r =
|
|
2708
|
+
if (Array.isArray(t) || (r = Fr(t)) || e && t && "number" == typeof t.length) {
|
|
2507
2709
|
r && (t = r);
|
|
2508
2710
|
var n = 0, o = function() {};
|
|
2509
2711
|
return {
|
|
@@ -2545,7 +2747,7 @@ var OHLCV_INDICATORS;
|
|
|
2545
2747
|
}
|
|
2546
2748
|
};
|
|
2547
2749
|
}
|
|
2548
|
-
function
|
|
2750
|
+
function Cr(t, e) {
|
|
2549
2751
|
return function(t) {
|
|
2550
2752
|
if (Array.isArray(t)) return t;
|
|
2551
2753
|
}
|
|
@@ -2570,23 +2772,23 @@ var OHLCV_INDICATORS;
|
|
|
2570
2772
|
}
|
|
2571
2773
|
return u;
|
|
2572
2774
|
}
|
|
2573
|
-
}(t, e) ||
|
|
2775
|
+
}(t, e) || Fr(t, e) || function() {
|
|
2574
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.");
|
|
2575
2777
|
}();
|
|
2576
2778
|
}
|
|
2577
|
-
function
|
|
2779
|
+
function Fr(t, e) {
|
|
2578
2780
|
if (t) {
|
|
2579
|
-
if ("string" == typeof t) return
|
|
2781
|
+
if ("string" == typeof t) return Lr(t, e);
|
|
2580
2782
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2581
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
2582
2784
|
}
|
|
2583
2785
|
}
|
|
2584
|
-
function
|
|
2786
|
+
function Lr(t, e) {
|
|
2585
2787
|
(null == e || e > t.length) && (e = t.length);
|
|
2586
2788
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2587
2789
|
return n;
|
|
2588
2790
|
}
|
|
2589
|
-
var
|
|
2791
|
+
var Br = {
|
|
2590
2792
|
dateTime: function(t, e, r) {
|
|
2591
2793
|
var n = r.lag, o = t.instances, i = t.verticalOhlcv;
|
|
2592
2794
|
if (0 === e) {
|
|
@@ -2606,9 +2808,9 @@ var OHLCV_INDICATORS;
|
|
|
2606
2808
|
Object.assign(i, function(t) {
|
|
2607
2809
|
for (var e = 1; e < arguments.length; e++) {
|
|
2608
2810
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2609
|
-
e % 2 ?
|
|
2610
|
-
|
|
2611
|
-
})) : 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) {
|
|
2612
2814
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2613
2815
|
}));
|
|
2614
2816
|
}
|
|
@@ -2617,8 +2819,8 @@ var OHLCV_INDICATORS;
|
|
|
2617
2819
|
return [ t, new Int32Array(a).fill(NaN) ];
|
|
2618
2820
|
}))))), n > 0 && t.lag(c, n);
|
|
2619
2821
|
}
|
|
2620
|
-
var y = i.date[e],
|
|
2621
|
-
|
|
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++,
|
|
2622
2824
|
o.dateTime.sessionIntradayIndexCount = 0), t.pushToMain({
|
|
2623
2825
|
index: e,
|
|
2624
2826
|
key: "session_daily_index",
|
|
@@ -2630,7 +2832,7 @@ var OHLCV_INDICATORS;
|
|
|
2630
2832
|
}), t.pushToMain({
|
|
2631
2833
|
index: e,
|
|
2632
2834
|
key: "day_of_the_week",
|
|
2633
|
-
value:
|
|
2835
|
+
value: h
|
|
2634
2836
|
}), t.pushToMain({
|
|
2635
2837
|
index: e,
|
|
2636
2838
|
key: "day_of_the_month",
|
|
@@ -2661,17 +2863,17 @@ var OHLCV_INDICATORS;
|
|
|
2661
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);
|
|
2662
2864
|
// Initialization on the first index.
|
|
2663
2865
|
if (0 === e) {
|
|
2664
|
-
var f = t.crossPairsList, y = t.len,
|
|
2866
|
+
var f = t.crossPairsList, y = t.len, p = t.arrayTypes;
|
|
2665
2867
|
if (!a.hasOwnProperty(o)) throw new Error("Target property ".concat(o, " not found in verticalOhlcv for rsi."));
|
|
2666
2868
|
f.push({
|
|
2667
2869
|
fast: c,
|
|
2668
2870
|
slow: s,
|
|
2669
2871
|
isDefault: !0
|
|
2670
|
-
}), Object.assign(u,
|
|
2671
|
-
var
|
|
2672
|
-
i > 0 && t.lag(
|
|
2673
|
-
for (var v = 0, m =
|
|
2674
|
-
|
|
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";
|
|
2675
2877
|
}
|
|
2676
2878
|
}
|
|
2677
2879
|
var d = a[o][e], b = NaN, g = NaN;
|
|
@@ -2702,15 +2904,41 @@ var OHLCV_INDICATORS;
|
|
|
2702
2904
|
value: g
|
|
2703
2905
|
});
|
|
2704
2906
|
},
|
|
2705
|
-
|
|
2706
|
-
|
|
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,
|
|
2707
2935
|
macd: function(t, e, r, n, o, i) {
|
|
2708
2936
|
var a = i.target, u = i.lag, l = i.precomputed, c = t.verticalOhlcv, s = t.instances, f = l.instanceKey;
|
|
2709
2937
|
// Initialization on the first index.
|
|
2710
2938
|
if (0 === e) {
|
|
2711
|
-
var y = t.inputParams,
|
|
2939
|
+
var y = t.inputParams, p = t.crossPairsList, h = t.priceBased, v = t.len, m = t.arrayTypes;
|
|
2712
2940
|
if (!c.hasOwnProperty(a)) throw new Error("Target property ".concat(a, " not found in verticalOhlcv for macd."));
|
|
2713
|
-
var d, b = 0, g =
|
|
2941
|
+
var d, b = 0, g = He(y);
|
|
2714
2942
|
try {
|
|
2715
2943
|
for (g.s(); !(d = g.n()).done; ) {
|
|
2716
2944
|
"macd" === d.value.key && b++;
|
|
@@ -2721,25 +2949,25 @@ var OHLCV_INDICATORS;
|
|
|
2721
2949
|
} finally {
|
|
2722
2950
|
g.f();
|
|
2723
2951
|
}
|
|
2724
|
-
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);
|
|
2725
2953
|
// Build the keys.
|
|
2726
|
-
|
|
2727
|
-
fast:
|
|
2728
|
-
slow:
|
|
2954
|
+
p.push({
|
|
2955
|
+
fast: O,
|
|
2956
|
+
slow: S,
|
|
2729
2957
|
isDefault: !0
|
|
2730
2958
|
}), s.hasOwnProperty("macd") || (s.macd = {
|
|
2731
2959
|
numberOfIndicators: b,
|
|
2732
2960
|
settings: {}
|
|
2733
|
-
}), s.macd.settings[f] = new
|
|
2734
|
-
|
|
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);
|
|
2735
2963
|
}));
|
|
2736
|
-
var P = [
|
|
2964
|
+
var P = [ O, S, j ];
|
|
2737
2965
|
u > 0 && t.lag(P, u);
|
|
2738
2966
|
for (var _ = 0, N = P; _ < N.length; _++) {
|
|
2739
2967
|
m[N[_]] = "Float64Array";
|
|
2740
2968
|
}
|
|
2741
2969
|
}
|
|
2742
|
-
var
|
|
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];
|
|
2743
2971
|
M.update(R);
|
|
2744
2972
|
var C = {};
|
|
2745
2973
|
try {
|
|
@@ -2777,16 +3005,16 @@ var OHLCV_INDICATORS;
|
|
|
2777
3005
|
try {
|
|
2778
3006
|
y = f.getResult();
|
|
2779
3007
|
} catch (t) {}
|
|
2780
|
-
var
|
|
3008
|
+
var p = a[i].prevRelativeVolumeSma, h = NaN;
|
|
2781
3009
|
// Only calculate relative volume if both current SMA and previous SMA are valid numbers and prevSma is not zero.
|
|
2782
|
-
return Number.isNaN(y) || Number.isNaN(
|
|
3010
|
+
return Number.isNaN(y) || Number.isNaN(p) || (h = s / p), t.pushToMain({
|
|
2783
3011
|
index: e,
|
|
2784
3012
|
key: i,
|
|
2785
|
-
value:
|
|
3013
|
+
value: h
|
|
2786
3014
|
}), a[i].prevRelativeVolumeSma = y, !0;
|
|
2787
3015
|
},
|
|
2788
3016
|
donchianChannels: function(t, e, r, n, o) {
|
|
2789
|
-
var i = t.verticalOhlcv, a = t.instances, u = t.len, l = t.inputParams, c = t.priceBased, s = t.arrayTypes, f = t.lag, y = o.height,
|
|
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);
|
|
2790
3018
|
// ---- INIT (only at first bar) ----
|
|
2791
3019
|
if (0 === e) {
|
|
2792
3020
|
// how many donchianChannels calls in this session?
|
|
@@ -2796,10 +3024,10 @@ var OHLCV_INDICATORS;
|
|
|
2796
3024
|
return "".concat(b, "_").concat(t);
|
|
2797
3025
|
}));
|
|
2798
3026
|
y && g.push("".concat(b, "_height"));
|
|
2799
|
-
var w,
|
|
3027
|
+
var w, O = function(t, e) {
|
|
2800
3028
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2801
3029
|
if (!r) {
|
|
2802
|
-
if (Array.isArray(t) || (r =
|
|
3030
|
+
if (Array.isArray(t) || (r = Ye(t)) || e && t && "number" == typeof t.length) {
|
|
2803
3031
|
r && (t = r);
|
|
2804
3032
|
var n = 0, o = function() {};
|
|
2805
3033
|
return {
|
|
@@ -2840,18 +3068,18 @@ var OHLCV_INDICATORS;
|
|
|
2840
3068
|
}
|
|
2841
3069
|
}
|
|
2842
3070
|
};
|
|
2843
|
-
}(
|
|
3071
|
+
}(p);
|
|
2844
3072
|
try {
|
|
2845
|
-
for (
|
|
2846
|
-
var
|
|
2847
|
-
if (!(
|
|
2848
|
-
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));
|
|
2849
3077
|
}
|
|
2850
3078
|
// bootstrap instance
|
|
2851
3079
|
} catch (t) {
|
|
2852
|
-
|
|
3080
|
+
O.e(t);
|
|
2853
3081
|
} finally {
|
|
2854
|
-
|
|
3082
|
+
O.f();
|
|
2855
3083
|
}
|
|
2856
3084
|
a.donchian_channel || (a.donchian_channel = {
|
|
2857
3085
|
numberOfIndicators: m,
|
|
@@ -2874,15 +3102,15 @@ var OHLCV_INDICATORS;
|
|
|
2874
3102
|
}));
|
|
2875
3103
|
}
|
|
2876
3104
|
// ---- PER-BAR COMPUTATION ----
|
|
2877
|
-
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) {
|
|
2878
3106
|
return "".concat(N, "_").concat(t);
|
|
2879
3107
|
}));
|
|
2880
3108
|
y && I.push("".concat(N, "_height"));
|
|
2881
|
-
var D =
|
|
3109
|
+
var D = p.map((function(t) {
|
|
2882
3110
|
return "".concat(N, "_range_").concat(t);
|
|
2883
3111
|
}));
|
|
2884
3112
|
// not enough data → push NaNs
|
|
2885
|
-
if (x < 0 || k + 1 > u) return [].concat(
|
|
3113
|
+
if (x < 0 || k + 1 > u) return [].concat(Ke(I), Ke(D)).forEach((function(r) {
|
|
2886
3114
|
return t.pushToMain({
|
|
2887
3115
|
index: e,
|
|
2888
3116
|
key: r,
|
|
@@ -2895,13 +3123,13 @@ var OHLCV_INDICATORS;
|
|
|
2895
3123
|
t.push(k);
|
|
2896
3124
|
};
|
|
2897
3125
|
// tiny helper to keep deques up-to-date
|
|
2898
|
-
C(
|
|
3126
|
+
C(A, M, (function(t, e) {
|
|
2899
3127
|
return t <= e;
|
|
2900
3128
|
})), C(E, R, (function(t, e) {
|
|
2901
3129
|
return t >= e;
|
|
2902
3130
|
}));
|
|
2903
3131
|
// single “bounds exist?” flag instead of repeated isNaN
|
|
2904
|
-
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;
|
|
2905
3133
|
if (t.pushToMain({
|
|
2906
3134
|
index: e,
|
|
2907
3135
|
key: "".concat(N, "_upper"),
|
|
@@ -2920,53 +3148,53 @@ var OHLCV_INDICATORS;
|
|
|
2920
3148
|
t.pushToMain({
|
|
2921
3149
|
index: e,
|
|
2922
3150
|
key: "".concat(N, "_height"),
|
|
2923
|
-
value: null ===
|
|
3151
|
+
value: null === h ? V : Ge(V, h)
|
|
2924
3152
|
});
|
|
2925
3153
|
}
|
|
2926
3154
|
// precompute spread once
|
|
2927
3155
|
// for each extra range key, use price===price to skip NaNs
|
|
2928
|
-
for (var U = F ? L - B : NaN, $ = 0; $ <
|
|
2929
|
-
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;
|
|
2930
3158
|
t.pushToMain({
|
|
2931
3159
|
index: e,
|
|
2932
3160
|
key: D[$],
|
|
2933
|
-
value: null ===
|
|
3161
|
+
value: null === h ? z : Ge(z, h)
|
|
2934
3162
|
});
|
|
2935
3163
|
}
|
|
2936
3164
|
return !0;
|
|
2937
3165
|
},
|
|
2938
3166
|
bollingerBands: function(t, e, r, n, o) {
|
|
2939
|
-
var i, a, u, l, c, s, f, y = o.height,
|
|
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);
|
|
2940
3168
|
// Initialization on the first call.
|
|
2941
3169
|
if (0 === e) {
|
|
2942
|
-
var
|
|
3170
|
+
var S = t.priceBased, j = t.inputParams, P = t.verticalOhlcv, _ = t.len, N = t.arrayTypes;
|
|
2943
3171
|
if (!(v in P)) throw new Error('bollingerBands could not find target "'.concat(v, '"'));
|
|
2944
|
-
var
|
|
3172
|
+
var T, A = 0, E = Xe(j);
|
|
2945
3173
|
try {
|
|
2946
|
-
for (E.s(); !(
|
|
2947
|
-
"bollingerBands" ===
|
|
3174
|
+
for (E.s(); !(T = E.n()).done; ) {
|
|
3175
|
+
"bollingerBands" === T.value.key && A++;
|
|
2948
3176
|
}
|
|
2949
3177
|
} catch (t) {
|
|
2950
3178
|
E.e(t);
|
|
2951
3179
|
} finally {
|
|
2952
3180
|
E.f();
|
|
2953
3181
|
}
|
|
2954
|
-
f =
|
|
3182
|
+
f = A > 1 ? "bollinger_bands_".concat(O) : "bollinger_bands".concat(w),
|
|
2955
3183
|
// Only create the container if it doesn't already exist.
|
|
2956
3184
|
g.bollinger_bands || (g.bollinger_bands = {
|
|
2957
|
-
numberOfIndicators:
|
|
3185
|
+
numberOfIndicators: A,
|
|
2958
3186
|
settings: {}
|
|
2959
3187
|
}),
|
|
2960
3188
|
// Add (or override) the indicator instance keyed by indicatorKey.
|
|
2961
|
-
g.bollinger_bands.settings[
|
|
3189
|
+
g.bollinger_bands.settings[O] = new ee(r, n);
|
|
2962
3190
|
var k = [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ];
|
|
2963
3191
|
y && k.push("".concat(f, "_height"));
|
|
2964
3192
|
// Set up additional arrays for each range property.
|
|
2965
|
-
var x, I =
|
|
3193
|
+
var x, I = Xe(h);
|
|
2966
3194
|
try {
|
|
2967
3195
|
for (I.s(); !(x = I.n()).done; ) {
|
|
2968
3196
|
var D = x.value;
|
|
2969
|
-
if (!(D in P) || !
|
|
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)));
|
|
2970
3198
|
k.push("".concat(f, "_range_").concat(D));
|
|
2971
3199
|
}
|
|
2972
3200
|
} catch (t) {
|
|
@@ -2980,23 +3208,23 @@ var OHLCV_INDICATORS;
|
|
|
2980
3208
|
Object.assign(P, function(t) {
|
|
2981
3209
|
for (var e = 1; e < arguments.length; e++) {
|
|
2982
3210
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2983
|
-
e % 2 ?
|
|
2984
|
-
|
|
2985
|
-
})) : 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) {
|
|
2986
3214
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2987
3215
|
}));
|
|
2988
3216
|
}
|
|
2989
3217
|
return t;
|
|
2990
3218
|
}({}, M)), m > 0 && t.lag(k, m), [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ].forEach((function(t) {
|
|
2991
|
-
|
|
3219
|
+
S.add(t);
|
|
2992
3220
|
}));
|
|
2993
3221
|
for (var R = 0, C = k; R < C.length; R++) {
|
|
2994
3222
|
N[C[R]] = "Float64Array";
|
|
2995
3223
|
}
|
|
2996
3224
|
}
|
|
2997
3225
|
// Derive prefix for subsequent calls if not set.
|
|
2998
|
-
f || (f = g.bollinger_bands.numberOfIndicators > 1 ? "bollinger_bands_".concat(
|
|
2999
|
-
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];
|
|
3000
3228
|
// Update the indicator with the current value.
|
|
3001
3229
|
L.update(B);
|
|
3002
3230
|
// Attempt to retrieve the result.
|
|
@@ -3028,11 +3256,11 @@ var OHLCV_INDICATORS;
|
|
|
3028
3256
|
Number.isNaN($) || Number.isNaN(V) || (q = (V - $) / $), t.pushToMain({
|
|
3029
3257
|
index: e,
|
|
3030
3258
|
key: "".concat(F, "_height"),
|
|
3031
|
-
value: null === d ? q :
|
|
3259
|
+
value: null === d ? q : Ge(q, d)
|
|
3032
3260
|
});
|
|
3033
3261
|
}
|
|
3034
3262
|
// Process each range property.
|
|
3035
|
-
var z, G =
|
|
3263
|
+
var z, G = Xe(h);
|
|
3036
3264
|
try {
|
|
3037
3265
|
for (G.s(); !(z = G.n()).done; ) {
|
|
3038
3266
|
var K = z.value, Y = NaN, J = b[K][e];
|
|
@@ -3040,7 +3268,7 @@ var OHLCV_INDICATORS;
|
|
|
3040
3268
|
t.pushToMain({
|
|
3041
3269
|
index: e,
|
|
3042
3270
|
key: "".concat(F, "_range_").concat(K),
|
|
3043
|
-
value: null === d ? Y :
|
|
3271
|
+
value: null === d ? Y : Ge(Y, d)
|
|
3044
3272
|
});
|
|
3045
3273
|
}
|
|
3046
3274
|
} catch (t) {
|
|
@@ -3054,20 +3282,20 @@ var OHLCV_INDICATORS;
|
|
|
3054
3282
|
var i = o.lag, a = t.verticalOhlcv, u = t.instances, l = a.volume[e], c = "volume_oscillator_".concat(r, "_").concat(n);
|
|
3055
3283
|
if (0 === e) {
|
|
3056
3284
|
var s = t.crossPairsList, f = t.len, y = t.arrayTypes;
|
|
3057
|
-
Object.assign(u,
|
|
3058
|
-
fastEMA: new
|
|
3059
|
-
slowEMA: new
|
|
3285
|
+
Object.assign(u, rr({}, c, {
|
|
3286
|
+
fastEMA: new pe(r),
|
|
3287
|
+
slowEMA: new pe(n)
|
|
3060
3288
|
})), a[c] = new Float64Array(f).fill(NaN), s.push({
|
|
3061
3289
|
fast: c,
|
|
3062
3290
|
slow: 0,
|
|
3063
3291
|
isDefault: !0
|
|
3064
3292
|
}), i > 0 && t.lag([ c ], i), y[c] = "Float64Array";
|
|
3065
3293
|
}
|
|
3066
|
-
var
|
|
3067
|
-
|
|
3294
|
+
var p = u[c], h = p.fastEMA, v = p.slowEMA;
|
|
3295
|
+
h.update(l), v.update(l);
|
|
3068
3296
|
var m = NaN, d = NaN;
|
|
3069
3297
|
try {
|
|
3070
|
-
m =
|
|
3298
|
+
m = h.getResult();
|
|
3071
3299
|
} catch (t) {}
|
|
3072
3300
|
try {
|
|
3073
3301
|
d = v.getResult();
|
|
@@ -3080,21 +3308,21 @@ var OHLCV_INDICATORS;
|
|
|
3080
3308
|
}), !0;
|
|
3081
3309
|
},
|
|
3082
3310
|
scaler: function(t, e, r, n, o) {
|
|
3083
|
-
var i = o.type, a = o.group, u = o.range, l = o.lag, c = o.precomputed, s = o.decimals, f = c.groupKey, y = c.groupKeyLen,
|
|
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);
|
|
3084
3312
|
if (0 === e) {
|
|
3085
3313
|
var d = t.len;
|
|
3086
|
-
|
|
3314
|
+
h.hasOwnProperty("scaler") || (h.scaler = {
|
|
3087
3315
|
windows: {}
|
|
3088
3316
|
});
|
|
3089
|
-
var b, g =
|
|
3317
|
+
var b, g = kr(n);
|
|
3090
3318
|
try {
|
|
3091
3319
|
var w = function() {
|
|
3092
3320
|
var e = b.value;
|
|
3093
|
-
if (!
|
|
3321
|
+
if (!p.hasOwnProperty(e)) throw new Error('Target property "'.concat(e, '" not found in verticalOhlcv'));
|
|
3094
3322
|
var r = "".concat(m, "_").concat(e);
|
|
3095
|
-
|
|
3323
|
+
p[r] = new Float64Array(d).fill(NaN), v[r] = "Float64Array";
|
|
3096
3324
|
var n = a ? f : e;
|
|
3097
|
-
if (
|
|
3325
|
+
if (h.scaler.windows[n] = [], a && (t.scaledGroups[f] || (t.scaledGroups[f] = []),
|
|
3098
3326
|
t.scaledGroups[f].push(r)), l > 0) {
|
|
3099
3327
|
if (a) {
|
|
3100
3328
|
var o, i = Array.from({
|
|
@@ -3102,7 +3330,7 @@ var OHLCV_INDICATORS;
|
|
|
3102
3330
|
}).map((function(t, e) {
|
|
3103
3331
|
return "".concat(r, "_lag_").concat(e + 1);
|
|
3104
3332
|
}));
|
|
3105
|
-
(o = t.scaledGroups[f]).push.apply(o,
|
|
3333
|
+
(o = t.scaledGroups[f]).push.apply(o, Er(i));
|
|
3106
3334
|
}
|
|
3107
3335
|
t.lag([ r ], l);
|
|
3108
3336
|
}
|
|
@@ -3114,11 +3342,11 @@ var OHLCV_INDICATORS;
|
|
|
3114
3342
|
g.f();
|
|
3115
3343
|
}
|
|
3116
3344
|
}
|
|
3117
|
-
var
|
|
3345
|
+
var O, S = h.scaler.windows, j = kr(n);
|
|
3118
3346
|
// update windows with current values
|
|
3119
3347
|
try {
|
|
3120
|
-
for (j.s(); !(
|
|
3121
|
-
var P =
|
|
3348
|
+
for (j.s(); !(O = j.n()).done; ) {
|
|
3349
|
+
var P = O.value, _ = p[P][e], N = S[a ? f : P];
|
|
3122
3350
|
N.push(_), N.length > (a ? r * y : r) && N.shift();
|
|
3123
3351
|
}
|
|
3124
3352
|
} catch (t) {
|
|
@@ -3126,16 +3354,16 @@ var OHLCV_INDICATORS;
|
|
|
3126
3354
|
} finally {
|
|
3127
3355
|
j.f();
|
|
3128
3356
|
}
|
|
3129
|
-
var
|
|
3357
|
+
var T, A = e + 1 >= r, E = kr(n);
|
|
3130
3358
|
// scale values once enough data
|
|
3131
3359
|
try {
|
|
3132
3360
|
var k = function() {
|
|
3133
|
-
var r, n, o, l, c, y,
|
|
3134
|
-
if (
|
|
3135
|
-
var g =
|
|
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];
|
|
3136
3364
|
if ("minmax" === i) {
|
|
3137
|
-
var w = Math.min.apply(Math,
|
|
3138
|
-
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;
|
|
3139
3367
|
} else {
|
|
3140
3368
|
if ("zscore" !== i) throw new Error('Unknown scaler type "'.concat(i, '"'));
|
|
3141
3369
|
var j = g.reduce((function(t, e) {
|
|
@@ -3151,17 +3379,17 @@ var OHLCV_INDICATORS;
|
|
|
3151
3379
|
t.pushToMain({
|
|
3152
3380
|
index: e,
|
|
3153
3381
|
key: d,
|
|
3154
|
-
value: null === s ? b :
|
|
3382
|
+
value: null === s ? b : Ge(b, s)
|
|
3155
3383
|
});
|
|
3156
3384
|
};
|
|
3157
|
-
for (E.s(); !(
|
|
3385
|
+
for (E.s(); !(T = E.n()).done; ) k();
|
|
3158
3386
|
} catch (t) {
|
|
3159
3387
|
E.e(t);
|
|
3160
3388
|
} finally {
|
|
3161
3389
|
E.f();
|
|
3162
3390
|
}
|
|
3163
3391
|
}
|
|
3164
|
-
},
|
|
3392
|
+
}, Hr = function(t, e) {
|
|
3165
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]),
|
|
3166
3394
|
n.isStable) {
|
|
3167
3395
|
var c = n.getResult();
|
|
@@ -3171,20 +3399,20 @@ var OHLCV_INDICATORS;
|
|
|
3171
3399
|
return o.map((function(t) {
|
|
3172
3400
|
return null !== t ? (t - s) / y : null;
|
|
3173
3401
|
}));
|
|
3174
|
-
},
|
|
3402
|
+
}, Vr = function(t, e) {
|
|
3175
3403
|
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5;
|
|
3176
3404
|
if (t.length !== e.length) throw new Error("Both arrays must have the same length");
|
|
3177
|
-
for (var n =
|
|
3178
|
-
if (null !== n[
|
|
3179
|
-
|
|
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;
|
|
3180
3408
|
break;
|
|
3181
3409
|
}
|
|
3182
3410
|
a.push(0);
|
|
3183
3411
|
}
|
|
3184
|
-
if (-1 ===
|
|
3412
|
+
if (-1 === p)
|
|
3185
3413
|
// No valid data points
|
|
3186
3414
|
return new Array(i).fill(0);
|
|
3187
|
-
for (var v =
|
|
3415
|
+
for (var v = p; v < i; v++) {
|
|
3188
3416
|
var m = n[v], d = o[v];
|
|
3189
3417
|
if (null !== m && null !== d) if (u += m, l += d, c += m * d, s += m * m, f += d * d,
|
|
3190
3418
|
++y < 2) a.push(0); else {
|
|
@@ -3197,7 +3425,7 @@ var OHLCV_INDICATORS;
|
|
|
3197
3425
|
return a;
|
|
3198
3426
|
};
|
|
3199
3427
|
// ./src/utilities/verticalToHorizontal.js
|
|
3200
|
-
function
|
|
3428
|
+
function Ur(t, e) {
|
|
3201
3429
|
return function(t) {
|
|
3202
3430
|
if (Array.isArray(t)) return t;
|
|
3203
3431
|
}(t) || function(t, e) {
|
|
@@ -3222,33 +3450,33 @@ var OHLCV_INDICATORS;
|
|
|
3222
3450
|
}
|
|
3223
3451
|
}(t, e) || function(t, e) {
|
|
3224
3452
|
if (t) {
|
|
3225
|
-
if ("string" == typeof t) return
|
|
3453
|
+
if ("string" == typeof t) return $r(t, e);
|
|
3226
3454
|
var r = {}.toString.call(t).slice(8, -1);
|
|
3227
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
3228
3456
|
}
|
|
3229
3457
|
}(t, e) || function() {
|
|
3230
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.");
|
|
3231
3459
|
}();
|
|
3232
3460
|
}
|
|
3233
|
-
function
|
|
3461
|
+
function $r(t, e) {
|
|
3234
3462
|
(null == e || e > t.length) && (e = t.length);
|
|
3235
3463
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3236
3464
|
return n;
|
|
3237
3465
|
}
|
|
3238
|
-
var
|
|
3239
|
-
var e = t.main, r = t.skipNull, n = void 0 !== r && r, o = t.startIndex, i = void 0 === o ? 0 : o, a = t.dateFormat, u = e.precisionMultiplier, l = e.priceBased, c = e.precision, s = e.verticalOhlcv, f = e.invalidValueIndex, y = e.len,
|
|
3240
|
-
if (0 ===
|
|
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 [];
|
|
3241
3469
|
for (var v = n && f >= 0 ? f + 1 : 0, m = Math.max(v, i), d = y - m, b = Array.from({
|
|
3242
3470
|
length: d
|
|
3243
3471
|
}, (function() {
|
|
3244
3472
|
return {};
|
|
3245
3473
|
})), g = 0, w = Object.entries(s); g < w.length; g++) {
|
|
3246
|
-
var
|
|
3247
|
-
if (!
|
|
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[_];
|
|
3248
3476
|
}
|
|
3249
3477
|
return b;
|
|
3250
3478
|
};
|
|
3251
|
-
function
|
|
3479
|
+
function zr(t, e) {
|
|
3252
3480
|
return function(t) {
|
|
3253
3481
|
if (Array.isArray(t)) return t;
|
|
3254
3482
|
}(t) || function(t, e) {
|
|
@@ -3271,30 +3499,30 @@ var OHLCV_INDICATORS;
|
|
|
3271
3499
|
}
|
|
3272
3500
|
return u;
|
|
3273
3501
|
}
|
|
3274
|
-
}(t, e) ||
|
|
3502
|
+
}(t, e) || Gr(t, e) || function() {
|
|
3275
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.");
|
|
3276
3504
|
}();
|
|
3277
3505
|
}
|
|
3278
|
-
function
|
|
3506
|
+
function Gr(t, e) {
|
|
3279
3507
|
if (t) {
|
|
3280
|
-
if ("string" == typeof t) return
|
|
3508
|
+
if ("string" == typeof t) return Kr(t, e);
|
|
3281
3509
|
var r = {}.toString.call(t).slice(8, -1);
|
|
3282
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
3283
3511
|
}
|
|
3284
3512
|
}
|
|
3285
|
-
function
|
|
3513
|
+
function Kr(t, e) {
|
|
3286
3514
|
(null == e || e > t.length) && (e = t.length);
|
|
3287
3515
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3288
3516
|
return n;
|
|
3289
3517
|
}
|
|
3290
|
-
var
|
|
3518
|
+
var Yr = function(t, e) {
|
|
3291
3519
|
var r = t.precision, n = t.priceBased;
|
|
3292
3520
|
if (!1 === r) return 1;
|
|
3293
3521
|
var o, i = 1, a = // ./src/utilities/precisionMultiplier.js
|
|
3294
3522
|
function(t, e) {
|
|
3295
3523
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
3296
3524
|
if (!r) {
|
|
3297
|
-
if (Array.isArray(t) || (r =
|
|
3525
|
+
if (Array.isArray(t) || (r = Gr(t)) || e && t && "number" == typeof t.length) {
|
|
3298
3526
|
r && (t = r);
|
|
3299
3527
|
var n = 0, o = function() {};
|
|
3300
3528
|
return {
|
|
@@ -3336,17 +3564,17 @@ var OHLCV_INDICATORS;
|
|
|
3336
3564
|
}
|
|
3337
3565
|
};
|
|
3338
3566
|
}(Object.entries(e).filter((function(t) {
|
|
3339
|
-
var e =
|
|
3567
|
+
var e = zr(t, 2), r = e[0];
|
|
3340
3568
|
e[1];
|
|
3341
3569
|
return n.has(r);
|
|
3342
3570
|
})).map((function(t) {
|
|
3343
|
-
var e =
|
|
3571
|
+
var e = zr(t, 2);
|
|
3344
3572
|
e[0];
|
|
3345
3573
|
return e[1];
|
|
3346
3574
|
})));
|
|
3347
3575
|
try {
|
|
3348
3576
|
for (a.s(); !(o = a.n()).done; ) {
|
|
3349
|
-
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;
|
|
3350
3578
|
f > i && (i = f);
|
|
3351
3579
|
}
|
|
3352
3580
|
} catch (t) {
|
|
@@ -3357,23 +3585,23 @@ var OHLCV_INDICATORS;
|
|
|
3357
3585
|
return i;
|
|
3358
3586
|
};
|
|
3359
3587
|
// ./index.js
|
|
3360
|
-
function
|
|
3361
|
-
return
|
|
3588
|
+
function Jr(t) {
|
|
3589
|
+
return Jr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
3362
3590
|
return typeof t;
|
|
3363
3591
|
} : function(t) {
|
|
3364
3592
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
3365
|
-
},
|
|
3593
|
+
}, Jr(t);
|
|
3366
3594
|
}
|
|
3367
|
-
function
|
|
3595
|
+
function Zr(t) {
|
|
3368
3596
|
return function(t) {
|
|
3369
|
-
if (Array.isArray(t)) return
|
|
3597
|
+
if (Array.isArray(t)) return Xr(t);
|
|
3370
3598
|
}(t) || function(t) {
|
|
3371
3599
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
3372
|
-
}(t) ||
|
|
3600
|
+
}(t) || Wr(t) || function() {
|
|
3373
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.");
|
|
3374
3602
|
}();
|
|
3375
3603
|
}
|
|
3376
|
-
function
|
|
3604
|
+
function Qr(t, e) {
|
|
3377
3605
|
return function(t) {
|
|
3378
3606
|
if (Array.isArray(t)) return t;
|
|
3379
3607
|
}(t) || function(t, e) {
|
|
@@ -3396,36 +3624,36 @@ var OHLCV_INDICATORS;
|
|
|
3396
3624
|
}
|
|
3397
3625
|
return u;
|
|
3398
3626
|
}
|
|
3399
|
-
}(t, e) ||
|
|
3627
|
+
}(t, e) || Wr(t, e) || function() {
|
|
3400
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.");
|
|
3401
3629
|
}();
|
|
3402
3630
|
}
|
|
3403
|
-
function
|
|
3631
|
+
function Wr(t, e) {
|
|
3404
3632
|
if (t) {
|
|
3405
|
-
if ("string" == typeof t) return
|
|
3633
|
+
if ("string" == typeof t) return Xr(t, e);
|
|
3406
3634
|
var r = {}.toString.call(t).slice(8, -1);
|
|
3407
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
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;
|
|
3408
3636
|
}
|
|
3409
3637
|
}
|
|
3410
|
-
function
|
|
3638
|
+
function Xr(t, e) {
|
|
3411
3639
|
(null == e || e > t.length) && (e = t.length);
|
|
3412
3640
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3413
3641
|
return n;
|
|
3414
3642
|
}
|
|
3415
|
-
function
|
|
3643
|
+
function tn(t, e) {
|
|
3416
3644
|
for (var r = 0; r < e.length; r++) {
|
|
3417
3645
|
var n = e[r];
|
|
3418
3646
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
3419
|
-
Object.defineProperty(t,
|
|
3647
|
+
Object.defineProperty(t, en(n.key), n);
|
|
3420
3648
|
}
|
|
3421
3649
|
}
|
|
3422
|
-
function
|
|
3650
|
+
function en(t) {
|
|
3423
3651
|
var e = function(t, e) {
|
|
3424
|
-
if ("object" !=
|
|
3652
|
+
if ("object" != Jr(t) || !t) return t;
|
|
3425
3653
|
var r = t[Symbol.toPrimitive];
|
|
3426
3654
|
if (void 0 !== r) {
|
|
3427
3655
|
var n = r.call(t, e || "default");
|
|
3428
|
-
if ("object" !=
|
|
3656
|
+
if ("object" != Jr(n)) return n;
|
|
3429
3657
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3430
3658
|
}
|
|
3431
3659
|
return ("string" === e ? String : Number)(t);
|
|
@@ -3439,26 +3667,26 @@ var OHLCV_INDICATORS;
|
|
|
3439
3667
|
* to parallel compute various technical indicators in 1 single loop.
|
|
3440
3668
|
* OHLCV datasets.
|
|
3441
3669
|
*/ (t, "string");
|
|
3442
|
-
return "symbol" ==
|
|
3670
|
+
return "symbol" == Jr(e) ? e : e + "";
|
|
3443
3671
|
}
|
|
3444
|
-
var
|
|
3672
|
+
var rn = function() {
|
|
3445
3673
|
return t = function t(e) {
|
|
3446
|
-
var r = this, n = e.input, o = e.ticker, i = void 0 === o ? null : o, a = e.precision, l = void 0 === a || a, s = e.inputParams, f = void 0 === s ? null : s,
|
|
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;
|
|
3447
3675
|
if (function(t, e) {
|
|
3448
3676
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
3449
3677
|
}(this, t), c(n, "input", null !== i ? "contructor ".concat(i) : "constuctor"),
|
|
3450
3678
|
0 === n.length) throw Error("input OHLCV must not be empty: " + i);
|
|
3451
|
-
y(l, "precision", "constructor"),
|
|
3679
|
+
y(l, "precision", "constructor"), p(v, {
|
|
3452
3680
|
min: 100,
|
|
3453
3681
|
max: 5e4,
|
|
3454
3682
|
allowDecimals: !1
|
|
3455
3683
|
}, "chunkProcess", "constructor"), this.chunkProcess = v, this.firstRow = n[0];
|
|
3456
3684
|
var m = function(t) {
|
|
3457
3685
|
for (var e = {}, r = {}, n = 0, o = Object.entries(t); n < o.length; n++) {
|
|
3458
|
-
var i =
|
|
3459
|
-
if ("date" === a) e[a] =
|
|
3460
|
-
r[a] = "Int32Array"; else if (
|
|
3461
|
-
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);
|
|
3462
3690
|
e[a] = l, r[a] = "number" === l ? "Float64Array" : "Array";
|
|
3463
3691
|
}
|
|
3464
3692
|
}
|
|
@@ -3472,8 +3700,8 @@ var OHLCV_INDICATORS;
|
|
|
3472
3700
|
this.input = n, this.priceBased = new Set([ "open", "high", "low", "close" ]), this.len = n.length,
|
|
3473
3701
|
this.instances = {}, this.crossPairsList = [], this.verticalOhlcv = {}, this.verticalOhlcvKeyNames = [],
|
|
3474
3702
|
this.verticalOhlcvTempCols = new Set, this.utilities = {
|
|
3475
|
-
correlation:
|
|
3476
|
-
}, this.invalidValueIndex = -1, this.precision = l, this.precisionMultiplier =
|
|
3703
|
+
correlation: Vr
|
|
3704
|
+
}, this.invalidValueIndex = -1, this.precision = l, this.precisionMultiplier = Yr(this, this.firstRow),
|
|
3477
3705
|
this.scaledGroups = {}, this.pushToMain = function(t) {
|
|
3478
3706
|
var e = t.index, n = t.key, o = t.value;
|
|
3479
3707
|
return function(t) {
|
|
@@ -3494,13 +3722,13 @@ var OHLCV_INDICATORS;
|
|
|
3494
3722
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3495
3723
|
this.compute();
|
|
3496
3724
|
var e = t.skipNull, r = void 0 === e || e, n = t.dateFormat, o = void 0 === n ? "string" : n;
|
|
3497
|
-
f(Object.keys(
|
|
3498
|
-
for (var i = this.precisionMultiplier, a = this.precision, u = this.invalidValueIndex, l = this.len, c = this.verticalOhlcv, y = this.priceBased,
|
|
3499
|
-
var w =
|
|
3500
|
-
if (!
|
|
3501
|
-
var j = y.has(
|
|
3502
|
-
v[
|
|
3503
|
-
for (var P = m; P < l; P++) v[
|
|
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];
|
|
3504
3732
|
}
|
|
3505
3733
|
}
|
|
3506
3734
|
return v;
|
|
@@ -3512,8 +3740,8 @@ var OHLCV_INDICATORS;
|
|
|
3512
3740
|
//getData method returns the last object (row) of the new OHLCV with indicators: {open, high, low, close, rsi_14, bollinger_bands_upper}
|
|
3513
3741
|
this.compute();
|
|
3514
3742
|
var e = t.skipNull, r = void 0 === e || e, n = t.dateFormat, o = void 0 === n ? "string" : n;
|
|
3515
|
-
return f(Object.keys(
|
|
3516
|
-
|
|
3743
|
+
return f(Object.keys(or), o, "dateFormat", "getData"), s(t, "options", "getData"),
|
|
3744
|
+
qr({
|
|
3517
3745
|
main: this,
|
|
3518
3746
|
skipNull: r,
|
|
3519
3747
|
startIndex: 0,
|
|
@@ -3526,7 +3754,7 @@ var OHLCV_INDICATORS;
|
|
|
3526
3754
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
3527
3755
|
this.compute();
|
|
3528
3756
|
var e = t.dateFormat, r = void 0 === e ? "string" : e;
|
|
3529
|
-
return f(Object.keys(
|
|
3757
|
+
return f(Object.keys(or), r, "dateFormat", "getData"), qr({
|
|
3530
3758
|
skipNull: !1,
|
|
3531
3759
|
main: this,
|
|
3532
3760
|
startIndex: this.len - 1,
|
|
@@ -3546,49 +3774,49 @@ var OHLCV_INDICATORS;
|
|
|
3546
3774
|
this.len > 0 && (function(t, e) {
|
|
3547
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;
|
|
3548
3776
|
u(n, r);
|
|
3549
|
-
for (var y = 0,
|
|
3550
|
-
var
|
|
3551
|
-
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);
|
|
3552
3780
|
}
|
|
3553
3781
|
// Process each row in the input
|
|
3554
3782
|
for (var v = 0; v < r; v += f) for (var m = Math.min(v + f, r), d = v; d < m; d++) {
|
|
3555
3783
|
for (var b = t[d], g = 0, w = Object.entries(s); g < w.length; g++) {
|
|
3556
|
-
var
|
|
3557
|
-
if (
|
|
3558
|
-
var _ =
|
|
3559
|
-
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({
|
|
3560
3788
|
index: d,
|
|
3561
|
-
key:
|
|
3789
|
+
key: S,
|
|
3562
3790
|
value: _
|
|
3563
3791
|
});
|
|
3564
|
-
} else
|
|
3792
|
+
} else ir.hasOwnProperty(j) ? e.pushToMain({
|
|
3565
3793
|
index: d,
|
|
3566
|
-
key:
|
|
3567
|
-
value:
|
|
3794
|
+
key: S,
|
|
3795
|
+
value: ir[j](P)
|
|
3568
3796
|
}) : e.pushToMain({
|
|
3569
3797
|
index: d,
|
|
3570
|
-
key:
|
|
3798
|
+
key: S,
|
|
3571
3799
|
value: P
|
|
3572
3800
|
});
|
|
3573
3801
|
}
|
|
3574
3802
|
// Run all indicator functions except for the ones processed later
|
|
3575
|
-
var N,
|
|
3803
|
+
var N, T = Rr(n);
|
|
3576
3804
|
try {
|
|
3577
|
-
for (
|
|
3578
|
-
var
|
|
3805
|
+
for (T.s(); !(N = T.n()).done; ) {
|
|
3806
|
+
var A = N.value, E = A.key, k = A.params;
|
|
3579
3807
|
"lag" !== E && "crossPairs" !== E &&
|
|
3580
3808
|
// resolve fn on-demand, no per-item object allocation here
|
|
3581
|
-
|
|
3809
|
+
Br[E].apply(Br, [ e, d ].concat(Mr(k)));
|
|
3582
3810
|
}
|
|
3583
3811
|
// Process these indicators separately (ensuring their execution order)
|
|
3584
3812
|
} catch (t) {
|
|
3585
|
-
|
|
3813
|
+
T.e(t);
|
|
3586
3814
|
} finally {
|
|
3587
|
-
|
|
3815
|
+
T.f();
|
|
3588
3816
|
}
|
|
3589
|
-
|
|
3817
|
+
vr(e, d), Pr(e, d), t[d] = null;
|
|
3590
3818
|
}
|
|
3591
|
-
c.push.apply(c,
|
|
3819
|
+
c.push.apply(c, Mr(Object.keys(l)));
|
|
3592
3820
|
}(this.input, this), this.isComputed = !0,
|
|
3593
3821
|
//flushing after mainLoop
|
|
3594
3822
|
this.input = [], this.instances = {}, this.firstRow = [])), this;
|
|
@@ -3597,7 +3825,7 @@ var OHLCV_INDICATORS;
|
|
|
3597
3825
|
key: "crossPairs",
|
|
3598
3826
|
value: function() {
|
|
3599
3827
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], e = "crossPairs";
|
|
3600
|
-
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)),
|
|
3601
3829
|
this.inputParams.push({
|
|
3602
3830
|
key: e,
|
|
3603
3831
|
params: [ this.crossPairsList ]
|
|
@@ -3607,7 +3835,7 @@ var OHLCV_INDICATORS;
|
|
|
3607
3835
|
key: "lag",
|
|
3608
3836
|
value: function() {
|
|
3609
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";
|
|
3610
|
-
l(this), c(t, "colKeys", r),
|
|
3838
|
+
l(this), c(t, "colKeys", r), p(e, {
|
|
3611
3839
|
min: 1,
|
|
3612
3840
|
max: this.len,
|
|
3613
3841
|
allowDecimals: !1
|
|
@@ -3618,7 +3846,7 @@ var OHLCV_INDICATORS;
|
|
|
3618
3846
|
var n, o = function(t, e) {
|
|
3619
3847
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
3620
3848
|
if (!r) {
|
|
3621
|
-
if (Array.isArray(t) || (r =
|
|
3849
|
+
if (Array.isArray(t) || (r = Wr(t)) || e && t && "number" == typeof t.length) {
|
|
3622
3850
|
r && (t = r);
|
|
3623
3851
|
var n = 0, o = function() {};
|
|
3624
3852
|
return {
|
|
@@ -3677,13 +3905,34 @@ var OHLCV_INDICATORS;
|
|
|
3677
3905
|
value: function() {
|
|
3678
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";
|
|
3679
3907
|
if (!this.inputTypes.hasOwnProperty("volume")) throw new Error('If "relativeVolume" is called the input ohlcv must contain valid volume properties.');
|
|
3680
|
-
l(this),
|
|
3908
|
+
l(this), p(t, {
|
|
3909
|
+
min: 1,
|
|
3910
|
+
max: this.len,
|
|
3911
|
+
allowDecimals: !1
|
|
3912
|
+
}, "size", r), s(e, "options", r);
|
|
3913
|
+
var n = e.lag, o = void 0 === n ? 0 : n;
|
|
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, {
|
|
3681
3930
|
min: 1,
|
|
3682
3931
|
max: this.len,
|
|
3683
3932
|
allowDecimals: !1
|
|
3684
3933
|
}, "size", r), s(e, "options", r);
|
|
3685
3934
|
var n = e.lag, o = void 0 === n ? 0 : n;
|
|
3686
|
-
return
|
|
3935
|
+
return p(o, {
|
|
3687
3936
|
min: 0,
|
|
3688
3937
|
max: this.len,
|
|
3689
3938
|
allowDecimals: !1
|
|
@@ -3698,18 +3947,18 @@ var OHLCV_INDICATORS;
|
|
|
3698
3947
|
key: "ema",
|
|
3699
3948
|
value: function() {
|
|
3700
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";
|
|
3701
|
-
l(this),
|
|
3950
|
+
l(this), p(t, {
|
|
3702
3951
|
min: 1,
|
|
3703
3952
|
max: this.len,
|
|
3704
3953
|
allowDecimals: !1
|
|
3705
3954
|
}, "size", r), s(e, "options", r);
|
|
3706
3955
|
var n = e.target, o = void 0 === n ? "close" : n, i = e.lag, a = void 0 === i ? 0 : i;
|
|
3707
|
-
|
|
3956
|
+
p(a, {
|
|
3708
3957
|
min: 0,
|
|
3709
3958
|
max: this.len,
|
|
3710
3959
|
allowDecimals: !1
|
|
3711
3960
|
}, "options.lag", r);
|
|
3712
|
-
var u =
|
|
3961
|
+
var u = Fe({
|
|
3713
3962
|
main: this,
|
|
3714
3963
|
size: t,
|
|
3715
3964
|
target: o,
|
|
@@ -3729,18 +3978,18 @@ var OHLCV_INDICATORS;
|
|
|
3729
3978
|
key: "sma",
|
|
3730
3979
|
value: function() {
|
|
3731
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";
|
|
3732
|
-
l(this),
|
|
3981
|
+
l(this), p(t, {
|
|
3733
3982
|
min: 1,
|
|
3734
3983
|
max: this.len,
|
|
3735
3984
|
allowDecimals: !1
|
|
3736
3985
|
}, "size", r), s(e, "options", r);
|
|
3737
3986
|
var n = e.target, o = void 0 === n ? "close" : n, i = e.lag, a = void 0 === i ? 0 : i;
|
|
3738
|
-
|
|
3987
|
+
p(a, {
|
|
3739
3988
|
min: 0,
|
|
3740
3989
|
max: this.len,
|
|
3741
3990
|
allowDecimals: !1
|
|
3742
3991
|
}, "options.lag", r);
|
|
3743
|
-
var u =
|
|
3992
|
+
var u = Fe({
|
|
3744
3993
|
main: this,
|
|
3745
3994
|
size: t,
|
|
3746
3995
|
target: o,
|
|
@@ -3760,21 +4009,21 @@ var OHLCV_INDICATORS;
|
|
|
3760
4009
|
key: "macd",
|
|
3761
4010
|
value: function() {
|
|
3762
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";
|
|
3763
|
-
l(this),
|
|
4012
|
+
l(this), p(t, {
|
|
3764
4013
|
min: 1,
|
|
3765
4014
|
max: this.len,
|
|
3766
4015
|
allowDecimals: !1
|
|
3767
|
-
}, "fast", o),
|
|
4016
|
+
}, "fast", o), p(e, {
|
|
3768
4017
|
min: 1,
|
|
3769
4018
|
max: this.len,
|
|
3770
4019
|
allowDecimals: !1
|
|
3771
|
-
}, "slow", o),
|
|
4020
|
+
}, "slow", o), p(r, {
|
|
3772
4021
|
min: 1,
|
|
3773
4022
|
max: this.len,
|
|
3774
4023
|
allowDecimals: !1
|
|
3775
4024
|
}, "signal", o), s(n, "options", o);
|
|
3776
4025
|
var i = n.target, a = void 0 === i ? "close" : i, u = n.lag, c = void 0 === u ? 0 : u;
|
|
3777
|
-
|
|
4026
|
+
p(c, {
|
|
3778
4027
|
min: 0,
|
|
3779
4028
|
max: this.len,
|
|
3780
4029
|
allowDecimals: !1
|
|
@@ -3795,21 +4044,21 @@ var OHLCV_INDICATORS;
|
|
|
3795
4044
|
key: "bollingerBands",
|
|
3796
4045
|
value: function() {
|
|
3797
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";
|
|
3798
|
-
l(this),
|
|
4047
|
+
l(this), p(t, {
|
|
3799
4048
|
min: 1,
|
|
3800
4049
|
max: this.len,
|
|
3801
4050
|
allowDecimals: !1
|
|
3802
|
-
}, "size", n),
|
|
4051
|
+
}, "size", n), p(e, {
|
|
3803
4052
|
min: .01,
|
|
3804
4053
|
max: 50,
|
|
3805
4054
|
allowDecimals: !0
|
|
3806
4055
|
}, "stdDev", n), s(r, "options", n);
|
|
3807
|
-
var o = r.target, i = void 0 === o ? "close" : o, a = r.height, u = void 0 !== a && a, f = r.range,
|
|
3808
|
-
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, {
|
|
3809
4058
|
min: 0,
|
|
3810
4059
|
max: this.len,
|
|
3811
4060
|
allowDecimals: !1
|
|
3812
|
-
}, "options.lag", n), y(u, "options.height", n), null !== b &&
|
|
4061
|
+
}, "options.lag", n), y(u, "options.height", n), null !== b && p(b, {
|
|
3813
4062
|
min: 1,
|
|
3814
4063
|
max: 15,
|
|
3815
4064
|
allowDecimals: !1
|
|
@@ -3818,7 +4067,7 @@ var OHLCV_INDICATORS;
|
|
|
3818
4067
|
params: [ t, e, {
|
|
3819
4068
|
target: i,
|
|
3820
4069
|
height: u,
|
|
3821
|
-
range:
|
|
4070
|
+
range: h,
|
|
3822
4071
|
lag: m,
|
|
3823
4072
|
decimals: b
|
|
3824
4073
|
} ]
|
|
@@ -3828,13 +4077,13 @@ var OHLCV_INDICATORS;
|
|
|
3828
4077
|
key: "rsi",
|
|
3829
4078
|
value: function() {
|
|
3830
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";
|
|
3831
|
-
l(this),
|
|
4080
|
+
l(this), p(t, {
|
|
3832
4081
|
min: 1,
|
|
3833
4082
|
max: this.len,
|
|
3834
4083
|
allowDecimals: !1
|
|
3835
4084
|
}, "size", r), s(e, "options", r);
|
|
3836
4085
|
var n = e.target, o = void 0 === n ? "close" : n, i = e.lag, a = void 0 === i ? 0 : i;
|
|
3837
|
-
return
|
|
4086
|
+
return p(a, {
|
|
3838
4087
|
min: 0,
|
|
3839
4088
|
max: this.len,
|
|
3840
4089
|
allowDecimals: !1
|
|
@@ -3850,21 +4099,21 @@ var OHLCV_INDICATORS;
|
|
|
3850
4099
|
key: "donchianChannels",
|
|
3851
4100
|
value: function() {
|
|
3852
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";
|
|
3853
|
-
l(this),
|
|
4102
|
+
l(this), p(t, {
|
|
3854
4103
|
min: 1,
|
|
3855
4104
|
max: this.len,
|
|
3856
4105
|
allowDecimals: !1
|
|
3857
|
-
}, "size", n),
|
|
4106
|
+
}, "size", n), p(e, {
|
|
3858
4107
|
min: 0,
|
|
3859
4108
|
max: this.len,
|
|
3860
4109
|
allowDecimals: !1
|
|
3861
4110
|
}, "offset", n), s(r, "options", n);
|
|
3862
|
-
var o = r.height, i = void 0 !== o && o, a = r.range, u = void 0 === a ? [] : a, f = r.lag,
|
|
3863
|
-
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, {
|
|
3864
4113
|
min: 0,
|
|
3865
4114
|
max: this.len,
|
|
3866
4115
|
allowDecimals: !1
|
|
3867
|
-
}, "options.lag", n), y(i, "options.height", n), null !== m &&
|
|
4116
|
+
}, "options.lag", n), y(i, "options.height", n), null !== m && p(m, {
|
|
3868
4117
|
min: 1,
|
|
3869
4118
|
max: 15,
|
|
3870
4119
|
allowDecimals: !1
|
|
@@ -3873,7 +4122,7 @@ var OHLCV_INDICATORS;
|
|
|
3873
4122
|
params: [ t, e, {
|
|
3874
4123
|
height: i,
|
|
3875
4124
|
range: u,
|
|
3876
|
-
lag:
|
|
4125
|
+
lag: h,
|
|
3877
4126
|
decimals: m
|
|
3878
4127
|
} ]
|
|
3879
4128
|
}), this;
|
|
@@ -3883,17 +4132,17 @@ var OHLCV_INDICATORS;
|
|
|
3883
4132
|
value: function() {
|
|
3884
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";
|
|
3885
4134
|
if (!this.inputTypes.hasOwnProperty("volume")) throw new Error('If "volumeOscillator" is called the input ohlcv must contain valid volume properties.');
|
|
3886
|
-
l(this),
|
|
4135
|
+
l(this), p(t, {
|
|
3887
4136
|
min: 1,
|
|
3888
4137
|
max: this.len,
|
|
3889
4138
|
allowDecimals: !1
|
|
3890
|
-
}, "fastSize", n),
|
|
4139
|
+
}, "fastSize", n), p(e, {
|
|
3891
4140
|
min: t,
|
|
3892
4141
|
max: this.len,
|
|
3893
4142
|
allowDecimals: !1
|
|
3894
4143
|
}, "slowSize", n), s(r, "options", n);
|
|
3895
4144
|
var o = r.lag, i = void 0 === o ? 0 : o;
|
|
3896
|
-
return
|
|
4145
|
+
return p(i, {
|
|
3897
4146
|
min: 0,
|
|
3898
4147
|
max: this.len,
|
|
3899
4148
|
allowDecimals: !1
|
|
@@ -3910,7 +4159,7 @@ var OHLCV_INDICATORS;
|
|
|
3910
4159
|
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, e = "dateTime";
|
|
3911
4160
|
l(this), s(t, "options", e);
|
|
3912
4161
|
var r = t.lag, n = void 0 === r ? 0 : r;
|
|
3913
|
-
return
|
|
4162
|
+
return p(n, {
|
|
3914
4163
|
min: 0,
|
|
3915
4164
|
max: this.len,
|
|
3916
4165
|
allowDecimals: !1
|
|
@@ -3925,25 +4174,25 @@ var OHLCV_INDICATORS;
|
|
|
3925
4174
|
key: "scaler",
|
|
3926
4175
|
value: function(t) {
|
|
3927
4176
|
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, o = "scaler";
|
|
3928
|
-
l(this),
|
|
4177
|
+
l(this), p(t, {
|
|
3929
4178
|
min: 1,
|
|
3930
4179
|
max: this.len,
|
|
3931
4180
|
allowDecimals: !1
|
|
3932
4181
|
}, "size", o), c(e, "colKeys", o);
|
|
3933
|
-
var i = n.group, a = void 0 !== i && i, u = n.range, s = void 0 === u ? [ 0, 1 ] : u,
|
|
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;
|
|
3934
4183
|
y(a, "options.group", o), function(t, e, n) {
|
|
3935
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, '".'));
|
|
3936
4185
|
var o = r(t, 2), i = o[0], a = o[1];
|
|
3937
|
-
if (
|
|
4186
|
+
if (p(i, {
|
|
3938
4187
|
min: -100,
|
|
3939
4188
|
max: a,
|
|
3940
4189
|
allowDecimals: !1
|
|
3941
|
-
}, "min", n),
|
|
4190
|
+
}, "min", n), p(a, {
|
|
3942
4191
|
min: i,
|
|
3943
4192
|
max: 100,
|
|
3944
4193
|
allowDecimals: !1
|
|
3945
4194
|
}, "max", n), i === a) throw new Error('Invalid "min" can not be equal to "max" property in "'.concat(n, ".").concat(e, '".'));
|
|
3946
|
-
}(s, "options.range", o), f([ "minmax", "zscore" ], d, "options.type", o), null !== g &&
|
|
4195
|
+
}(s, "options.range", o), f([ "minmax", "zscore" ], d, "options.type", o), null !== g && p(g, {
|
|
3947
4196
|
min: 1,
|
|
3948
4197
|
max: 15,
|
|
3949
4198
|
allowDecimals: !1
|
|
@@ -3964,7 +4213,7 @@ var OHLCV_INDICATORS;
|
|
|
3964
4213
|
} ]
|
|
3965
4214
|
}), this;
|
|
3966
4215
|
}
|
|
3967
|
-
} ], e &&
|
|
4216
|
+
} ], e && tn(t.prototype, e), n && tn(t, n), Object.defineProperty(t, "prototype", {
|
|
3968
4217
|
writable: !1
|
|
3969
4218
|
}), t;
|
|
3970
4219
|
var t, e, n;
|