ohlcv-indicators 3.2.8 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -95,7 +95,7 @@ var OHLCV_INDICATORS;
|
|
|
95
95
|
t.r(e),
|
|
96
96
|
// EXPORTS
|
|
97
97
|
t.d(e, {
|
|
98
|
-
default: () => /* binding */
|
|
98
|
+
default: () => /* binding */ Ur
|
|
99
99
|
});
|
|
100
100
|
var o = function(t) {
|
|
101
101
|
return "string" == typeof t && /^\d{4}-\d{2}-\d{2}/.test(t);
|
|
@@ -119,7 +119,7 @@ var OHLCV_INDICATORS;
|
|
|
119
119
|
* rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
120
120
|
* [more] {boolean} Whether the result of division was truncated.
|
|
121
121
|
*/
|
|
122
|
-
function
|
|
122
|
+
function b(t, e, r, n) {
|
|
123
123
|
var o = t.c;
|
|
124
124
|
if (r === p && (r = t.constructor.RM), 0 !== r && 1 !== r && 2 !== r && 3 !== r) throw Error(f);
|
|
125
125
|
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] !== p))),
|
|
@@ -147,7 +147,7 @@ var OHLCV_INDICATORS;
|
|
|
147
147
|
/*
|
|
148
148
|
* Return a string representing the value of Big x in normal or exponential notation.
|
|
149
149
|
* Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.
|
|
150
|
-
*/ function
|
|
150
|
+
*/ function d(t, e, r) {
|
|
151
151
|
var n = t.e, o = t.c.join(""), i = o.length;
|
|
152
152
|
// Exponential notation?
|
|
153
153
|
if (e) o = o.charAt(0) + (i > 1 ? "." + o.slice(1) : "") + (n < 0 ? "e" : "e+") + n;
|
|
@@ -196,14 +196,14 @@ var OHLCV_INDICATORS;
|
|
|
196
196
|
if (!o[0]) throw Error(h);
|
|
197
197
|
// Dividend is 0? Return +-0.
|
|
198
198
|
if (!n[0]) return t.s = i, t.c = [ t.e = 0 ], t;
|
|
199
|
-
var l, c, f, y, v,
|
|
199
|
+
var l, c, f, y, v, d = o.slice(), m = l = o.length, g = n.length, w = n.slice(0, l), // remainder
|
|
200
200
|
O = w.length, S = t, // quotient
|
|
201
|
-
|
|
201
|
+
j = S.c = [], _ = 0, P = u + (S.e = e.e - t.e) + 1;
|
|
202
202
|
// precision of the result
|
|
203
203
|
// Add zeros to make remainder as long as divisor.
|
|
204
204
|
for (S.s = i, i = P < 0 ? 0 : P,
|
|
205
205
|
// Create version of divisor with leading zero.
|
|
206
|
-
|
|
206
|
+
d.unshift(0); O++ < l; ) w.push(0);
|
|
207
207
|
do {
|
|
208
208
|
// n is how many times the divisor goes into current remainder.
|
|
209
209
|
for (f = 0; f < 10; f++) {
|
|
@@ -216,7 +216,7 @@ var OHLCV_INDICATORS;
|
|
|
216
216
|
if (!(y < 0)) break;
|
|
217
217
|
// Remainder can't be more than 1 digit longer than divisor.
|
|
218
218
|
// Equalise lengths using divisor with extra leading zero?
|
|
219
|
-
for (c = O == l ? o :
|
|
219
|
+
for (c = O == l ? o : d; O; ) {
|
|
220
220
|
if (w[--O] < c[O]) {
|
|
221
221
|
for (v = O; v && !w[--v]; ) w[v] = 9;
|
|
222
222
|
--w[v], w[O] += 10;
|
|
@@ -226,16 +226,16 @@ var OHLCV_INDICATORS;
|
|
|
226
226
|
for (;!w[0]; ) w.shift();
|
|
227
227
|
}
|
|
228
228
|
// Add the digit n to the result array.
|
|
229
|
-
_
|
|
229
|
+
j[_++] = y ? f : ++f,
|
|
230
230
|
// Update the remainder.
|
|
231
231
|
w[0] && y ? w[O] = n[m] || 0 : w = [ n[m] ];
|
|
232
232
|
} while ((m++ < g || w[0] !== p) && i--);
|
|
233
233
|
// Leading zero? Do not remove if result is simply zero (qi == 1).
|
|
234
|
-
return
|
|
234
|
+
return j[0] || 1 == _ || (
|
|
235
235
|
// There can't be more than one zero.
|
|
236
|
-
|
|
236
|
+
j.shift(), S.e--, P--),
|
|
237
237
|
// Round?
|
|
238
|
-
|
|
238
|
+
_ > P && b(S, P, r.RM, w[0] !== p), S;
|
|
239
239
|
},
|
|
240
240
|
/*
|
|
241
241
|
* Return true if the value of this Big is equal to the value of Big y, otherwise return false.
|
|
@@ -378,7 +378,7 @@ var OHLCV_INDICATORS;
|
|
|
378
378
|
*/
|
|
379
379
|
y.prec = function(t, e) {
|
|
380
380
|
if (t !== ~~t || t < 1 || t > a) throw Error(c + "precision");
|
|
381
|
-
return
|
|
381
|
+
return b(new this.constructor(this), t, e);
|
|
382
382
|
},
|
|
383
383
|
/*
|
|
384
384
|
* Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places
|
|
@@ -391,7 +391,7 @@ var OHLCV_INDICATORS;
|
|
|
391
391
|
*/
|
|
392
392
|
y.round = function(t, e) {
|
|
393
393
|
if (t === p) t = 0; else if (t !== ~~t || t < -a || t > a) throw Error(s);
|
|
394
|
-
return
|
|
394
|
+
return b(new this.constructor(this), t + this.e + 1, e);
|
|
395
395
|
},
|
|
396
396
|
/*
|
|
397
397
|
* Return a new Big whose value is the square root of the value of this Big, rounded, if
|
|
@@ -413,7 +413,7 @@ var OHLCV_INDICATORS;
|
|
|
413
413
|
do {
|
|
414
414
|
r = t, t = u.times(r.plus(n.div(r)));
|
|
415
415
|
} while (r.c.slice(0, a).join("") !== t.c.slice(0, a).join(""));
|
|
416
|
-
return
|
|
416
|
+
return b(t, (o.DP -= 4) + t.e + 1, o.RM);
|
|
417
417
|
},
|
|
418
418
|
/*
|
|
419
419
|
* Return a new Big whose value is the value of this Big times the value of Big y.
|
|
@@ -455,9 +455,9 @@ var OHLCV_INDICATORS;
|
|
|
455
455
|
var r = this, n = r.c[0];
|
|
456
456
|
if (t !== p) {
|
|
457
457
|
if (t !== ~~t || t < 0 || t > a) throw Error(s);
|
|
458
|
-
for (r =
|
|
458
|
+
for (r = b(new r.constructor(r), ++t, e); r.c.length < t; ) r.c.push(0);
|
|
459
459
|
}
|
|
460
|
-
return
|
|
460
|
+
return d(r, !0, !!n);
|
|
461
461
|
},
|
|
462
462
|
/*
|
|
463
463
|
* Return a string representing the value of this Big in normal notation rounded to dp fixed
|
|
@@ -474,9 +474,9 @@ var OHLCV_INDICATORS;
|
|
|
474
474
|
if (t !== p) {
|
|
475
475
|
if (t !== ~~t || t < 0 || t > a) throw Error(s);
|
|
476
476
|
// x.e may have changed if the value is rounded up.
|
|
477
|
-
for (t = t + (r =
|
|
477
|
+
for (t = t + (r = b(new r.constructor(r), t + r.e + 1, e)).e + 1; r.c.length < t; ) r.c.push(0);
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return d(r, !1, !!n);
|
|
480
480
|
},
|
|
481
481
|
/*
|
|
482
482
|
* Return a string representing the value of this Big.
|
|
@@ -486,13 +486,13 @@ var OHLCV_INDICATORS;
|
|
|
486
486
|
*/
|
|
487
487
|
y[Symbol.for("nodejs.util.inspect.custom")] = y.toJSON = y.toString = function() {
|
|
488
488
|
var t = this, e = t.constructor;
|
|
489
|
-
return
|
|
489
|
+
return d(t, t.e <= e.NE || t.e >= e.PE, !!t.c[0]);
|
|
490
490
|
},
|
|
491
491
|
/*
|
|
492
492
|
* Return the value of this Big as a primitve number.
|
|
493
493
|
*/
|
|
494
494
|
y.toNumber = function() {
|
|
495
|
-
var t = Number(
|
|
495
|
+
var t = Number(d(this, !0, !0));
|
|
496
496
|
if (!0 === this.constructor.strict && !this.eq(t.toString())) throw Error(l + "Imprecise conversion");
|
|
497
497
|
return t;
|
|
498
498
|
},
|
|
@@ -509,9 +509,9 @@ var OHLCV_INDICATORS;
|
|
|
509
509
|
var r = this, n = r.constructor, o = r.c[0];
|
|
510
510
|
if (t !== p) {
|
|
511
511
|
if (t !== ~~t || t < 1 || t > a) throw Error(c + "precision");
|
|
512
|
-
for (r =
|
|
512
|
+
for (r = b(new n(r), t, e); r.c.length < t; ) r.c.push(0);
|
|
513
513
|
}
|
|
514
|
-
return
|
|
514
|
+
return d(r, t <= r.e || r.e <= n.NE || r.e >= n.PE, !!o);
|
|
515
515
|
},
|
|
516
516
|
/*
|
|
517
517
|
* Return a string representing the value of this Big.
|
|
@@ -522,7 +522,7 @@ var OHLCV_INDICATORS;
|
|
|
522
522
|
y.valueOf = function() {
|
|
523
523
|
var t = this, e = t.constructor;
|
|
524
524
|
if (!0 === e.strict) throw Error(l + "valueOf disallowed");
|
|
525
|
-
return
|
|
525
|
+
return d(t, t.e <= e.NE || t.e >= e.PE, !0);
|
|
526
526
|
};
|
|
527
527
|
// Export
|
|
528
528
|
(
|
|
@@ -622,7 +622,7 @@ var OHLCV_INDICATORS;
|
|
|
622
622
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
623
623
|
return t;
|
|
624
624
|
}(t);
|
|
625
|
-
}(t,
|
|
625
|
+
}(t, j() ? Reflect.construct(e, r || [], P(t).constructor) : e.apply(t, r));
|
|
626
626
|
}
|
|
627
627
|
function S(t) {
|
|
628
628
|
var e = "function" == typeof Map ? new Map : void 0;
|
|
@@ -641,11 +641,11 @@ var OHLCV_INDICATORS;
|
|
|
641
641
|
}
|
|
642
642
|
function r() {
|
|
643
643
|
return function(t, e, r) {
|
|
644
|
-
if (
|
|
644
|
+
if (j()) return Reflect.construct.apply(null, arguments);
|
|
645
645
|
var n = [ null ];
|
|
646
646
|
n.push.apply(n, e);
|
|
647
647
|
var o = new (t.bind.apply(t, n));
|
|
648
|
-
return r &&
|
|
648
|
+
return r && _(o, r.prototype), o;
|
|
649
649
|
}(t, arguments, P(this).constructor);
|
|
650
650
|
}
|
|
651
651
|
return r.prototype = Object.create(t.prototype, {
|
|
@@ -655,21 +655,21 @@ var OHLCV_INDICATORS;
|
|
|
655
655
|
writable: !0,
|
|
656
656
|
configurable: !0
|
|
657
657
|
}
|
|
658
|
-
}),
|
|
658
|
+
}), _(r, t);
|
|
659
659
|
}, S(t);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function j() {
|
|
662
662
|
try {
|
|
663
663
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
664
664
|
} catch (t) {}
|
|
665
|
-
return (
|
|
665
|
+
return (j = function() {
|
|
666
666
|
return !!t;
|
|
667
667
|
})();
|
|
668
668
|
}
|
|
669
|
-
function
|
|
670
|
-
return
|
|
669
|
+
function _(t, e) {
|
|
670
|
+
return _ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
671
671
|
return t.__proto__ = e, t;
|
|
672
|
-
},
|
|
672
|
+
}, _(t, e);
|
|
673
673
|
}
|
|
674
674
|
function P(t) {
|
|
675
675
|
return P = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
@@ -694,7 +694,7 @@ var OHLCV_INDICATORS;
|
|
|
694
694
|
}
|
|
695
695
|
}), Object.defineProperty(t, "prototype", {
|
|
696
696
|
writable: !1
|
|
697
|
-
}), e &&
|
|
697
|
+
}), e && _(t, e);
|
|
698
698
|
}(e, t), r = e, n && g(r.prototype, n), o && g(r, o), Object.defineProperty(r, "prototype", {
|
|
699
699
|
writable: !1
|
|
700
700
|
}), r;
|
|
@@ -831,14 +831,14 @@ var OHLCV_INDICATORS;
|
|
|
831
831
|
}
|
|
832
832
|
}), Object.defineProperty(t, "prototype", {
|
|
833
833
|
writable: !1
|
|
834
|
-
}), e &&
|
|
834
|
+
}), e && z(t, e);
|
|
835
835
|
}
|
|
836
|
-
function
|
|
837
|
-
return
|
|
836
|
+
function z(t, e) {
|
|
837
|
+
return z = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
838
838
|
return t.__proto__ = e, t;
|
|
839
|
-
},
|
|
839
|
+
}, z(t, e);
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function q(t, e, r) {
|
|
842
842
|
return (e = $(e)) in t ? Object.defineProperty(t, e, {
|
|
843
843
|
value: r,
|
|
844
844
|
enumerable: !0,
|
|
@@ -862,7 +862,7 @@ var OHLCV_INDICATORS;
|
|
|
862
862
|
var F = function(t) {
|
|
863
863
|
function e(t) {
|
|
864
864
|
var r;
|
|
865
|
-
return D(this, e),
|
|
865
|
+
return D(this, e), q(r = N(this, e), "interval", void 0), r.interval = t, r;
|
|
866
866
|
}
|
|
867
867
|
return U(e, t), B(e, [ {
|
|
868
868
|
key: "updates",
|
|
@@ -1099,18 +1099,18 @@ var OHLCV_INDICATORS;
|
|
|
1099
1099
|
}
|
|
1100
1100
|
} ]);
|
|
1101
1101
|
}(C);
|
|
1102
|
-
function
|
|
1102
|
+
function bt(t) {
|
|
1103
1103
|
return t.length ? t.reduce((function(t, e) {
|
|
1104
1104
|
return t + e;
|
|
1105
1105
|
}), 0) / t.length : 0;
|
|
1106
1106
|
}
|
|
1107
1107
|
// ./node_modules/trading-signals/dist/BBANDS/BollingerBands.js
|
|
1108
|
-
function
|
|
1109
|
-
return
|
|
1108
|
+
function dt(t) {
|
|
1109
|
+
return dt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1110
1110
|
return typeof t;
|
|
1111
1111
|
} : function(t) {
|
|
1112
1112
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1113
|
-
},
|
|
1113
|
+
}, dt(t);
|
|
1114
1114
|
}
|
|
1115
1115
|
function mt(t, e) {
|
|
1116
1116
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -1137,18 +1137,18 @@ var OHLCV_INDICATORS;
|
|
|
1137
1137
|
}
|
|
1138
1138
|
function St(t) {
|
|
1139
1139
|
var e = function(t, e) {
|
|
1140
|
-
if ("object" !=
|
|
1140
|
+
if ("object" != dt(t) || !t) return t;
|
|
1141
1141
|
var r = t[Symbol.toPrimitive];
|
|
1142
1142
|
if (void 0 !== r) {
|
|
1143
1143
|
var n = r.call(t, e || "default");
|
|
1144
|
-
if ("object" !=
|
|
1144
|
+
if ("object" != dt(n)) return n;
|
|
1145
1145
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1146
1146
|
}
|
|
1147
1147
|
return ("string" === e ? String : Number)(t);
|
|
1148
1148
|
}(t, "string");
|
|
1149
|
-
return "symbol" ==
|
|
1149
|
+
return "symbol" == dt(e) ? e : e + "";
|
|
1150
1150
|
}
|
|
1151
|
-
var
|
|
1151
|
+
var jt = function() {
|
|
1152
1152
|
return wt((function t(e) {
|
|
1153
1153
|
var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2;
|
|
1154
1154
|
mt(this, t), Ot(this, "interval", void 0), Ot(this, "deviationMultiplier", void 0),
|
|
@@ -1158,8 +1158,8 @@ var OHLCV_INDICATORS;
|
|
|
1158
1158
|
value: function(t) {
|
|
1159
1159
|
if (this.prices.push(t), this.prices.length > this.interval) {
|
|
1160
1160
|
this.prices.shift();
|
|
1161
|
-
var e =
|
|
1162
|
-
var r = e ||
|
|
1161
|
+
var e = bt(this.prices), r = function(t, e) {
|
|
1162
|
+
var r = e || bt(t), n = bt(t.map((function(t) {
|
|
1163
1163
|
return t - r;
|
|
1164
1164
|
})).map((function(t) {
|
|
1165
1165
|
return t * t;
|
|
@@ -1187,12 +1187,12 @@ var OHLCV_INDICATORS;
|
|
|
1187
1187
|
} ]);
|
|
1188
1188
|
}();
|
|
1189
1189
|
// ./node_modules/trading-signals/dist/EMA/EMA.js
|
|
1190
|
-
function
|
|
1191
|
-
return
|
|
1190
|
+
function _t(t) {
|
|
1191
|
+
return _t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1192
1192
|
return typeof t;
|
|
1193
1193
|
} : function(t) {
|
|
1194
1194
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1195
|
-
},
|
|
1195
|
+
}, _t(t);
|
|
1196
1196
|
}
|
|
1197
1197
|
function Pt(t, e) {
|
|
1198
1198
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -1211,7 +1211,7 @@ var OHLCV_INDICATORS;
|
|
|
1211
1211
|
}
|
|
1212
1212
|
function Mt(t, e, r) {
|
|
1213
1213
|
return e = kt(e), function(t, e) {
|
|
1214
|
-
if (e && ("object" ==
|
|
1214
|
+
if (e && ("object" == _t(e) || "function" == typeof e)) return e;
|
|
1215
1215
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1216
1216
|
return function(t) {
|
|
1217
1217
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -1259,16 +1259,16 @@ var OHLCV_INDICATORS;
|
|
|
1259
1259
|
}
|
|
1260
1260
|
function Rt(t) {
|
|
1261
1261
|
var e = function(t, e) {
|
|
1262
|
-
if ("object" !=
|
|
1262
|
+
if ("object" != _t(t) || !t) return t;
|
|
1263
1263
|
var r = t[Symbol.toPrimitive];
|
|
1264
1264
|
if (void 0 !== r) {
|
|
1265
1265
|
var n = r.call(t, e || "default");
|
|
1266
|
-
if ("object" !=
|
|
1266
|
+
if ("object" != _t(n)) return n;
|
|
1267
1267
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1268
1268
|
}
|
|
1269
1269
|
return ("string" === e ? String : Number)(t);
|
|
1270
1270
|
}(t, "string");
|
|
1271
|
-
return "symbol" ==
|
|
1271
|
+
return "symbol" == _t(e) ? e : e + "";
|
|
1272
1272
|
}
|
|
1273
1273
|
var Dt = function(t) {
|
|
1274
1274
|
function e(t) {
|
|
@@ -1345,7 +1345,7 @@ var OHLCV_INDICATORS;
|
|
|
1345
1345
|
}(t, "string");
|
|
1346
1346
|
return "symbol" == Vt(e) ? e : e + "";
|
|
1347
1347
|
}
|
|
1348
|
-
var
|
|
1348
|
+
var zt = function() {
|
|
1349
1349
|
return Lt((function t(e, r, n) {
|
|
1350
1350
|
Bt(this, t), Ht(this, "short", void 0), Ht(this, "long", void 0), Ht(this, "signal", void 0),
|
|
1351
1351
|
Ht(this, "prices", []), Ht(this, "result", void 0), this.short = e, this.long = r,
|
|
@@ -1379,12 +1379,12 @@ var OHLCV_INDICATORS;
|
|
|
1379
1379
|
} ]);
|
|
1380
1380
|
}();
|
|
1381
1381
|
// ./node_modules/trading-signals/dist/RSI/RSI.js
|
|
1382
|
-
function
|
|
1383
|
-
return
|
|
1382
|
+
function qt(t) {
|
|
1383
|
+
return qt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1384
1384
|
return typeof t;
|
|
1385
1385
|
} : function(t) {
|
|
1386
1386
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1387
|
-
},
|
|
1387
|
+
}, qt(t);
|
|
1388
1388
|
}
|
|
1389
1389
|
function $t(t, e) {
|
|
1390
1390
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -1403,7 +1403,7 @@ var OHLCV_INDICATORS;
|
|
|
1403
1403
|
}
|
|
1404
1404
|
function Gt(t, e, r) {
|
|
1405
1405
|
return e = Wt(e), function(t, e) {
|
|
1406
|
-
if (e && ("object" ==
|
|
1406
|
+
if (e && ("object" == qt(e) || "function" == typeof e)) return e;
|
|
1407
1407
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1408
1408
|
return function(t) {
|
|
1409
1409
|
if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -1451,16 +1451,16 @@ var OHLCV_INDICATORS;
|
|
|
1451
1451
|
}
|
|
1452
1452
|
function Zt(t) {
|
|
1453
1453
|
var e = function(t, e) {
|
|
1454
|
-
if ("object" !=
|
|
1454
|
+
if ("object" != qt(t) || !t) return t;
|
|
1455
1455
|
var r = t[Symbol.toPrimitive];
|
|
1456
1456
|
if (void 0 !== r) {
|
|
1457
1457
|
var n = r.call(t, e || "default");
|
|
1458
|
-
if ("object" !=
|
|
1458
|
+
if ("object" != qt(n)) return n;
|
|
1459
1459
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1460
1460
|
}
|
|
1461
1461
|
return ("string" === e ? String : Number)(t);
|
|
1462
1462
|
}(t, "string");
|
|
1463
|
-
return "symbol" ==
|
|
1463
|
+
return "symbol" == qt(e) ? e : e + "";
|
|
1464
1464
|
}
|
|
1465
1465
|
var te = function(t) {
|
|
1466
1466
|
function e(t) {
|
|
@@ -1587,19 +1587,28 @@ var OHLCV_INDICATORS;
|
|
|
1587
1587
|
if (null == t || null == e) return null;
|
|
1588
1588
|
var o = t >= 0, i = Math.abs(t), a = e.upper, u = e.lower, l = ne((i - u) / (a - u), r);
|
|
1589
1589
|
return 0 === l ? o ? .01 : -.01 : n ? o ? Math.min(l, 1) : Math.max(-l, -1) : o ? l : -l;
|
|
1590
|
+
}, se = function(t, e, r, n, o) {
|
|
1591
|
+
if (o ? t[e][t[e].length - 1] = n : t[e].push(n), t[e].length > r && t[e].shift(),
|
|
1592
|
+
t.length < r) return null;
|
|
1593
|
+
var i = t[e].reduce((function(t, e) {
|
|
1594
|
+
return t + e;
|
|
1595
|
+
}), 0) / r, a = Math.sqrt(t[e].reduce((function(t, e) {
|
|
1596
|
+
return t + Math.pow(e - i, 2);
|
|
1597
|
+
}), 0) / r);
|
|
1598
|
+
return (n - i) / a;
|
|
1590
1599
|
};
|
|
1591
1600
|
// ./src/moving-averages/movingAverages.js
|
|
1592
|
-
function
|
|
1593
|
-
return
|
|
1601
|
+
function fe(t) {
|
|
1602
|
+
return fe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1594
1603
|
return typeof t;
|
|
1595
1604
|
} : function(t) {
|
|
1596
1605
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1597
|
-
},
|
|
1606
|
+
}, fe(t);
|
|
1598
1607
|
}
|
|
1599
|
-
function
|
|
1608
|
+
function he(t, e) {
|
|
1600
1609
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1601
1610
|
if (!r) {
|
|
1602
|
-
if (Array.isArray(t) || (r =
|
|
1611
|
+
if (Array.isArray(t) || (r = pe(t)) || e && t && "number" == typeof t.length) {
|
|
1603
1612
|
r && (t = r);
|
|
1604
1613
|
var n = 0, o = function() {};
|
|
1605
1614
|
return {
|
|
@@ -1641,32 +1650,52 @@ var OHLCV_INDICATORS;
|
|
|
1641
1650
|
}
|
|
1642
1651
|
};
|
|
1643
1652
|
}
|
|
1644
|
-
function
|
|
1653
|
+
function ye(t) {
|
|
1645
1654
|
return function(t) {
|
|
1646
|
-
if (Array.isArray(t)) return
|
|
1655
|
+
if (Array.isArray(t)) return ve(t);
|
|
1647
1656
|
}(t) || function(t) {
|
|
1648
1657
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1649
|
-
}(t) ||
|
|
1658
|
+
}(t) || pe(t) || function() {
|
|
1650
1659
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1651
1660
|
}();
|
|
1652
1661
|
}
|
|
1653
|
-
function
|
|
1662
|
+
function pe(t, e) {
|
|
1654
1663
|
if (t) {
|
|
1655
|
-
if ("string" == typeof t) return
|
|
1664
|
+
if ("string" == typeof t) return ve(t, e);
|
|
1656
1665
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1657
|
-
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) ?
|
|
1666
|
+
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;
|
|
1658
1667
|
}
|
|
1659
1668
|
}
|
|
1660
|
-
function
|
|
1669
|
+
function ve(t, e) {
|
|
1661
1670
|
(null == e || e > t.length) && (e = t.length);
|
|
1662
1671
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1663
1672
|
return n;
|
|
1664
1673
|
}
|
|
1665
|
-
|
|
1674
|
+
function be(t, e, r) {
|
|
1675
|
+
return (e = function(t) {
|
|
1676
|
+
var e = function(t, e) {
|
|
1677
|
+
if ("object" != fe(t) || !t) return t;
|
|
1678
|
+
var r = t[Symbol.toPrimitive];
|
|
1679
|
+
if (void 0 !== r) {
|
|
1680
|
+
var n = r.call(t, e || "default");
|
|
1681
|
+
if ("object" != fe(n)) return n;
|
|
1682
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1683
|
+
}
|
|
1684
|
+
return ("string" === e ? String : Number)(t);
|
|
1685
|
+
}(t, "string");
|
|
1686
|
+
return "symbol" == fe(e) ? e : e + "";
|
|
1687
|
+
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1688
|
+
value: r,
|
|
1689
|
+
enumerable: !0,
|
|
1690
|
+
configurable: !0,
|
|
1691
|
+
writable: !0
|
|
1692
|
+
}) : t[e] = r, t;
|
|
1693
|
+
}
|
|
1694
|
+
var de = {
|
|
1666
1695
|
ema: Dt,
|
|
1667
1696
|
sma: nt
|
|
1668
|
-
},
|
|
1669
|
-
if (!r || "object" !==
|
|
1697
|
+
}, me = function(t, e, r, n) {
|
|
1698
|
+
if (!r || "object" !== fe(r)) throw new Error('"options" must be an object in '.concat(t, ". eg: {target, height, range}"));
|
|
1670
1699
|
var o = r.target, i = void 0 === o ? "close" : o, a = r.diff, u = void 0 === a ? null : a;
|
|
1671
1700
|
if ("string" != typeof i) throw new Error('"target" must be a valid keyName '.concat(t, "."));
|
|
1672
1701
|
if ("number" != typeof e || e <= 0) throw new Error('"size" must be a positive number in '.concat(t, "."));
|
|
@@ -1675,18 +1704,18 @@ var OHLCV_INDICATORS;
|
|
|
1675
1704
|
target: i,
|
|
1676
1705
|
diff: null
|
|
1677
1706
|
};
|
|
1678
|
-
if (null !== u && ("object" ===
|
|
1679
|
-
var c = u = !0 === u ? {} : u, s = c.stdDev, f = void 0 === s ? 2 : s, h = c.scale, y = void 0 === h ? .05 : h, p = c.targets, v = void 0 === p ? [ "close" ] : p,
|
|
1707
|
+
if (null !== u && ("object" === fe(u) || "boolean" == typeof u && !0 === u)) {
|
|
1708
|
+
var c = u = !0 === u ? {} : u, s = c.stdDev, f = void 0 === s ? 2 : s, h = c.scale, y = void 0 === h ? .05 : h, p = c.targets, v = void 0 === p ? [ "close" ] : p, b = c.size, d = void 0 === b ? e : b, m = c.lag, g = void 0 === m ? 0 : m, w = c.autoMinMax, O = void 0 !== w && w;
|
|
1680
1709
|
if ("number" != typeof f || f <= 0) throw new Error('"diff.stdDev" must be a number greater than 0 in '.concat(t, "."));
|
|
1681
1710
|
if ("number" != typeof y || !n.includes(y)) throw new Error('"diff.scale" must be a number between 0.01 and 1 in '.concat(t, "."));
|
|
1682
|
-
if ("number" != typeof
|
|
1711
|
+
if ("number" != typeof d || !Number.isInteger(d) || d <= 0) throw new Error('"diff.size" must be an integer greater than or equal to size in '.concat(t, "."));
|
|
1683
1712
|
if (!Array.isArray(v)) throw new Error('"diff.targest" must be an array of keyNames with at least 1 item in '.concat(t, "."));
|
|
1684
1713
|
if ("number" != typeof g || !Number.isInteger(g) || g < 0) throw new Error('"diff.lag" must be an integer greater than 0 in '.concat(t, "."));
|
|
1685
1714
|
if ("boolean" != typeof O) throw new Error('"diff.autoMinMax" must be an boolean in '.concat(t, "."));
|
|
1686
1715
|
l.diff = {
|
|
1687
1716
|
stdDev: f,
|
|
1688
1717
|
scale: y,
|
|
1689
|
-
size:
|
|
1718
|
+
size: d,
|
|
1690
1719
|
targets: v,
|
|
1691
1720
|
lag: g,
|
|
1692
1721
|
autoMinMax: O
|
|
@@ -1695,26 +1724,26 @@ var OHLCV_INDICATORS;
|
|
|
1695
1724
|
return l;
|
|
1696
1725
|
};
|
|
1697
1726
|
// ./src/moving-averages/macd.js
|
|
1698
|
-
function
|
|
1699
|
-
return
|
|
1727
|
+
function ge(t) {
|
|
1728
|
+
return ge = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1700
1729
|
return typeof t;
|
|
1701
1730
|
} : function(t) {
|
|
1702
1731
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1703
|
-
},
|
|
1732
|
+
}, ge(t);
|
|
1704
1733
|
}
|
|
1705
|
-
function
|
|
1734
|
+
function we(t, e, r) {
|
|
1706
1735
|
return (e = function(t) {
|
|
1707
1736
|
var e = function(t, e) {
|
|
1708
|
-
if ("object" !=
|
|
1737
|
+
if ("object" != ge(t) || !t) return t;
|
|
1709
1738
|
var r = t[Symbol.toPrimitive];
|
|
1710
1739
|
if (void 0 !== r) {
|
|
1711
1740
|
var n = r.call(t, e || "default");
|
|
1712
|
-
if ("object" !=
|
|
1741
|
+
if ("object" != ge(n)) return n;
|
|
1713
1742
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1714
1743
|
}
|
|
1715
1744
|
return ("string" === e ? String : Number)(t);
|
|
1716
1745
|
}(t, "string");
|
|
1717
|
-
return "symbol" ==
|
|
1746
|
+
return "symbol" == ge(e) ? e : e + "";
|
|
1718
1747
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1719
1748
|
value: r,
|
|
1720
1749
|
enumerable: !0,
|
|
@@ -1722,57 +1751,57 @@ var OHLCV_INDICATORS;
|
|
|
1722
1751
|
writable: !0
|
|
1723
1752
|
}) : t[e] = r, t;
|
|
1724
1753
|
}
|
|
1725
|
-
function
|
|
1754
|
+
function Oe(t) {
|
|
1726
1755
|
return function(t) {
|
|
1727
|
-
if (Array.isArray(t)) return
|
|
1756
|
+
if (Array.isArray(t)) return Se(t);
|
|
1728
1757
|
}(t) || function(t) {
|
|
1729
1758
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1730
1759
|
}(t) || function(t, e) {
|
|
1731
1760
|
if (t) {
|
|
1732
|
-
if ("string" == typeof t) return
|
|
1761
|
+
if ("string" == typeof t) return Se(t, e);
|
|
1733
1762
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1734
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
1763
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Se(t, e) : void 0;
|
|
1735
1764
|
}
|
|
1736
1765
|
}(t) || function() {
|
|
1737
1766
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1738
1767
|
}();
|
|
1739
1768
|
}
|
|
1740
|
-
function
|
|
1769
|
+
function Se(t, e) {
|
|
1741
1770
|
(null == e || e > t.length) && (e = t.length);
|
|
1742
1771
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1743
1772
|
return n;
|
|
1744
1773
|
}
|
|
1745
|
-
var
|
|
1774
|
+
var je = "close";
|
|
1746
1775
|
// ./src/moving-averages/relativeVolume.js
|
|
1747
|
-
function
|
|
1776
|
+
function _e(t) {
|
|
1748
1777
|
return function(t) {
|
|
1749
|
-
if (Array.isArray(t)) return
|
|
1778
|
+
if (Array.isArray(t)) return Pe(t);
|
|
1750
1779
|
}(t) || function(t) {
|
|
1751
1780
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1752
1781
|
}(t) || function(t, e) {
|
|
1753
1782
|
if (t) {
|
|
1754
|
-
if ("string" == typeof t) return
|
|
1783
|
+
if ("string" == typeof t) return Pe(t, e);
|
|
1755
1784
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1756
|
-
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) ?
|
|
1785
|
+
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) ? Pe(t, e) : void 0;
|
|
1757
1786
|
}
|
|
1758
1787
|
}(t) || function() {
|
|
1759
1788
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1760
1789
|
}();
|
|
1761
1790
|
}
|
|
1762
|
-
function
|
|
1791
|
+
function Pe(t, e) {
|
|
1763
1792
|
(null == e || e > t.length) && (e = t.length);
|
|
1764
1793
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1765
1794
|
return n;
|
|
1766
1795
|
}
|
|
1767
1796
|
// ./src/moving-averages/donchianChannel.js
|
|
1768
|
-
function
|
|
1769
|
-
return
|
|
1797
|
+
function Ae(t) {
|
|
1798
|
+
return Ae = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1770
1799
|
return typeof t;
|
|
1771
1800
|
} : function(t) {
|
|
1772
1801
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1773
|
-
},
|
|
1802
|
+
}, Ae(t);
|
|
1774
1803
|
}
|
|
1775
|
-
function
|
|
1804
|
+
function Ee(t, e) {
|
|
1776
1805
|
var r = Object.keys(t);
|
|
1777
1806
|
if (Object.getOwnPropertySymbols) {
|
|
1778
1807
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -1782,19 +1811,19 @@ var OHLCV_INDICATORS;
|
|
|
1782
1811
|
}
|
|
1783
1812
|
return r;
|
|
1784
1813
|
}
|
|
1785
|
-
function
|
|
1814
|
+
function Me(t, e, r) {
|
|
1786
1815
|
return (e = function(t) {
|
|
1787
1816
|
var e = function(t, e) {
|
|
1788
|
-
if ("object" !=
|
|
1817
|
+
if ("object" != Ae(t) || !t) return t;
|
|
1789
1818
|
var r = t[Symbol.toPrimitive];
|
|
1790
1819
|
if (void 0 !== r) {
|
|
1791
1820
|
var n = r.call(t, e || "default");
|
|
1792
|
-
if ("object" !=
|
|
1821
|
+
if ("object" != Ae(n)) return n;
|
|
1793
1822
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1794
1823
|
}
|
|
1795
1824
|
return ("string" === e ? String : Number)(t);
|
|
1796
1825
|
}(t, "string");
|
|
1797
|
-
return "symbol" ==
|
|
1826
|
+
return "symbol" == Ae(e) ? e : e + "";
|
|
1798
1827
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1799
1828
|
value: r,
|
|
1800
1829
|
enumerable: !0,
|
|
@@ -1802,19 +1831,19 @@ var OHLCV_INDICATORS;
|
|
|
1802
1831
|
writable: !0
|
|
1803
1832
|
}) : t[e] = r, t;
|
|
1804
1833
|
}
|
|
1805
|
-
function
|
|
1834
|
+
function xe(t) {
|
|
1806
1835
|
return function(t) {
|
|
1807
|
-
if (Array.isArray(t)) return
|
|
1836
|
+
if (Array.isArray(t)) return Ie(t);
|
|
1808
1837
|
}(t) || function(t) {
|
|
1809
1838
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1810
|
-
}(t) ||
|
|
1839
|
+
}(t) || Te(t) || function() {
|
|
1811
1840
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1812
1841
|
}();
|
|
1813
1842
|
}
|
|
1814
|
-
function
|
|
1843
|
+
function ke(t, e) {
|
|
1815
1844
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1816
1845
|
if (!r) {
|
|
1817
|
-
if (Array.isArray(t) || (r =
|
|
1846
|
+
if (Array.isArray(t) || (r = Te(t)) || e && t && "number" == typeof t.length) {
|
|
1818
1847
|
r && (t = r);
|
|
1819
1848
|
var n = 0, o = function() {};
|
|
1820
1849
|
return {
|
|
@@ -1856,27 +1885,27 @@ var OHLCV_INDICATORS;
|
|
|
1856
1885
|
}
|
|
1857
1886
|
};
|
|
1858
1887
|
}
|
|
1859
|
-
function
|
|
1888
|
+
function Te(t, e) {
|
|
1860
1889
|
if (t) {
|
|
1861
|
-
if ("string" == typeof t) return
|
|
1890
|
+
if ("string" == typeof t) return Ie(t, e);
|
|
1862
1891
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1863
|
-
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) ?
|
|
1892
|
+
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) ? Ie(t, e) : void 0;
|
|
1864
1893
|
}
|
|
1865
1894
|
}
|
|
1866
|
-
function
|
|
1895
|
+
function Ie(t, e) {
|
|
1867
1896
|
(null == e || e > t.length) && (e = t.length);
|
|
1868
1897
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1869
1898
|
return n;
|
|
1870
1899
|
}
|
|
1871
1900
|
// ./src/moving-averages/bollingerBands.js
|
|
1872
|
-
function
|
|
1873
|
-
return
|
|
1901
|
+
function Ce(t) {
|
|
1902
|
+
return Ce = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1874
1903
|
return typeof t;
|
|
1875
1904
|
} : function(t) {
|
|
1876
1905
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1877
|
-
},
|
|
1906
|
+
}, Ce(t);
|
|
1878
1907
|
}
|
|
1879
|
-
function
|
|
1908
|
+
function Re(t, e) {
|
|
1880
1909
|
var r = Object.keys(t);
|
|
1881
1910
|
if (Object.getOwnPropertySymbols) {
|
|
1882
1911
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -1886,19 +1915,19 @@ var OHLCV_INDICATORS;
|
|
|
1886
1915
|
}
|
|
1887
1916
|
return r;
|
|
1888
1917
|
}
|
|
1889
|
-
function
|
|
1918
|
+
function De(t, e, r) {
|
|
1890
1919
|
return (e = function(t) {
|
|
1891
1920
|
var e = function(t, e) {
|
|
1892
|
-
if ("object" !=
|
|
1921
|
+
if ("object" != Ce(t) || !t) return t;
|
|
1893
1922
|
var r = t[Symbol.toPrimitive];
|
|
1894
1923
|
if (void 0 !== r) {
|
|
1895
1924
|
var n = r.call(t, e || "default");
|
|
1896
|
-
if ("object" !=
|
|
1925
|
+
if ("object" != Ce(n)) return n;
|
|
1897
1926
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1898
1927
|
}
|
|
1899
1928
|
return ("string" === e ? String : Number)(t);
|
|
1900
1929
|
}(t, "string");
|
|
1901
|
-
return "symbol" ==
|
|
1930
|
+
return "symbol" == Ce(e) ? e : e + "";
|
|
1902
1931
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1903
1932
|
value: r,
|
|
1904
1933
|
enumerable: !0,
|
|
@@ -1906,19 +1935,19 @@ var OHLCV_INDICATORS;
|
|
|
1906
1935
|
writable: !0
|
|
1907
1936
|
}) : t[e] = r, t;
|
|
1908
1937
|
}
|
|
1909
|
-
function
|
|
1938
|
+
function Ve(t) {
|
|
1910
1939
|
return function(t) {
|
|
1911
|
-
if (Array.isArray(t)) return
|
|
1940
|
+
if (Array.isArray(t)) return Le(t);
|
|
1912
1941
|
}(t) || function(t) {
|
|
1913
1942
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1914
|
-
}(t) ||
|
|
1943
|
+
}(t) || Ne(t) || function() {
|
|
1915
1944
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1916
1945
|
}();
|
|
1917
1946
|
}
|
|
1918
|
-
function
|
|
1947
|
+
function Be(t, e) {
|
|
1919
1948
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1920
1949
|
if (!r) {
|
|
1921
|
-
if (Array.isArray(t) || (r =
|
|
1950
|
+
if (Array.isArray(t) || (r = Ne(t)) || e && t && "number" == typeof t.length) {
|
|
1922
1951
|
r && (t = r);
|
|
1923
1952
|
var n = 0, o = function() {};
|
|
1924
1953
|
return {
|
|
@@ -1960,48 +1989,48 @@ var OHLCV_INDICATORS;
|
|
|
1960
1989
|
}
|
|
1961
1990
|
};
|
|
1962
1991
|
}
|
|
1963
|
-
function
|
|
1992
|
+
function Ne(t, e) {
|
|
1964
1993
|
if (t) {
|
|
1965
|
-
if ("string" == typeof t) return
|
|
1994
|
+
if ("string" == typeof t) return Le(t, e);
|
|
1966
1995
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1967
|
-
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) ?
|
|
1996
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Le(t, e) : void 0;
|
|
1968
1997
|
}
|
|
1969
1998
|
}
|
|
1970
|
-
function
|
|
1999
|
+
function Le(t, e) {
|
|
1971
2000
|
(null == e || e > t.length) && (e = t.length);
|
|
1972
2001
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1973
2002
|
return n;
|
|
1974
2003
|
}
|
|
1975
2004
|
// ./src/oscillators/volumeOscillator.js
|
|
1976
|
-
function
|
|
2005
|
+
function He(t) {
|
|
1977
2006
|
return function(t) {
|
|
1978
|
-
if (Array.isArray(t)) return
|
|
2007
|
+
if (Array.isArray(t)) return Ue(t);
|
|
1979
2008
|
}(t) || function(t) {
|
|
1980
2009
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1981
2010
|
}(t) || function(t, e) {
|
|
1982
2011
|
if (t) {
|
|
1983
|
-
if ("string" == typeof t) return
|
|
2012
|
+
if ("string" == typeof t) return Ue(t, e);
|
|
1984
2013
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1985
|
-
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) ?
|
|
2014
|
+
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) ? Ue(t, e) : void 0;
|
|
1986
2015
|
}
|
|
1987
2016
|
}(t) || function() {
|
|
1988
2017
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1989
2018
|
}();
|
|
1990
2019
|
}
|
|
1991
|
-
function
|
|
2020
|
+
function Ue(t, e) {
|
|
1992
2021
|
(null == e || e > t.length) && (e = t.length);
|
|
1993
2022
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1994
2023
|
return n;
|
|
1995
2024
|
}
|
|
1996
2025
|
// ./src/studies/candleVectors.js
|
|
1997
|
-
function
|
|
1998
|
-
return
|
|
2026
|
+
function ze(t) {
|
|
2027
|
+
return ze = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1999
2028
|
return typeof t;
|
|
2000
2029
|
} : function(t) {
|
|
2001
2030
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2002
|
-
},
|
|
2031
|
+
}, ze(t);
|
|
2003
2032
|
}
|
|
2004
|
-
function
|
|
2033
|
+
function qe(t, e) {
|
|
2005
2034
|
var r = Object.keys(t);
|
|
2006
2035
|
if (Object.getOwnPropertySymbols) {
|
|
2007
2036
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -2011,30 +2040,30 @@ var OHLCV_INDICATORS;
|
|
|
2011
2040
|
}
|
|
2012
2041
|
return r;
|
|
2013
2042
|
}
|
|
2014
|
-
function
|
|
2043
|
+
function $e(t) {
|
|
2015
2044
|
for (var e = 1; e < arguments.length; e++) {
|
|
2016
2045
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2017
|
-
e % 2 ?
|
|
2018
|
-
|
|
2019
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
2046
|
+
e % 2 ? qe(Object(r), !0).forEach((function(e) {
|
|
2047
|
+
Fe(t, e, r[e]);
|
|
2048
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : qe(Object(r)).forEach((function(e) {
|
|
2020
2049
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2021
2050
|
}));
|
|
2022
2051
|
}
|
|
2023
2052
|
return t;
|
|
2024
2053
|
}
|
|
2025
|
-
function
|
|
2054
|
+
function Fe(t, e, r) {
|
|
2026
2055
|
return (e = function(t) {
|
|
2027
2056
|
var e = function(t, e) {
|
|
2028
|
-
if ("object" !=
|
|
2057
|
+
if ("object" != ze(t) || !t) return t;
|
|
2029
2058
|
var r = t[Symbol.toPrimitive];
|
|
2030
2059
|
if (void 0 !== r) {
|
|
2031
2060
|
var n = r.call(t, e || "default");
|
|
2032
|
-
if ("object" !=
|
|
2061
|
+
if ("object" != ze(n)) return n;
|
|
2033
2062
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2034
2063
|
}
|
|
2035
2064
|
return ("string" === e ? String : Number)(t);
|
|
2036
2065
|
}(t, "string");
|
|
2037
|
-
return "symbol" ==
|
|
2066
|
+
return "symbol" == ze(e) ? e : e + "";
|
|
2038
2067
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
2039
2068
|
value: r,
|
|
2040
2069
|
enumerable: !0,
|
|
@@ -2042,16 +2071,16 @@ var OHLCV_INDICATORS;
|
|
|
2042
2071
|
writable: !0
|
|
2043
2072
|
}) : t[e] = r, t;
|
|
2044
2073
|
}
|
|
2045
|
-
function
|
|
2074
|
+
function Ke(t) {
|
|
2046
2075
|
return function(t) {
|
|
2047
|
-
if (Array.isArray(t)) return
|
|
2076
|
+
if (Array.isArray(t)) return Ye(t);
|
|
2048
2077
|
}(t) || function(t) {
|
|
2049
2078
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2050
|
-
}(t) ||
|
|
2079
|
+
}(t) || We(t) || function() {
|
|
2051
2080
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2052
2081
|
}();
|
|
2053
2082
|
}
|
|
2054
|
-
function
|
|
2083
|
+
function Ge(t, e) {
|
|
2055
2084
|
return function(t) {
|
|
2056
2085
|
if (Array.isArray(t)) return t;
|
|
2057
2086
|
}(t) || function(t, e) {
|
|
@@ -2074,14 +2103,14 @@ var OHLCV_INDICATORS;
|
|
|
2074
2103
|
}
|
|
2075
2104
|
return u;
|
|
2076
2105
|
}
|
|
2077
|
-
}(t, e) ||
|
|
2106
|
+
}(t, e) || We(t, e) || function() {
|
|
2078
2107
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2079
2108
|
}();
|
|
2080
2109
|
}
|
|
2081
|
-
function
|
|
2110
|
+
function Je(t, e) {
|
|
2082
2111
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2083
2112
|
if (!r) {
|
|
2084
|
-
if (Array.isArray(t) || (r =
|
|
2113
|
+
if (Array.isArray(t) || (r = We(t)) || e && t && "number" == typeof t.length) {
|
|
2085
2114
|
r && (t = r);
|
|
2086
2115
|
var n = 0, o = function() {};
|
|
2087
2116
|
return {
|
|
@@ -2123,41 +2152,32 @@ var OHLCV_INDICATORS;
|
|
|
2123
2152
|
}
|
|
2124
2153
|
};
|
|
2125
2154
|
}
|
|
2126
|
-
function
|
|
2155
|
+
function We(t, e) {
|
|
2127
2156
|
if (t) {
|
|
2128
|
-
if ("string" == typeof t) return
|
|
2157
|
+
if ("string" == typeof t) return Ye(t, e);
|
|
2129
2158
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2130
|
-
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) ?
|
|
2159
|
+
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) ? Ye(t, e) : void 0;
|
|
2131
2160
|
}
|
|
2132
2161
|
}
|
|
2133
|
-
function
|
|
2162
|
+
function Ye(t, e) {
|
|
2134
2163
|
(null == e || e > t.length) && (e = t.length);
|
|
2135
2164
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2136
2165
|
return n;
|
|
2137
2166
|
}
|
|
2138
|
-
var
|
|
2167
|
+
var Qe = function(t, e) {
|
|
2139
2168
|
return t - e;
|
|
2140
|
-
}, Ye = function(t, e, r, n, o) {
|
|
2141
|
-
if (o ? t[e][t[e].length - 1] = n : t[e].push(n), t[e].length > r && t[e].shift(),
|
|
2142
|
-
t.length < r) return null;
|
|
2143
|
-
var i = t[e].reduce((function(t, e) {
|
|
2144
|
-
return t + e;
|
|
2145
|
-
}), 0) / r, a = Math.sqrt(t[e].reduce((function(t, e) {
|
|
2146
|
-
return t + Math.pow(e - i, 2);
|
|
2147
|
-
}), 0) / r);
|
|
2148
|
-
return (n - i) / a;
|
|
2149
2169
|
};
|
|
2150
2170
|
// ./src/studies/lag.js
|
|
2151
|
-
function
|
|
2171
|
+
function Xe(t) {
|
|
2152
2172
|
return function(t) {
|
|
2153
|
-
if (Array.isArray(t)) return
|
|
2173
|
+
if (Array.isArray(t)) return rr(t);
|
|
2154
2174
|
}(t) || function(t) {
|
|
2155
2175
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2156
|
-
}(t) ||
|
|
2176
|
+
}(t) || er(t) || function() {
|
|
2157
2177
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2158
2178
|
}();
|
|
2159
2179
|
}
|
|
2160
|
-
function
|
|
2180
|
+
function Ze(t, e) {
|
|
2161
2181
|
return function(t) {
|
|
2162
2182
|
if (Array.isArray(t)) return t;
|
|
2163
2183
|
}(t) || function(t, e) {
|
|
@@ -2180,14 +2200,14 @@ var OHLCV_INDICATORS;
|
|
|
2180
2200
|
}
|
|
2181
2201
|
return u;
|
|
2182
2202
|
}
|
|
2183
|
-
}(t, e) ||
|
|
2203
|
+
}(t, e) || er(t, e) || function() {
|
|
2184
2204
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2185
2205
|
}();
|
|
2186
2206
|
}
|
|
2187
|
-
function
|
|
2207
|
+
function tr(t, e) {
|
|
2188
2208
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2189
2209
|
if (!r) {
|
|
2190
|
-
if (Array.isArray(t) || (r =
|
|
2210
|
+
if (Array.isArray(t) || (r = er(t)) || e && t && "number" == typeof t.length) {
|
|
2191
2211
|
r && (t = r);
|
|
2192
2212
|
var n = 0, o = function() {};
|
|
2193
2213
|
return {
|
|
@@ -2229,42 +2249,42 @@ var OHLCV_INDICATORS;
|
|
|
2229
2249
|
}
|
|
2230
2250
|
};
|
|
2231
2251
|
}
|
|
2232
|
-
function
|
|
2252
|
+
function er(t, e) {
|
|
2233
2253
|
if (t) {
|
|
2234
|
-
if ("string" == typeof t) return
|
|
2254
|
+
if ("string" == typeof t) return rr(t, e);
|
|
2235
2255
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2236
|
-
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) ?
|
|
2256
|
+
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) ? rr(t, e) : void 0;
|
|
2237
2257
|
}
|
|
2238
2258
|
}
|
|
2239
|
-
function
|
|
2259
|
+
function rr(t, e) {
|
|
2240
2260
|
(null == e || e > t.length) && (e = t.length);
|
|
2241
2261
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2242
2262
|
return n;
|
|
2243
2263
|
}
|
|
2244
|
-
function
|
|
2245
|
-
return
|
|
2264
|
+
function nr(t) {
|
|
2265
|
+
return nr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2246
2266
|
return typeof t;
|
|
2247
2267
|
} : function(t) {
|
|
2248
2268
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2249
|
-
},
|
|
2269
|
+
}, nr(t);
|
|
2250
2270
|
}
|
|
2251
|
-
var
|
|
2271
|
+
var or = function(t, e) {
|
|
2252
2272
|
var r = t.instances, n = t.verticalOhlcv, o = t.nullArray;
|
|
2253
2273
|
if (0 === e) {
|
|
2254
2274
|
var i = t.inputParams, a = t.priceBased, u = i.filter((function(t) {
|
|
2255
2275
|
return "lag" === t.key;
|
|
2256
2276
|
}));
|
|
2257
|
-
if ("object" !==
|
|
2277
|
+
if ("object" !== nr(u)) return;
|
|
2258
2278
|
var l, c = u.map((function(t) {
|
|
2259
2279
|
return t.params;
|
|
2260
|
-
})), s =
|
|
2280
|
+
})), s = tr(c);
|
|
2261
2281
|
try {
|
|
2262
2282
|
for (s.s(); !(l = s.n()).done; ) {
|
|
2263
|
-
var f, h =
|
|
2283
|
+
var f, h = Ze(l.value, 2), y = h[0], p = h[1], v = tr(y);
|
|
2264
2284
|
try {
|
|
2265
2285
|
for (v.s(); !(f = v.n()).done; ) {
|
|
2266
|
-
var
|
|
2267
|
-
if (a.includes(
|
|
2286
|
+
var b = f.value;
|
|
2287
|
+
if (a.includes(b)) for (var d = 1; d <= p; d++) a.push("".concat(b, "_lag_").concat(d));
|
|
2268
2288
|
}
|
|
2269
2289
|
} catch (t) {
|
|
2270
2290
|
v.e(t);
|
|
@@ -2281,19 +2301,19 @@ var OHLCV_INDICATORS;
|
|
|
2281
2301
|
lagParams: c
|
|
2282
2302
|
};
|
|
2283
2303
|
}
|
|
2284
|
-
var m, g =
|
|
2304
|
+
var m, g = tr(r.lag.lagParams);
|
|
2285
2305
|
try {
|
|
2286
2306
|
for (g.s(); !(m = g.n()).done; ) {
|
|
2287
|
-
var w, O =
|
|
2307
|
+
var w, O = Ze(m.value, 2), S = O[0], j = O[1], _ = tr(S);
|
|
2288
2308
|
try {
|
|
2289
|
-
for (
|
|
2309
|
+
for (_.s(); !(w = _.n()).done; ) {
|
|
2290
2310
|
var P = w.value, A = n[P];
|
|
2291
2311
|
// Initialize lagged arrays only on the first index
|
|
2292
|
-
if (0 === e) for (var E = 1; E <=
|
|
2293
|
-
n["".concat(P, "_lag_").concat(E)] =
|
|
2312
|
+
if (0 === e) for (var E = 1; E <= j; E++) {
|
|
2313
|
+
n["".concat(P, "_lag_").concat(E)] = Xe(o);
|
|
2294
2314
|
}
|
|
2295
2315
|
// Populate lagged values
|
|
2296
|
-
for (var M = 1; M <=
|
|
2316
|
+
for (var M = 1; M <= j; M++) {
|
|
2297
2317
|
var x = "".concat(P, "_lag_").concat(M), k = e - M, T = k <= 0 || void 0 === A[k] ? null : A[k];
|
|
2298
2318
|
t.pushToMain({
|
|
2299
2319
|
index: e,
|
|
@@ -2303,9 +2323,9 @@ var OHLCV_INDICATORS;
|
|
|
2303
2323
|
}
|
|
2304
2324
|
}
|
|
2305
2325
|
} catch (t) {
|
|
2306
|
-
|
|
2326
|
+
_.e(t);
|
|
2307
2327
|
} finally {
|
|
2308
|
-
|
|
2328
|
+
_.f();
|
|
2309
2329
|
}
|
|
2310
2330
|
}
|
|
2311
2331
|
} catch (t) {
|
|
@@ -2316,59 +2336,59 @@ var OHLCV_INDICATORS;
|
|
|
2316
2336
|
return !0;
|
|
2317
2337
|
};
|
|
2318
2338
|
// ./src/studies/findCrosses.js
|
|
2319
|
-
function
|
|
2339
|
+
function ir(t) {
|
|
2320
2340
|
return function(t) {
|
|
2321
|
-
if (Array.isArray(t)) return
|
|
2341
|
+
if (Array.isArray(t)) return ur(t);
|
|
2322
2342
|
}(t) || function(t) {
|
|
2323
2343
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2324
|
-
}(t) ||
|
|
2344
|
+
}(t) || ar(t) || function() {
|
|
2325
2345
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2326
2346
|
}();
|
|
2327
2347
|
}
|
|
2328
|
-
function
|
|
2348
|
+
function ar(t, e) {
|
|
2329
2349
|
if (t) {
|
|
2330
|
-
if ("string" == typeof t) return
|
|
2350
|
+
if ("string" == typeof t) return ur(t, e);
|
|
2331
2351
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2332
|
-
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) ?
|
|
2352
|
+
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) ? ur(t, e) : void 0;
|
|
2333
2353
|
}
|
|
2334
2354
|
}
|
|
2335
|
-
function
|
|
2355
|
+
function ur(t, e) {
|
|
2336
2356
|
(null == e || e > t.length) && (e = t.length);
|
|
2337
2357
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2338
2358
|
return n;
|
|
2339
2359
|
}
|
|
2340
|
-
function
|
|
2341
|
-
return
|
|
2360
|
+
function lr(t) {
|
|
2361
|
+
return lr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2342
2362
|
return typeof t;
|
|
2343
2363
|
} : function(t) {
|
|
2344
2364
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2345
|
-
},
|
|
2365
|
+
}, lr(t);
|
|
2346
2366
|
}
|
|
2347
|
-
function
|
|
2367
|
+
function cr(t, e) {
|
|
2348
2368
|
for (var r = 0; r < e.length; r++) {
|
|
2349
2369
|
var n = e[r];
|
|
2350
2370
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
2351
|
-
Object.defineProperty(t,
|
|
2371
|
+
Object.defineProperty(t, sr(n.key), n);
|
|
2352
2372
|
}
|
|
2353
2373
|
}
|
|
2354
|
-
function
|
|
2374
|
+
function sr(t) {
|
|
2355
2375
|
var e = function(t, e) {
|
|
2356
|
-
if ("object" !=
|
|
2376
|
+
if ("object" != lr(t) || !t) return t;
|
|
2357
2377
|
var r = t[Symbol.toPrimitive];
|
|
2358
2378
|
if (void 0 !== r) {
|
|
2359
2379
|
var n = r.call(t, e || "default");
|
|
2360
|
-
if ("object" !=
|
|
2380
|
+
if ("object" != lr(n)) return n;
|
|
2361
2381
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2362
2382
|
}
|
|
2363
2383
|
return ("string" === e ? String : Number)(t);
|
|
2364
2384
|
}(t, "string");
|
|
2365
|
-
return "symbol" ==
|
|
2385
|
+
return "symbol" == lr(e) ? e : e + "";
|
|
2366
2386
|
}
|
|
2367
|
-
var
|
|
2387
|
+
var fr = function(t, e) {
|
|
2368
2388
|
return t > e;
|
|
2369
|
-
},
|
|
2389
|
+
}, hr = function(t, e) {
|
|
2370
2390
|
return t < e;
|
|
2371
|
-
},
|
|
2391
|
+
}, yr = function() {
|
|
2372
2392
|
return t = function t() {
|
|
2373
2393
|
!function(t, e) {
|
|
2374
2394
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -2393,11 +2413,11 @@ var OHLCV_INDICATORS;
|
|
|
2393
2413
|
this.areHighAndLowUndefined || void 0 !== r && void 0 !== o || (this.areHighAndLowUndefined = !0),
|
|
2394
2414
|
null === e || null === n || function(t, e) {
|
|
2395
2415
|
return t === e;
|
|
2396
|
-
}(e, n) ? i = .5 :
|
|
2416
|
+
}(e, n) ? i = .5 : fr(e, n) ? i = this.areHighAndLowUndefined ? 1 : [ o, n, this.prevLow, this.prevSlow ].every((function(t) {
|
|
2397
2417
|
return null !== t;
|
|
2398
|
-
})) &&
|
|
2418
|
+
})) && hr(o, n) && fr(this.prevLow, this.prevSlow) ? 0 : 1 : hr(e, n) && (i = this.areHighAndLowUndefined ? 0 : [ r, n, this.prevHigh, this.prevSlow ].every((function(t) {
|
|
2399
2419
|
return null !== t;
|
|
2400
|
-
})) &&
|
|
2420
|
+
})) && fr(r, n) && hr(this.prevHigh, this.prevSlow) ? 1 : 0), .5 === i ? this.interval = 0 : 1 === i ? this.prevState <= .5 ? this.interval = 1 : this.interval++ : 0 === i && (this.prevState >= .5 ? this.interval = -1 : this.interval--),
|
|
2401
2421
|
1 === this.interval && this.crossIndexes.up.push(this.index), -1 === this.interval && this.crossIndexes.down.push(this.index),
|
|
2402
2422
|
//save prev state
|
|
2403
2423
|
Object.assign(this, {
|
|
@@ -2414,17 +2434,17 @@ var OHLCV_INDICATORS;
|
|
|
2414
2434
|
value: function() {
|
|
2415
2435
|
return this.interval;
|
|
2416
2436
|
}
|
|
2417
|
-
} ]) &&
|
|
2437
|
+
} ]) && cr(t.prototype, e), r && cr(t, r), Object.defineProperty(t, "prototype", {
|
|
2418
2438
|
writable: !1
|
|
2419
2439
|
}), t;
|
|
2420
2440
|
var t, e, r;
|
|
2421
|
-
}(),
|
|
2441
|
+
}(), pr = function(t, e) {
|
|
2422
2442
|
var r = t.nullArray, n = t.verticalOhlcv, o = t.instances, i = t.len;
|
|
2423
2443
|
if (0 === e) {
|
|
2424
2444
|
var a = t.inputParams.filter((function(t) {
|
|
2425
2445
|
return "crossPairs" === t.key;
|
|
2426
2446
|
}));
|
|
2427
|
-
if ("object" !==
|
|
2447
|
+
if ("object" !== lr(a)) return;
|
|
2428
2448
|
o.crossPairs = {
|
|
2429
2449
|
crossPairsList: a.flatMap((function(t) {
|
|
2430
2450
|
return t.params.flat();
|
|
@@ -2434,7 +2454,7 @@ var OHLCV_INDICATORS;
|
|
|
2434
2454
|
var u, l = function(t, e) {
|
|
2435
2455
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2436
2456
|
if (!r) {
|
|
2437
|
-
if (Array.isArray(t) || (r =
|
|
2457
|
+
if (Array.isArray(t) || (r = ar(t)) || e && t && "number" == typeof t.length) {
|
|
2438
2458
|
r && (t = r);
|
|
2439
2459
|
var n = 0, o = function() {};
|
|
2440
2460
|
return {
|
|
@@ -2484,17 +2504,17 @@ var OHLCV_INDICATORS;
|
|
|
2484
2504
|
if (0 === e) {
|
|
2485
2505
|
if ("number" == typeof f && (n[f] = new Array(i).fill(f)), "price" !== s && !n.hasOwnProperty(s)) throw Error('fast "'.concat(s, ' not found in crossPairs"'));
|
|
2486
2506
|
if (!n.hasOwnProperty(f)) throw Error('slow "'.concat(f, ' not found in crossPairs"'));
|
|
2487
|
-
o[h] = new
|
|
2507
|
+
o[h] = new yr, n[h] = ir(r);
|
|
2488
2508
|
}
|
|
2489
|
-
var y = void 0, p = void 0, v = void 0,
|
|
2490
|
-
"price" === s ? (p = n.close[e], v = n.high[e],
|
|
2509
|
+
var y = void 0, p = void 0, v = void 0, b = void 0, d = void 0;
|
|
2510
|
+
"price" === s ? (p = n.close[e], v = n.high[e], b = n.low[e], d = n[f][e], o[h].update({
|
|
2491
2511
|
fast: p,
|
|
2492
|
-
slow:
|
|
2512
|
+
slow: d,
|
|
2493
2513
|
high: v,
|
|
2494
|
-
low:
|
|
2495
|
-
})) : (y = n[s][e],
|
|
2514
|
+
low: b
|
|
2515
|
+
})) : (y = n[s][e], d = n[f][e], o[h].update({
|
|
2496
2516
|
fast: y,
|
|
2497
|
-
slow:
|
|
2517
|
+
slow: d
|
|
2498
2518
|
})), t.pushToMain({
|
|
2499
2519
|
index: e,
|
|
2500
2520
|
key: h,
|
|
@@ -2509,22 +2529,22 @@ var OHLCV_INDICATORS;
|
|
|
2509
2529
|
}
|
|
2510
2530
|
};
|
|
2511
2531
|
// ./src/studies/dateTime.js
|
|
2512
|
-
function
|
|
2532
|
+
function vr(t) {
|
|
2513
2533
|
return function(t) {
|
|
2514
|
-
if (Array.isArray(t)) return
|
|
2534
|
+
if (Array.isArray(t)) return br(t);
|
|
2515
2535
|
}(t) || function(t) {
|
|
2516
2536
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2517
2537
|
}(t) || function(t, e) {
|
|
2518
2538
|
if (t) {
|
|
2519
|
-
if ("string" == typeof t) return
|
|
2539
|
+
if ("string" == typeof t) return br(t, e);
|
|
2520
2540
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2521
|
-
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) ?
|
|
2541
|
+
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) ? br(t, e) : void 0;
|
|
2522
2542
|
}
|
|
2523
2543
|
}(t) || function() {
|
|
2524
2544
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2525
2545
|
}();
|
|
2526
2546
|
}
|
|
2527
|
-
function
|
|
2547
|
+
function br(t, e) {
|
|
2528
2548
|
(null == e || e > t.length) && (e = t.length);
|
|
2529
2549
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2530
2550
|
return n;
|
|
@@ -2542,31 +2562,31 @@ var OHLCV_INDICATORS;
|
|
|
2542
2562
|
};
|
|
2543
2563
|
};
|
|
2544
2564
|
// ./src/studies/priceVariations.js
|
|
2545
|
-
function
|
|
2565
|
+
function mr(t) {
|
|
2546
2566
|
return function(t) {
|
|
2547
|
-
if (Array.isArray(t)) return
|
|
2567
|
+
if (Array.isArray(t)) return gr(t);
|
|
2548
2568
|
}(t) || function(t) {
|
|
2549
2569
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2550
2570
|
}(t) || function(t, e) {
|
|
2551
2571
|
if (t) {
|
|
2552
|
-
if ("string" == typeof t) return
|
|
2572
|
+
if ("string" == typeof t) return gr(t, e);
|
|
2553
2573
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2554
|
-
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) ?
|
|
2574
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? gr(t, e) : void 0;
|
|
2555
2575
|
}
|
|
2556
2576
|
}(t) || function() {
|
|
2557
2577
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2558
2578
|
}();
|
|
2559
2579
|
}
|
|
2560
|
-
function
|
|
2580
|
+
function gr(t, e) {
|
|
2561
2581
|
(null == e || e > t.length) && (e = t.length);
|
|
2562
2582
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2563
2583
|
return n;
|
|
2564
2584
|
}
|
|
2565
|
-
var
|
|
2566
|
-
function
|
|
2585
|
+
var wr = [ "open", "high", "low", "close" ];
|
|
2586
|
+
function Or(t, e) {
|
|
2567
2587
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2568
2588
|
if (!r) {
|
|
2569
|
-
if (Array.isArray(t) || (r =
|
|
2589
|
+
if (Array.isArray(t) || (r = Pr(t)) || e && t && "number" == typeof t.length) {
|
|
2570
2590
|
r && (t = r);
|
|
2571
2591
|
var n = 0, o = function() {};
|
|
2572
2592
|
return {
|
|
@@ -2608,7 +2628,7 @@ var OHLCV_INDICATORS;
|
|
|
2608
2628
|
}
|
|
2609
2629
|
};
|
|
2610
2630
|
}
|
|
2611
|
-
function
|
|
2631
|
+
function Sr(t, e) {
|
|
2612
2632
|
if (null == t) return {};
|
|
2613
2633
|
var r, n, o = function(t, e) {
|
|
2614
2634
|
if (null == t) return {};
|
|
@@ -2625,12 +2645,12 @@ var OHLCV_INDICATORS;
|
|
|
2625
2645
|
}
|
|
2626
2646
|
return o;
|
|
2627
2647
|
}
|
|
2628
|
-
function
|
|
2648
|
+
function jr(t) {
|
|
2629
2649
|
return function(t) {
|
|
2630
|
-
if (Array.isArray(t)) return
|
|
2650
|
+
if (Array.isArray(t)) return Ar(t);
|
|
2631
2651
|
}(t) || function(t) {
|
|
2632
2652
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2633
|
-
}(t) ||
|
|
2653
|
+
}(t) || Pr(t) || function() {
|
|
2634
2654
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2635
2655
|
}();
|
|
2636
2656
|
}
|
|
@@ -2659,23 +2679,23 @@ var OHLCV_INDICATORS;
|
|
|
2659
2679
|
}
|
|
2660
2680
|
return u;
|
|
2661
2681
|
}
|
|
2662
|
-
}(t, e) ||
|
|
2682
|
+
}(t, e) || Pr(t, e) || function() {
|
|
2663
2683
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2664
2684
|
}();
|
|
2665
2685
|
}
|
|
2666
|
-
function
|
|
2686
|
+
function Pr(t, e) {
|
|
2667
2687
|
if (t) {
|
|
2668
|
-
if ("string" == typeof t) return
|
|
2688
|
+
if ("string" == typeof t) return Ar(t, e);
|
|
2669
2689
|
var r = {}.toString.call(t).slice(8, -1);
|
|
2670
|
-
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) ?
|
|
2690
|
+
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) ? Ar(t, e) : void 0;
|
|
2671
2691
|
}
|
|
2672
2692
|
}
|
|
2673
|
-
function
|
|
2693
|
+
function Ar(t, e) {
|
|
2674
2694
|
(null == e || e > t.length) && (e = t.length);
|
|
2675
2695
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2676
2696
|
return n;
|
|
2677
2697
|
}
|
|
2678
|
-
var
|
|
2698
|
+
var Er = {
|
|
2679
2699
|
dateTime: function(t, e) {
|
|
2680
2700
|
var r = t.instances, n = t.verticalOhlcv;
|
|
2681
2701
|
if (0 === e) {
|
|
@@ -2690,14 +2710,14 @@ var OHLCV_INDICATORS;
|
|
|
2690
2710
|
cachedDayInfo: i
|
|
2691
2711
|
}
|
|
2692
2712
|
}), Object.assign(n, {
|
|
2693
|
-
day_of_the_week:
|
|
2694
|
-
day_of_the_month:
|
|
2695
|
-
week_of_the_month:
|
|
2696
|
-
hour:
|
|
2697
|
-
month:
|
|
2698
|
-
year:
|
|
2699
|
-
session_daily_index:
|
|
2700
|
-
session_intraday_index:
|
|
2713
|
+
day_of_the_week: vr(o),
|
|
2714
|
+
day_of_the_month: vr(o),
|
|
2715
|
+
week_of_the_month: vr(o),
|
|
2716
|
+
hour: vr(o),
|
|
2717
|
+
month: vr(o),
|
|
2718
|
+
year: vr(o),
|
|
2719
|
+
session_daily_index: vr(o),
|
|
2720
|
+
session_intraday_index: vr(o)
|
|
2701
2721
|
});
|
|
2702
2722
|
}
|
|
2703
2723
|
var a = n.date[e], u = dr(a), l = u.day_of_the_week, c = u.day_of_the_month, s = u.week_of_the_month, f = u.month, h = u.year, y = u.hour, p = a.slice(0, 10);
|
|
@@ -2737,10 +2757,10 @@ var OHLCV_INDICATORS;
|
|
|
2737
2757
|
}), r.dateTime.sessionIntradayIndexCount++;
|
|
2738
2758
|
},
|
|
2739
2759
|
priceVariations: function(t, e) {
|
|
2740
|
-
0 === e && (t.priceBased =
|
|
2760
|
+
0 === e && (t.priceBased = mr(new Set([].concat(mr(t.priceBased), [ "mid_price_open_close", "mid_price_high_low" ]))),
|
|
2741
2761
|
Object.assign(t.verticalOhlcv, {
|
|
2742
|
-
mid_price_open_close:
|
|
2743
|
-
mid_price_high_low:
|
|
2762
|
+
mid_price_open_close: mr(t.nullArray),
|
|
2763
|
+
mid_price_high_low: mr(t.nullArray)
|
|
2744
2764
|
}));
|
|
2745
2765
|
var r = t.verticalOhlcv.open[e], n = t.verticalOhlcv.high[e], o = t.verticalOhlcv.low[e], i = t.verticalOhlcv.close[e];
|
|
2746
2766
|
t.pushToMain({
|
|
@@ -2766,23 +2786,23 @@ var OHLCV_INDICATORS;
|
|
|
2766
2786
|
}), Object.assign(c, le(le({}, h, new te(r)), y, new nt(r))), Object.assign(l, le(le({}, h, ae(v)), y, ae(v))),
|
|
2767
2787
|
a > 0 && t.lag([ h, y ], a), u && t.autoMinMaxKeys.push(h, y);
|
|
2768
2788
|
}
|
|
2769
|
-
var
|
|
2789
|
+
var b = l[i][e], d = null, m = null;
|
|
2770
2790
|
// Update the RSI indicator.
|
|
2771
|
-
c[h].update(
|
|
2791
|
+
c[h].update(b, s);
|
|
2772
2792
|
try {
|
|
2773
|
-
|
|
2793
|
+
d = c[h].getResult();
|
|
2774
2794
|
} catch (t) {
|
|
2775
|
-
|
|
2795
|
+
d = null;
|
|
2776
2796
|
}
|
|
2777
|
-
null !==
|
|
2797
|
+
null !== d && "number" == typeof d && o && (d = ne(d, o)),
|
|
2778
2798
|
// Always push the RSI value, using null as a fallback.
|
|
2779
2799
|
t.pushToMain({
|
|
2780
2800
|
index: e,
|
|
2781
2801
|
key: h,
|
|
2782
|
-
value:
|
|
2802
|
+
value: d
|
|
2783
2803
|
}),
|
|
2784
2804
|
// Update the SMA indicator only if a valid RSI value is available.
|
|
2785
|
-
null !==
|
|
2805
|
+
null !== d && "number" == typeof d && c[y].update(d, s);
|
|
2786
2806
|
try {
|
|
2787
2807
|
m = c[y].getResult();
|
|
2788
2808
|
} catch (t) {
|
|
@@ -2804,27 +2824,28 @@ var OHLCV_INDICATORS;
|
|
|
2804
2824
|
// Create the main moving average instance.
|
|
2805
2825
|
// If diff configuration is provided, create the diff indicator.
|
|
2806
2826
|
if (l[h] = {
|
|
2807
|
-
maInstance: new
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2827
|
+
maInstance: new de[r](n),
|
|
2828
|
+
arrayChunk: be({}, y, [])
|
|
2829
|
+
}, u[h] = ye(p), null !== a) {
|
|
2830
|
+
l[h].diffInstance = new jt(a.size, a.stdDev);
|
|
2831
|
+
var v, b = [], d = he(a.targets);
|
|
2811
2832
|
try {
|
|
2812
|
-
for (
|
|
2833
|
+
for (d.s(); !(v = d.n()).done; ) {
|
|
2813
2834
|
var m = v.value;
|
|
2814
|
-
u["".concat(y, "_").concat(m)] =
|
|
2815
|
-
a.lag > 0 &&
|
|
2835
|
+
u["".concat(y, "_").concat(m)] = ye(p), a.autoMinMax && t.autoMinMaxKeys.push("".concat(y, "_").concat(m)),
|
|
2836
|
+
a.lag > 0 && b.push("".concat(y, "_").concat(m));
|
|
2816
2837
|
}
|
|
2817
2838
|
} catch (t) {
|
|
2818
|
-
|
|
2839
|
+
d.e(t);
|
|
2819
2840
|
} finally {
|
|
2820
|
-
|
|
2841
|
+
d.f();
|
|
2821
2842
|
}
|
|
2822
|
-
a.lag > 0 && t.lag(
|
|
2843
|
+
a.lag > 0 && t.lag(b, a.lag);
|
|
2823
2844
|
}
|
|
2824
2845
|
c.push(h);
|
|
2825
2846
|
}
|
|
2826
2847
|
// Retrieve the current price value.
|
|
2827
|
-
var g = u[i][e], w = l[h], O = w.maInstance, S = w.diffInstance;
|
|
2848
|
+
var g = u[i][e], w = l[h], O = w.maInstance, S = w.diffInstance, j = w.arrayChunk;
|
|
2828
2849
|
// Update the moving average instance.
|
|
2829
2850
|
O.update(g, s);
|
|
2830
2851
|
var _ = null;
|
|
@@ -2840,56 +2861,56 @@ var OHLCV_INDICATORS;
|
|
|
2840
2861
|
key: h,
|
|
2841
2862
|
value: _
|
|
2842
2863
|
}), null !== a) {
|
|
2843
|
-
var
|
|
2864
|
+
var P, A = he(a.targets);
|
|
2844
2865
|
try {
|
|
2845
|
-
for (
|
|
2846
|
-
var
|
|
2866
|
+
for (A.s(); !(P = A.n()).done; ) {
|
|
2867
|
+
var E = P.value, M = null, x = null;
|
|
2847
2868
|
// Compute diffValue only if we have a valid MA value.
|
|
2848
|
-
null !== _ && "number" == typeof _ && (
|
|
2869
|
+
null !== _ && "number" == typeof _ && (M = u[E][e] - _),
|
|
2849
2870
|
// Update the diff indicator only if diffValue is a valid number.
|
|
2850
|
-
null !==
|
|
2851
|
-
var
|
|
2871
|
+
null !== M && "number" == typeof M && (S.update(Math.abs(M), s), x = se(j, y, a.size, M, s));
|
|
2872
|
+
var k = null;
|
|
2852
2873
|
try {
|
|
2853
|
-
|
|
2874
|
+
k = S.getResult();
|
|
2854
2875
|
} catch (t) {
|
|
2855
|
-
|
|
2876
|
+
k = null;
|
|
2856
2877
|
}
|
|
2857
|
-
|
|
2878
|
+
ce(M, k, a.scale, a.autoMinMax);
|
|
2858
2879
|
t.pushToMain({
|
|
2859
2880
|
index: e,
|
|
2860
|
-
key: "".concat(y, "_").concat(
|
|
2881
|
+
key: "".concat(y, "_").concat(E),
|
|
2861
2882
|
value: x
|
|
2862
2883
|
});
|
|
2863
2884
|
}
|
|
2864
2885
|
} catch (t) {
|
|
2865
|
-
|
|
2886
|
+
A.e(t);
|
|
2866
2887
|
} finally {
|
|
2867
|
-
|
|
2888
|
+
A.f();
|
|
2868
2889
|
}
|
|
2869
2890
|
}
|
|
2870
2891
|
return !0;
|
|
2871
2892
|
},
|
|
2872
2893
|
macd: function(t, e, r, n, o, i) {
|
|
2873
|
-
var a = i.target, u = t.verticalOhlcv, l = t.instances, c = t.lastIndexReplace, s = "".concat(r, "_").concat(n, "_").concat(o).concat(a ===
|
|
2894
|
+
var a = i.target, u = t.verticalOhlcv, l = t.instances, c = t.lastIndexReplace, s = "".concat(r, "_").concat(n, "_").concat(o).concat(a === je ? "" : "_".concat(a));
|
|
2874
2895
|
// Initialization on the first index.
|
|
2875
2896
|
if (0 === e) {
|
|
2876
2897
|
var f = t.inputParams, h = t.crossPairsList, y = t.nullArray, p = t.priceBased;
|
|
2877
2898
|
if (!u.hasOwnProperty(a)) throw new Error("Target property ".concat(a, " not found in verticalOhlcv for macd."));
|
|
2878
2899
|
var v = f.filter((function(t) {
|
|
2879
2900
|
return "macd" === t.key;
|
|
2880
|
-
})).length,
|
|
2901
|
+
})).length, b = v > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", d = a === je ? "".concat(b, "_diff") : "".concat(b, "_diff_").concat(a), m = a === je ? "".concat(b, "_dea") : "".concat(b, "_dea_").concat(a), g = a === je ? "".concat(b, "_histogram") : "".concat(b, "_histogram_").concat(a);
|
|
2881
2902
|
// Choose a display prefix based on the number of indicators.
|
|
2882
2903
|
h.push({
|
|
2883
|
-
fast:
|
|
2904
|
+
fast: d,
|
|
2884
2905
|
slow: m,
|
|
2885
2906
|
isDefault: !0
|
|
2886
2907
|
}), l.hasOwnProperty("macd") || (l.macd = {
|
|
2887
2908
|
numberOfIndicators: v,
|
|
2888
2909
|
settings: {}
|
|
2889
|
-
}), l.macd.settings[s] = new
|
|
2890
|
-
p.push(
|
|
2910
|
+
}), l.macd.settings[s] = new zt(new Dt(r), new Dt(n), new Dt(o)), Object.assign(u, we(we(we({}, d, Oe(y)), m, Oe(y)), g, Oe(y))),
|
|
2911
|
+
p.push(d, m, g);
|
|
2891
2912
|
}
|
|
2892
|
-
var w = l.macd, O = w.numberOfIndicators, S = w.settings,
|
|
2913
|
+
var w = l.macd, O = w.numberOfIndicators, S = w.settings, j = O > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", _ = a === je ? "".concat(j, "_diff") : "".concat(j, "_diff_").concat(a), P = a === je ? "".concat(j, "_dea") : "".concat(j, "_dea_").concat(a), A = a === je ? "".concat(j, "_histogram") : "".concat(j, "_histogram_").concat(a), E = S[s], M = u[a][e];
|
|
2893
2914
|
E.update(M, c);
|
|
2894
2915
|
var x = null;
|
|
2895
2916
|
try {
|
|
@@ -2901,7 +2922,7 @@ var OHLCV_INDICATORS;
|
|
|
2901
2922
|
// Always push values; use null as fallback when macdResult is missing.
|
|
2902
2923
|
return t.pushToMain({
|
|
2903
2924
|
index: e,
|
|
2904
|
-
key:
|
|
2925
|
+
key: _,
|
|
2905
2926
|
value: x ? x.macd : null
|
|
2906
2927
|
}), t.pushToMain({
|
|
2907
2928
|
index: e,
|
|
@@ -2920,7 +2941,7 @@ var OHLCV_INDICATORS;
|
|
|
2920
2941
|
i[o] = {
|
|
2921
2942
|
instance: new nt(r),
|
|
2922
2943
|
prevRelativeVolumeSma: null
|
|
2923
|
-
}, a[o] =
|
|
2944
|
+
}, a[o] = _e(l);
|
|
2924
2945
|
}
|
|
2925
2946
|
var c = a.volume[e], s = i[o].instance;
|
|
2926
2947
|
s.update(c, u);
|
|
@@ -2943,15 +2964,15 @@ var OHLCV_INDICATORS;
|
|
|
2943
2964
|
var i = o.height, a = o.range, u = o.scale, l = o.lag, c = o.autoMinMax, s = "".concat(r, "_").concat(n), f = t.verticalOhlcv, h = t.instances, y = t.len;
|
|
2944
2965
|
// Initialization: create output arrays and indicator instance on the first call.
|
|
2945
2966
|
if (0 === e) {
|
|
2946
|
-
var p = t.inputParams, v = t.priceBased,
|
|
2967
|
+
var p = t.inputParams, v = t.priceBased, b = t.nullArray, d = p.filter((function(t) {
|
|
2947
2968
|
return "donchianChannels" === t.key;
|
|
2948
|
-
})).length, m =
|
|
2969
|
+
})).length, m = d > 1 ? "donchian_channel_".concat(s) : "donchian_channel", g = [ "".concat(m, "_upper"), "".concat(m, "_basis"), "".concat(m, "_lower") ];
|
|
2949
2970
|
i && g.push("".concat(m, "_height")), h.hasOwnProperty("donchian_channel") || (h.donchian_channel = {
|
|
2950
|
-
numberOfIndicators:
|
|
2971
|
+
numberOfIndicators: d,
|
|
2951
2972
|
settings: {}
|
|
2952
2973
|
});
|
|
2953
2974
|
// Set up additional arrays for each range property.
|
|
2954
|
-
var w, O =
|
|
2975
|
+
var w, O = ke(a);
|
|
2955
2976
|
try {
|
|
2956
2977
|
for (O.s(); !(w = O.n()).done; ) {
|
|
2957
2978
|
var S = w.value;
|
|
@@ -2963,54 +2984,54 @@ var OHLCV_INDICATORS;
|
|
|
2963
2984
|
} finally {
|
|
2964
2985
|
O.f();
|
|
2965
2986
|
}
|
|
2966
|
-
var
|
|
2967
|
-
return [ t,
|
|
2987
|
+
var j = Object.fromEntries(g.map((function(t) {
|
|
2988
|
+
return [ t, xe(b) ];
|
|
2968
2989
|
})));
|
|
2969
2990
|
Object.assign(f, function(t) {
|
|
2970
2991
|
for (var e = 1; e < arguments.length; e++) {
|
|
2971
2992
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2972
|
-
e % 2 ?
|
|
2973
|
-
|
|
2974
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
2993
|
+
e % 2 ? Ee(Object(r), !0).forEach((function(e) {
|
|
2994
|
+
Me(t, e, r[e]);
|
|
2995
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Ee(Object(r)).forEach((function(e) {
|
|
2975
2996
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2976
2997
|
}));
|
|
2977
2998
|
}
|
|
2978
2999
|
return t;
|
|
2979
|
-
}({},
|
|
3000
|
+
}({}, j)), l > 0 && t.lag(g, l), v.push("".concat(m, "_upper"), "".concat(m, "_basis"), "".concat(m, "_lower")),
|
|
2980
3001
|
h.donchian_channel.settings[s] = {
|
|
2981
3002
|
maxDeque: [],
|
|
2982
3003
|
// will hold indices for highs in descending order
|
|
2983
3004
|
minDeque: []
|
|
2984
3005
|
};
|
|
2985
3006
|
}
|
|
2986
|
-
var
|
|
3007
|
+
var _ = h.donchian_channel.numberOfIndicators > 1 ? "donchian_channel_".concat(s) : "donchian_channel", P = h.donchian_channel.settings[s], A = P.maxDeque, E = P.minDeque, M = e - n, x = M + 1, k = x - r;
|
|
2987
3008
|
// window: [startIdx, endIdx)
|
|
2988
3009
|
// If the window is not fully available, push null values for all computed outputs.
|
|
2989
3010
|
if (k < 0 || x > y) {
|
|
2990
3011
|
t.pushToMain({
|
|
2991
3012
|
index: e,
|
|
2992
|
-
key: "".concat(
|
|
3013
|
+
key: "".concat(_, "_upper"),
|
|
2993
3014
|
value: null
|
|
2994
3015
|
}), t.pushToMain({
|
|
2995
3016
|
index: e,
|
|
2996
|
-
key: "".concat(
|
|
3017
|
+
key: "".concat(_, "_basis"),
|
|
2997
3018
|
value: null
|
|
2998
3019
|
}), t.pushToMain({
|
|
2999
3020
|
index: e,
|
|
3000
|
-
key: "".concat(
|
|
3021
|
+
key: "".concat(_, "_lower"),
|
|
3001
3022
|
value: null
|
|
3002
3023
|
}), i && t.pushToMain({
|
|
3003
3024
|
index: e,
|
|
3004
|
-
key: "".concat(
|
|
3025
|
+
key: "".concat(_, "_height"),
|
|
3005
3026
|
value: null
|
|
3006
3027
|
});
|
|
3007
|
-
var T, I =
|
|
3028
|
+
var T, I = ke(a);
|
|
3008
3029
|
try {
|
|
3009
3030
|
for (I.s(); !(T = I.n()).done; ) {
|
|
3010
3031
|
var C = T.value;
|
|
3011
3032
|
t.pushToMain({
|
|
3012
3033
|
index: e,
|
|
3013
|
-
key: "".concat(
|
|
3034
|
+
key: "".concat(_, "_range_").concat(C),
|
|
3014
3035
|
value: null
|
|
3015
3036
|
});
|
|
3016
3037
|
}
|
|
@@ -3035,35 +3056,35 @@ var OHLCV_INDICATORS;
|
|
|
3035
3056
|
// Always push the main indicator values.
|
|
3036
3057
|
t.pushToMain({
|
|
3037
3058
|
index: e,
|
|
3038
|
-
key: "".concat(
|
|
3059
|
+
key: "".concat(_, "_upper"),
|
|
3039
3060
|
value: V
|
|
3040
3061
|
}), t.pushToMain({
|
|
3041
3062
|
index: e,
|
|
3042
|
-
key: "".concat(
|
|
3063
|
+
key: "".concat(_, "_basis"),
|
|
3043
3064
|
value: N
|
|
3044
3065
|
}), t.pushToMain({
|
|
3045
3066
|
index: e,
|
|
3046
|
-
key: "".concat(
|
|
3067
|
+
key: "".concat(_, "_lower"),
|
|
3047
3068
|
value: B
|
|
3048
3069
|
}), i) {
|
|
3049
3070
|
var L = null;
|
|
3050
3071
|
"number" == typeof V && "number" == typeof B && 0 !== B && (L = ne((V - B) / B, .001)),
|
|
3051
3072
|
t.pushToMain({
|
|
3052
3073
|
index: e,
|
|
3053
|
-
key: "".concat(
|
|
3074
|
+
key: "".concat(_, "_height"),
|
|
3054
3075
|
value: L
|
|
3055
3076
|
});
|
|
3056
3077
|
}
|
|
3057
3078
|
// Process each range property.
|
|
3058
|
-
var H, U =
|
|
3079
|
+
var H, U = ke(a);
|
|
3059
3080
|
try {
|
|
3060
3081
|
for (U.s(); !(H = U.n()).done; ) {
|
|
3061
|
-
var
|
|
3062
|
-
"number" == typeof $ && "number" == typeof V && "number" == typeof B && V - B != 0 && (
|
|
3063
|
-
u && (
|
|
3082
|
+
var z = H.value, q = null, $ = f[z][e];
|
|
3083
|
+
"number" == typeof $ && "number" == typeof V && "number" == typeof B && V - B != 0 && (q = c ? Math.max(Math.min(($ - B) / (V - B), 1), 0) : ($ - B) / (V - B),
|
|
3084
|
+
u && (q = ne(q, u))), t.pushToMain({
|
|
3064
3085
|
index: e,
|
|
3065
|
-
key: "".concat(
|
|
3066
|
-
value:
|
|
3086
|
+
key: "".concat(_, "_range_").concat(z),
|
|
3087
|
+
value: q
|
|
3067
3088
|
});
|
|
3068
3089
|
}
|
|
3069
3090
|
} catch (t) {
|
|
@@ -3074,30 +3095,30 @@ var OHLCV_INDICATORS;
|
|
|
3074
3095
|
return !0;
|
|
3075
3096
|
},
|
|
3076
3097
|
bollingerBands: function(t, e, r, n, o) {
|
|
3077
|
-
var i, a, u, l, c, s, f, h = o.height, y = o.range, p = void 0 === y ? [] : y, v = o.target,
|
|
3098
|
+
var i, a, u, l, c, s, f, h = o.height, y = o.range, p = void 0 === y ? [] : y, v = o.target, b = o.scale, d = o.lag, m = o.autoMinMax, g = t.verticalOhlcv, w = t.instances, O = t.lastIndexReplace, S = "close" === v ? "" : "_".concat(v), j = "".concat(r, "_").concat(n).concat(S);
|
|
3078
3099
|
// Initialization on the first call.
|
|
3079
3100
|
if (0 === e) {
|
|
3080
|
-
var
|
|
3101
|
+
var _ = t.priceBased, P = t.inputParams, A = t.nullArray, E = t.verticalOhlcv;
|
|
3081
3102
|
if (!(v in E)) throw new Error('bollingerBands could not find target "'.concat(v, '"'));
|
|
3082
3103
|
var M = P.filter((function(t) {
|
|
3083
3104
|
return "bollingerBands" === t.key;
|
|
3084
3105
|
})).length;
|
|
3085
|
-
f = M > 1 ? "bollinger_bands_".concat(
|
|
3106
|
+
f = M > 1 ? "bollinger_bands_".concat(j) : "bollinger_bands".concat(S),
|
|
3086
3107
|
// Only create the container if it doesn't already exist.
|
|
3087
3108
|
w.bollinger_bands || (w.bollinger_bands = {
|
|
3088
3109
|
numberOfIndicators: M,
|
|
3089
3110
|
settings: {}
|
|
3090
3111
|
}),
|
|
3091
3112
|
// Add (or override) the indicator instance keyed by indicatorKey.
|
|
3092
|
-
w.bollinger_bands.settings[
|
|
3113
|
+
w.bollinger_bands.settings[j] = new jt(r, n);
|
|
3093
3114
|
var x = [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ];
|
|
3094
3115
|
h && x.push("".concat(f, "_height"));
|
|
3095
3116
|
// Set up additional arrays for each range property.
|
|
3096
|
-
var k, T =
|
|
3117
|
+
var k, T = Be(p);
|
|
3097
3118
|
try {
|
|
3098
3119
|
for (T.s(); !(k = T.n()).done; ) {
|
|
3099
3120
|
var I = k.value;
|
|
3100
|
-
if (!(I in E) || !
|
|
3121
|
+
if (!(I in E) || !_.includes(I)) throw new Error('Invalid range item value "'.concat(I, '" property for bollingerBands. Only price based key names are accepted:\n').concat(JSON.stringify(_)));
|
|
3101
3122
|
x.push("".concat(f, "_range_").concat(I)), m && t.autoMinMaxKeys.push("".concat(f, "_range_").concat(I));
|
|
3102
3123
|
}
|
|
3103
3124
|
} catch (t) {
|
|
@@ -3106,23 +3127,23 @@ var OHLCV_INDICATORS;
|
|
|
3106
3127
|
T.f();
|
|
3107
3128
|
}
|
|
3108
3129
|
var C = Object.fromEntries(x.map((function(t) {
|
|
3109
|
-
return [ t,
|
|
3130
|
+
return [ t, Ve(A) ];
|
|
3110
3131
|
})));
|
|
3111
3132
|
Object.assign(E, function(t) {
|
|
3112
3133
|
for (var e = 1; e < arguments.length; e++) {
|
|
3113
3134
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
3114
|
-
e % 2 ?
|
|
3115
|
-
|
|
3116
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
3135
|
+
e % 2 ? Re(Object(r), !0).forEach((function(e) {
|
|
3136
|
+
De(t, e, r[e]);
|
|
3137
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Re(Object(r)).forEach((function(e) {
|
|
3117
3138
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
3118
3139
|
}));
|
|
3119
3140
|
}
|
|
3120
3141
|
return t;
|
|
3121
|
-
}({}, C)),
|
|
3142
|
+
}({}, C)), d > 0 && t.lag(x, d), _.push("".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower"));
|
|
3122
3143
|
}
|
|
3123
3144
|
// Derive prefix for subsequent calls if not set.
|
|
3124
|
-
f || (f = w.bollinger_bands.numberOfIndicators > 1 ? "bollinger_bands_".concat(
|
|
3125
|
-
var R = f, D = w.bollinger_bands.settings[
|
|
3145
|
+
f || (f = w.bollinger_bands.numberOfIndicators > 1 ? "bollinger_bands_".concat(j) : "bollinger_bands".concat(S));
|
|
3146
|
+
var R = f, D = w.bollinger_bands.settings[j], V = g[v][e];
|
|
3126
3147
|
// Update the indicator with the current value.
|
|
3127
3148
|
D.update(V, O);
|
|
3128
3149
|
// Attempt to retrieve the result.
|
|
@@ -3159,21 +3180,21 @@ var OHLCV_INDICATORS;
|
|
|
3159
3180
|
});
|
|
3160
3181
|
}
|
|
3161
3182
|
// Process each range property.
|
|
3162
|
-
var
|
|
3183
|
+
var z, q = Be(p);
|
|
3163
3184
|
try {
|
|
3164
|
-
for (
|
|
3165
|
-
var $ =
|
|
3185
|
+
for (q.s(); !(z = q.n()).done; ) {
|
|
3186
|
+
var $ = z.value, F = null, K = g[$][e];
|
|
3166
3187
|
"number" == typeof K && "number" == typeof H && "number" == typeof N && N - H != 0 && (F = m ? Math.max(Math.min((K - H) / (N - H), 1), 0) : (K - H) / (N - H),
|
|
3167
|
-
|
|
3188
|
+
b && (F = ne(F, b))), t.pushToMain({
|
|
3168
3189
|
index: e,
|
|
3169
3190
|
key: "".concat(R, "_range_").concat($),
|
|
3170
3191
|
value: F
|
|
3171
3192
|
});
|
|
3172
3193
|
}
|
|
3173
3194
|
} catch (t) {
|
|
3174
|
-
|
|
3195
|
+
q.e(t);
|
|
3175
3196
|
} finally {
|
|
3176
|
-
|
|
3197
|
+
q.f();
|
|
3177
3198
|
}
|
|
3178
3199
|
return !0;
|
|
3179
3200
|
},
|
|
@@ -3186,7 +3207,7 @@ var OHLCV_INDICATORS;
|
|
|
3186
3207
|
fastEMA: new Dt(r),
|
|
3187
3208
|
slowEMA: new Dt(n)
|
|
3188
3209
|
}
|
|
3189
|
-
}), a[s] =
|
|
3210
|
+
}), a[s] = He(h), f.push({
|
|
3190
3211
|
fast: s,
|
|
3191
3212
|
slow: 0,
|
|
3192
3213
|
isDefault: !0
|
|
@@ -3194,19 +3215,19 @@ var OHLCV_INDICATORS;
|
|
|
3194
3215
|
}
|
|
3195
3216
|
var y = u[s], p = y.fastEMA, v = y.slowEMA;
|
|
3196
3217
|
p.update(c, l), v.update(c, l);
|
|
3197
|
-
var
|
|
3218
|
+
var b = null, d = null;
|
|
3198
3219
|
try {
|
|
3199
|
-
|
|
3220
|
+
b = p.getResult();
|
|
3200
3221
|
} catch (t) {
|
|
3201
|
-
|
|
3222
|
+
b = null;
|
|
3202
3223
|
}
|
|
3203
3224
|
try {
|
|
3204
|
-
|
|
3225
|
+
d = v.getResult();
|
|
3205
3226
|
} catch (t) {
|
|
3206
|
-
|
|
3227
|
+
d = null;
|
|
3207
3228
|
}
|
|
3208
3229
|
var m = null;
|
|
3209
|
-
return "number" == typeof
|
|
3230
|
+
return "number" == typeof b && "number" == typeof d && 0 !== d && (m = 100 * (b - d) / d,
|
|
3210
3231
|
i && (m = ne(m, i))), t.pushToMain({
|
|
3211
3232
|
index: e,
|
|
3212
3233
|
key: s,
|
|
@@ -3217,51 +3238,51 @@ var OHLCV_INDICATORS;
|
|
|
3217
3238
|
var o = n.patternSize, i = n.lag, a = n.autoMinMax, u = t.verticalOhlcv, l = t.instances, c = t.lastIndexReplace;
|
|
3218
3239
|
if (0 === e) {
|
|
3219
3240
|
for (var s = t.nullArray, f = [ [ "close", "open" ], [ "close", "high" ], [ "close", "low" ], [ "open", "high" ], [ "open", "low" ], [ "high", "low" ] ], h = [ [ "open", "open" ], [ "high", "high" ], [ "low", "low" ], [ "close", "close" ] ].concat(f), y = [], p = {}, v = 0; v < o; v++) {
|
|
3220
|
-
var
|
|
3241
|
+
var b, d = Je(h);
|
|
3221
3242
|
try {
|
|
3222
|
-
for (
|
|
3223
|
-
var m =
|
|
3224
|
-
y.push("candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)), p["candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)] =
|
|
3243
|
+
for (d.s(); !(b = d.n()).done; ) {
|
|
3244
|
+
var m = Ge(b.value, 2), g = m[0], w = m[1];
|
|
3245
|
+
y.push("candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)), p["candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)] = Ke(s),
|
|
3225
3246
|
a && t.autoMinMaxKeys.push("candle_change_".concat(v + 1, "_").concat(g, "_").concat(w));
|
|
3226
3247
|
}
|
|
3227
3248
|
} catch (t) {
|
|
3228
|
-
|
|
3249
|
+
d.e(t);
|
|
3229
3250
|
} finally {
|
|
3230
|
-
|
|
3251
|
+
d.f();
|
|
3231
3252
|
}
|
|
3232
3253
|
}
|
|
3233
|
-
for (var O = [], S = {},
|
|
3234
|
-
var P =
|
|
3235
|
-
O.push("candle_body_".concat(A, "_").concat(E)), S["candle_body_".concat(A, "_").concat(E)] =
|
|
3254
|
+
for (var O = [], S = {}, j = 0, _ = f; j < _.length; j++) {
|
|
3255
|
+
var P = Ge(_[j], 2), A = P[0], E = P[1];
|
|
3256
|
+
O.push("candle_body_".concat(A, "_").concat(E)), S["candle_body_".concat(A, "_").concat(E)] = Ke(s),
|
|
3236
3257
|
a && t.autoMinMaxKeys.push("candle_body_".concat(A, "_").concat(E));
|
|
3237
3258
|
}
|
|
3238
3259
|
var M = [].concat(O, y);
|
|
3239
|
-
Object.assign(u,
|
|
3260
|
+
Object.assign(u, $e($e({}, S), p)), Object.assign(l, {
|
|
3240
3261
|
candleVectors: {
|
|
3241
3262
|
bodyVectors: f,
|
|
3242
3263
|
lookBackVectors: h,
|
|
3243
3264
|
keyNames: M,
|
|
3244
|
-
arrayChunk:
|
|
3265
|
+
arrayChunk: $e({}, Object.fromEntries(M.map((function(t) {
|
|
3245
3266
|
return [ t, [] ];
|
|
3246
3267
|
}))))
|
|
3247
3268
|
}
|
|
3248
3269
|
}), i > 0 && t.lag(M, i);
|
|
3249
3270
|
}
|
|
3250
3271
|
for (var x = l.candleVectors, k = x.bodyVectors, T = x.lookBackVectors, I = x.arrayChunk, C = 0; C < k.length; C++) {
|
|
3251
|
-
var R =
|
|
3272
|
+
var R = Ge(k[C], 2), D = R[0], V = R[1], B = u[D][e], N = u[V][e], L = "candle_body_".concat(D, "_").concat(V), H = Qe(B, N), U = se(I, L, r, H, c);
|
|
3252
3273
|
t.pushToMain({
|
|
3253
3274
|
index: e,
|
|
3254
3275
|
key: L,
|
|
3255
3276
|
value: U
|
|
3256
3277
|
});
|
|
3257
3278
|
}
|
|
3258
|
-
for (var
|
|
3259
|
-
var
|
|
3279
|
+
for (var z = 0; z < o; z++) {
|
|
3280
|
+
var q, $ = Je(T);
|
|
3260
3281
|
try {
|
|
3261
|
-
for ($.s(); !(
|
|
3262
|
-
var F =
|
|
3282
|
+
for ($.s(); !(q = $.n()).done; ) {
|
|
3283
|
+
var F = Ge(q.value, 2), K = F[0], G = F[1], J = u[K][e], W = u[G][e - (z + 1)], Y = "candle_change_".concat(z + 1, "_").concat(K, "_").concat(G);
|
|
3263
3284
|
if (void 0 !== W) {
|
|
3264
|
-
var Q =
|
|
3285
|
+
var Q = Qe(J, W), X = se(I, Y, r, Q, c);
|
|
3265
3286
|
t.pushToMain({
|
|
3266
3287
|
index: e,
|
|
3267
3288
|
key: Y,
|
|
@@ -3281,7 +3302,7 @@ var OHLCV_INDICATORS;
|
|
|
3281
3302
|
}
|
|
3282
3303
|
return !0;
|
|
3283
3304
|
}
|
|
3284
|
-
},
|
|
3305
|
+
}, Mr = function(t, e, r) {
|
|
3285
3306
|
var n = function(t) {
|
|
3286
3307
|
return r > 1 ? t * r : t;
|
|
3287
3308
|
};
|
|
@@ -3292,9 +3313,9 @@ var OHLCV_INDICATORS;
|
|
|
3292
3313
|
}
|
|
3293
3314
|
return 0;
|
|
3294
3315
|
// Optionally: throw an error if type is not recognized
|
|
3295
|
-
},
|
|
3316
|
+
}, xr = function(t, e) {
|
|
3296
3317
|
return "number" === e ? t : "string" === e ? Number(oe(t)) : 0;
|
|
3297
|
-
},
|
|
3318
|
+
}, kr = function(t, e) {
|
|
3298
3319
|
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, o = e.len, i = e.inputParams, a = e.hasVolume;
|
|
3299
3320
|
//do not move nullArray from here
|
|
3300
3321
|
e.nullArray = new Array(o).fill(null);
|
|
@@ -3325,14 +3346,14 @@ var OHLCV_INDICATORS;
|
|
|
3325
3346
|
i.f();
|
|
3326
3347
|
}
|
|
3327
3348
|
}(e), u.forEach((function(t) {
|
|
3328
|
-
e.verticalOhlcv[t] =
|
|
3349
|
+
e.verticalOhlcv[t] = jr(e.nullArray);
|
|
3329
3350
|
}));
|
|
3330
3351
|
// Identify any additional keys from the first input row and initialize them
|
|
3331
3352
|
var c = Object.keys(t[0]).filter((function(t) {
|
|
3332
3353
|
return !l.has(t);
|
|
3333
3354
|
}));
|
|
3334
3355
|
c.forEach((function(t) {
|
|
3335
|
-
e.verticalOhlcv[t] =
|
|
3356
|
+
e.verticalOhlcv[t] = jr(e.nullArray);
|
|
3336
3357
|
})), e.otherKeys = c,
|
|
3337
3358
|
// Set the input types once using the first row
|
|
3338
3359
|
function(t, e) {
|
|
@@ -3359,12 +3380,12 @@ var OHLCV_INDICATORS;
|
|
|
3359
3380
|
var e = t.key, r = t.params;
|
|
3360
3381
|
return {
|
|
3361
3382
|
key: e,
|
|
3362
|
-
fn:
|
|
3383
|
+
fn: Er[e],
|
|
3363
3384
|
args: r
|
|
3364
3385
|
};
|
|
3365
3386
|
})) : [];
|
|
3366
3387
|
}(i), f = n; f < o; f++) {
|
|
3367
|
-
var h = t[f], y = h.open, p = h.high, v = h.low,
|
|
3388
|
+
var h = t[f], y = h.open, p = h.high, v = h.low, b = h.close, d = Sr(h, wr), m = e.precisionMultiplier, g = Mr(y, e.inputTypes.open, m), w = Mr(p, e.inputTypes.high, m), O = Mr(v, e.inputTypes.low, m), S = Mr(b, e.inputTypes.close, m);
|
|
3368
3389
|
// Destructure the base keys and use the rest for other properties
|
|
3369
3390
|
//sets volume to 0
|
|
3370
3391
|
if (e.pushToMain({
|
|
@@ -3384,22 +3405,22 @@ var OHLCV_INDICATORS;
|
|
|
3384
3405
|
key: "close",
|
|
3385
3406
|
value: S
|
|
3386
3407
|
}), a) {
|
|
3387
|
-
var
|
|
3408
|
+
var j = h.volume, _ = xr(j, e.inputTypes.volume);
|
|
3388
3409
|
e.pushToMain({
|
|
3389
3410
|
index: f,
|
|
3390
3411
|
key: "volume",
|
|
3391
|
-
value:
|
|
3412
|
+
value: _
|
|
3392
3413
|
});
|
|
3393
|
-
} else delete
|
|
3414
|
+
} else delete d.volume;
|
|
3394
3415
|
// Populate any extra keys identified during initialization
|
|
3395
|
-
var P, A =
|
|
3416
|
+
var P, A = Or(e.otherKeys);
|
|
3396
3417
|
try {
|
|
3397
3418
|
for (A.s(); !(P = A.n()).done; ) {
|
|
3398
3419
|
var E = P.value;
|
|
3399
3420
|
e.pushToMain({
|
|
3400
3421
|
index: f,
|
|
3401
3422
|
key: E,
|
|
3402
|
-
value:
|
|
3423
|
+
value: d[E]
|
|
3403
3424
|
});
|
|
3404
3425
|
}
|
|
3405
3426
|
// Run all indicator functions except for the ones processed later
|
|
@@ -3408,11 +3429,11 @@ var OHLCV_INDICATORS;
|
|
|
3408
3429
|
} finally {
|
|
3409
3430
|
A.f();
|
|
3410
3431
|
}
|
|
3411
|
-
var M, x =
|
|
3432
|
+
var M, x = Or(s);
|
|
3412
3433
|
try {
|
|
3413
3434
|
for (x.s(); !(M = x.n()).done; ) {
|
|
3414
3435
|
var k = M.value, T = k.key, I = k.fn, C = k.args;
|
|
3415
|
-
[ "crossPairs", "lag" ].includes(T) || I.apply(void 0, [ e, f ].concat(
|
|
3436
|
+
[ "crossPairs", "lag" ].includes(T) || I.apply(void 0, [ e, f ].concat(jr(C)));
|
|
3416
3437
|
}
|
|
3417
3438
|
// Process these indicators separately (ensuring their execution order)
|
|
3418
3439
|
} catch (t) {
|
|
@@ -3420,9 +3441,9 @@ var OHLCV_INDICATORS;
|
|
|
3420
3441
|
} finally {
|
|
3421
3442
|
x.f();
|
|
3422
3443
|
}
|
|
3423
|
-
|
|
3444
|
+
or(e, f), pr(e, f), e.lastComputedIndex++;
|
|
3424
3445
|
}
|
|
3425
|
-
},
|
|
3446
|
+
}, Tr = function(t, e) {
|
|
3426
3447
|
for (var r = t.length, n = new nt(e), o = new Array(r), i = 0, a = 0, u = 0, l = 0; l < r; l++) if (n.update(t[l]),
|
|
3427
3448
|
n.isStable) {
|
|
3428
3449
|
var c = n.getResult();
|
|
@@ -3432,10 +3453,10 @@ var OHLCV_INDICATORS;
|
|
|
3432
3453
|
return o.map((function(t) {
|
|
3433
3454
|
return null !== t ? (t - s) / h : null;
|
|
3434
3455
|
}));
|
|
3435
|
-
},
|
|
3456
|
+
}, Ir = function(t, e) {
|
|
3436
3457
|
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5;
|
|
3437
3458
|
if (t.length !== e.length) throw new Error("Both arrays must have the same length");
|
|
3438
|
-
for (var n =
|
|
3459
|
+
for (var n = Tr(t, r), o = Tr(e, r), i = t.length, a = [], u = 0, l = 0, c = 0, s = 0, f = 0, h = 0, y = -1, p = 0; p < i; p++) {
|
|
3439
3460
|
if (null !== n[p] && null !== o[p]) {
|
|
3440
3461
|
y = p;
|
|
3441
3462
|
break;
|
|
@@ -3446,8 +3467,8 @@ var OHLCV_INDICATORS;
|
|
|
3446
3467
|
// No valid data points
|
|
3447
3468
|
return new Array(i).fill(0);
|
|
3448
3469
|
for (var v = y; v < i; v++) {
|
|
3449
|
-
var
|
|
3450
|
-
if (null !==
|
|
3470
|
+
var b = n[v], d = o[v];
|
|
3471
|
+
if (null !== b && null !== d) if (u += b, l += d, c += b * d, s += b * b, f += d * d,
|
|
3451
3472
|
++h < 2) a.push(0); else {
|
|
3452
3473
|
var m = h * c - u * l, g = Math.sqrt((h * s - u * u) * (h * f - l * l)), w = 0 === g ? 0 : m / g;
|
|
3453
3474
|
a.push(w);
|
|
@@ -3459,23 +3480,23 @@ var OHLCV_INDICATORS;
|
|
|
3459
3480
|
};
|
|
3460
3481
|
// Processes the inputParams into a list of indicator calls
|
|
3461
3482
|
// ./index.js
|
|
3462
|
-
function
|
|
3483
|
+
function Cr(t) {
|
|
3463
3484
|
return function(t) {
|
|
3464
|
-
if (Array.isArray(t)) return
|
|
3485
|
+
if (Array.isArray(t)) return Br(t);
|
|
3465
3486
|
}(t) || function(t) {
|
|
3466
3487
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
3467
|
-
}(t) ||
|
|
3488
|
+
}(t) || Vr(t) || function() {
|
|
3468
3489
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3469
3490
|
}();
|
|
3470
3491
|
}
|
|
3471
|
-
function
|
|
3472
|
-
return
|
|
3492
|
+
function Rr(t) {
|
|
3493
|
+
return Rr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
3473
3494
|
return typeof t;
|
|
3474
3495
|
} : function(t) {
|
|
3475
3496
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
3476
|
-
},
|
|
3497
|
+
}, Rr(t);
|
|
3477
3498
|
}
|
|
3478
|
-
function
|
|
3499
|
+
function Dr(t, e) {
|
|
3479
3500
|
return function(t) {
|
|
3480
3501
|
if (Array.isArray(t)) return t;
|
|
3481
3502
|
}(t) || function(t, e) {
|
|
@@ -3498,36 +3519,36 @@ var OHLCV_INDICATORS;
|
|
|
3498
3519
|
}
|
|
3499
3520
|
return u;
|
|
3500
3521
|
}
|
|
3501
|
-
}(t, e) ||
|
|
3522
|
+
}(t, e) || Vr(t, e) || function() {
|
|
3502
3523
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3503
3524
|
}();
|
|
3504
3525
|
}
|
|
3505
|
-
function
|
|
3526
|
+
function Vr(t, e) {
|
|
3506
3527
|
if (t) {
|
|
3507
|
-
if ("string" == typeof t) return
|
|
3528
|
+
if ("string" == typeof t) return Br(t, e);
|
|
3508
3529
|
var r = {}.toString.call(t).slice(8, -1);
|
|
3509
|
-
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) ?
|
|
3530
|
+
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) ? Br(t, e) : void 0;
|
|
3510
3531
|
}
|
|
3511
3532
|
}
|
|
3512
|
-
function
|
|
3533
|
+
function Br(t, e) {
|
|
3513
3534
|
(null == e || e > t.length) && (e = t.length);
|
|
3514
3535
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3515
3536
|
return n;
|
|
3516
3537
|
}
|
|
3517
|
-
function
|
|
3538
|
+
function Nr(t, e) {
|
|
3518
3539
|
for (var r = 0; r < e.length; r++) {
|
|
3519
3540
|
var n = e[r];
|
|
3520
3541
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
3521
|
-
Object.defineProperty(t,
|
|
3542
|
+
Object.defineProperty(t, Lr(n.key), n);
|
|
3522
3543
|
}
|
|
3523
3544
|
}
|
|
3524
|
-
function
|
|
3545
|
+
function Lr(t) {
|
|
3525
3546
|
var e = function(t, e) {
|
|
3526
|
-
if ("object" !=
|
|
3547
|
+
if ("object" != Rr(t) || !t) return t;
|
|
3527
3548
|
var r = t[Symbol.toPrimitive];
|
|
3528
3549
|
if (void 0 !== r) {
|
|
3529
3550
|
var n = r.call(t, e || "default");
|
|
3530
|
-
if ("object" !=
|
|
3551
|
+
if ("object" != Rr(n)) return n;
|
|
3531
3552
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3532
3553
|
}
|
|
3533
3554
|
return ("string" === e ? String : Number)(t);
|
|
@@ -3540,9 +3561,9 @@ var OHLCV_INDICATORS;
|
|
|
3540
3561
|
* to parallel compute various technical indicators in 1 single loop.
|
|
3541
3562
|
* OHLCV datasets.
|
|
3542
3563
|
*/ (t, "string");
|
|
3543
|
-
return "symbol" ==
|
|
3564
|
+
return "symbol" == Rr(e) ? e : e + "";
|
|
3544
3565
|
}
|
|
3545
|
-
var
|
|
3566
|
+
var Hr = [ .001, .002, .0025, .005, .01, .02, .025, .05, .1, .2, .25, .5, 1, 2, 2.5, 5, 10 ], Ur = function() {
|
|
3546
3567
|
return t = function t(e) {
|
|
3547
3568
|
var r = this, n = e.input, o = e.ticker, i = void 0 === o ? null : o, a = e.precision, u = void 0 === a || a, l = e.inputParams, c = void 0 === l ? null : l;
|
|
3548
3569
|
if (function(t, e) {
|
|
@@ -3565,7 +3586,7 @@ var OHLCV_INDICATORS;
|
|
|
3565
3586
|
}, this.priceBased = [ "open", "high", "low", "close" ], this.len = n.length, this.lastIndexReplace = !1,
|
|
3566
3587
|
this.instances = {}, this.crossPairsList = [], this.verticalOhlcv = {}, this.studies = {},
|
|
3567
3588
|
this.utilities = {
|
|
3568
|
-
correlation:
|
|
3589
|
+
correlation: Ir
|
|
3569
3590
|
}, this.invalidValueIndex = -1, this.precision = u, this.precisionMultiplier = !0 === this.precision ? 0 : 1,
|
|
3570
3591
|
this.autoMinMaxKeys = [], this.minMaxRanges = {}, Array.isArray(c) && (this.inputParams = c,
|
|
3571
3592
|
this.compute()), this.inputParams = [], this.pushToMain = function(t) {
|
|
@@ -3617,7 +3638,7 @@ var OHLCV_INDICATORS;
|
|
|
3617
3638
|
var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
|
|
3618
3639
|
this.compute();
|
|
3619
3640
|
for (var e = this.precisionMultiplier, r = this.precision, n = this.invalidValueIndex, o = this.len, i = this.verticalOhlcv, a = this.priceBased, u = {}, l = n >= 0 && t, c = o - (n + 1), s = 0, f = Object.entries(i); s < f.length; s++) {
|
|
3620
|
-
var h =
|
|
3641
|
+
var h = Dr(f[s], 2), y = h[0], p = h[1], v = l ? p.slice(-c) : p;
|
|
3621
3642
|
// If slicing is needed, create a sliced copy, otherwise re-use the array.
|
|
3622
3643
|
// If this key is price based and precision is enabled, map over the array.
|
|
3623
3644
|
r && a.includes(y) && (v = v.map((function(t) {
|
|
@@ -3679,7 +3700,7 @@ var OHLCV_INDICATORS;
|
|
|
3679
3700
|
//compute method can be used to process indicators if no arguments are provided
|
|
3680
3701
|
//compute method can be called to access the .verticalOhlcv object
|
|
3681
3702
|
//compute method is called automatically if getLastValues or getDate methods are called
|
|
3682
|
-
this.len > this.lastComputedIndex && !t &&
|
|
3703
|
+
this.len > this.lastComputedIndex && !t && kr(this.input, this, 0), t && "object" === Rr(t)) {
|
|
3683
3704
|
var e;
|
|
3684
3705
|
if (![ "open", "high", "low", "close", "volume", "date" ].every((function(e) {
|
|
3685
3706
|
return Object.keys(t).includes(e);
|
|
@@ -3690,16 +3711,16 @@ var OHLCV_INDICATORS;
|
|
|
3690
3711
|
//fallback if .compute(change) is triggered before .compute() alone
|
|
3691
3712
|
0 === this.lastComputedIndex && this.compute(), i !== r ? (
|
|
3692
3713
|
// Add new item
|
|
3693
|
-
this.len++, this.input.push(t),
|
|
3714
|
+
this.len++, this.input.push(t), kr(this.input, this, this.len)) : (
|
|
3694
3715
|
// Modify the last item
|
|
3695
|
-
this.input[n] = t,
|
|
3716
|
+
this.input[n] = t, kr(this.input, this, n));
|
|
3696
3717
|
}
|
|
3697
3718
|
return this;
|
|
3698
3719
|
}
|
|
3699
3720
|
}, {
|
|
3700
3721
|
key: "crossPairs",
|
|
3701
3722
|
value: function(t) {
|
|
3702
|
-
return i(this), this.crossPairsList = [].concat(
|
|
3723
|
+
return i(this), this.crossPairsList = [].concat(Cr(this.crossPairsList), Cr(t)),
|
|
3703
3724
|
this.inputParams.push({
|
|
3704
3725
|
key: "crossPairs",
|
|
3705
3726
|
params: [ this.crossPairsList ]
|
|
@@ -3730,7 +3751,7 @@ var OHLCV_INDICATORS;
|
|
|
3730
3751
|
if (!1 === this.hasVolume) throw new Error('If "relativeVolume" is called the input ohlcv must contain valid volume properties.');
|
|
3731
3752
|
i(this);
|
|
3732
3753
|
var r = e.scale, n = void 0 === r ? null : r;
|
|
3733
|
-
if ("number" == typeof n && !
|
|
3754
|
+
if ("number" == typeof n && !Hr.includes(n)) throw new Error('"scale" value in relativeVolume must be any of the following numbers: '.concat(Hr.join(", ")));
|
|
3734
3755
|
return this.inputParams.push({
|
|
3735
3756
|
key: "relativeVolume",
|
|
3736
3757
|
params: [ t, {
|
|
@@ -3743,7 +3764,7 @@ var OHLCV_INDICATORS;
|
|
|
3743
3764
|
value: function(t) {
|
|
3744
3765
|
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
3745
3766
|
i(this);
|
|
3746
|
-
var r =
|
|
3767
|
+
var r = me("ema", t, e, Hr);
|
|
3747
3768
|
return this.inputParams.push({
|
|
3748
3769
|
key: "movingAverages",
|
|
3749
3770
|
params: [ "ema", t, r ]
|
|
@@ -3754,7 +3775,7 @@ var OHLCV_INDICATORS;
|
|
|
3754
3775
|
value: function(t) {
|
|
3755
3776
|
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
3756
3777
|
i(this);
|
|
3757
|
-
var r =
|
|
3778
|
+
var r = me("sma", t, e, Hr);
|
|
3758
3779
|
return this.inputParams.push({
|
|
3759
3780
|
key: "movingAverages",
|
|
3760
3781
|
params: [ "sma", t, r ]
|
|
@@ -3767,7 +3788,7 @@ var OHLCV_INDICATORS;
|
|
|
3767
3788
|
if (i(this), "number" != typeof t || t <= 0) throw new Error('"fast" must be a positive number in macd.');
|
|
3768
3789
|
if ("number" != typeof e || e <= t) throw new Error('"slow" must be a positive number greater than "fast" in macd.');
|
|
3769
3790
|
if ("number" != typeof r || r <= 0) throw new Error('"signal" must be a positive number in macd.');
|
|
3770
|
-
if ("object" !==
|
|
3791
|
+
if ("object" !== Rr(n)) throw new Error('"options" must be an object in macd. eg: {target}');
|
|
3771
3792
|
var o = n.target, a = void 0 === o ? "close" : o;
|
|
3772
3793
|
return this.inputParams.push({
|
|
3773
3794
|
key: "macd",
|
|
@@ -3780,7 +3801,7 @@ var OHLCV_INDICATORS;
|
|
|
3780
3801
|
key: "bollingerBands",
|
|
3781
3802
|
value: function() {
|
|
3782
3803
|
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] : {};
|
|
3783
|
-
if (i(this), !r || "object" !==
|
|
3804
|
+
if (i(this), !r || "object" !== Rr(r)) throw new Error('"options" must be an object in bollingerBands. eg: {target, height, range}');
|
|
3784
3805
|
var n = r.target, o = void 0 === n ? "close" : n, a = r.height, u = void 0 !== a && a, l = r.range, c = void 0 === l ? [] : l, s = r.scale, f = void 0 === s ? null : s, h = r.lag, y = void 0 === h ? 0 : h, p = r.autoMinMax, v = void 0 !== p && p;
|
|
3785
3806
|
// Validate size and times
|
|
3786
3807
|
if ("number" != typeof t || t <= 0) throw new Error('"size" must be a positive number in bollingerBands.');
|
|
@@ -3789,7 +3810,7 @@ var OHLCV_INDICATORS;
|
|
|
3789
3810
|
if ("number" != typeof y) throw new Error('"lag" value must be a number in bollingerBands.');
|
|
3790
3811
|
if ("boolean" != typeof v) throw new Error('"autoMinMax" value in rsi must be a number in bollingerBands.');
|
|
3791
3812
|
if ("boolean" != typeof u) throw new Error('"height" must be a boolean in bollingerBands.');
|
|
3792
|
-
if ("number" == typeof f && !
|
|
3813
|
+
if ("number" == typeof f && !Hr.includes(f)) throw new Error('"scale" value in bollingerBands must be any of the following numbers: '.concat(Hr.join(", ")));
|
|
3793
3814
|
return this.inputParams.push({
|
|
3794
3815
|
key: "bollingerBands",
|
|
3795
3816
|
params: [ t, e, {
|
|
@@ -3809,7 +3830,7 @@ var OHLCV_INDICATORS;
|
|
|
3809
3830
|
// Validate size and times
|
|
3810
3831
|
if (i(this), "number" != typeof t || t <= 0) throw new Error('"size" must be a positive number in rsi.');
|
|
3811
3832
|
var r = e.scale, n = void 0 === r ? null : r, o = e.target, a = void 0 === o ? "close" : o, u = e.lag, l = void 0 === u ? 0 : u, c = e.autoMinMax, s = void 0 !== c && c;
|
|
3812
|
-
if ("number" == typeof n && !
|
|
3833
|
+
if ("number" == typeof n && !Hr.includes(n)) throw new Error('"scale" value in rsi must be any of the following numbers: '.concat(Hr.join(", ")));
|
|
3813
3834
|
if ("number" != typeof l) throw new Error('"lag" value in rsi must be a number in rsi.');
|
|
3814
3835
|
if ("boolean" != typeof s) throw new Error('"autoMinMax" value in rsi must be a number in rsi.');
|
|
3815
3836
|
return this.inputParams.push({
|
|
@@ -3833,7 +3854,7 @@ var OHLCV_INDICATORS;
|
|
|
3833
3854
|
if ("number" != typeof f) throw new Error('"lag" value in rsi must be a number in donchianChannels.');
|
|
3834
3855
|
if ("boolean" != typeof y) throw new Error('"autoMinMax" value in rsi must be a number in donchianChannels.');
|
|
3835
3856
|
if ("boolean" != typeof o) throw new Error('"height" must be a boolean in donchianChannels.');
|
|
3836
|
-
if ("number" == typeof c && !
|
|
3857
|
+
if ("number" == typeof c && !Hr.includes(c)) throw new Error('"scale" value in donchianChannels must be any of the following numbers: '.concat(Hr.join(", ")));
|
|
3837
3858
|
return this.inputParams.push({
|
|
3838
3859
|
key: "donchianChannels",
|
|
3839
3860
|
params: [ t, e, {
|
|
@@ -3852,7 +3873,7 @@ var OHLCV_INDICATORS;
|
|
|
3852
3873
|
if (i(this), "number" != typeof t || t <= 0) throw new Error('"size" must be a positive number greater than 0 in candleVectors.');
|
|
3853
3874
|
var r = e.stdDev, n = void 0 === r ? 1 : r, o = e.lag, a = void 0 === o ? 0 : o, u = e.scale, l = void 0 === u ? .001 : u, c = e.patternSize, s = void 0 === c ? 0 : c, f = e.autoMinMax, h = void 0 !== f && f;
|
|
3854
3875
|
if ("number" != typeof n || n <= 0) throw new Error('"stdDev" must be a positive number greater than 0 in candleVectors.');
|
|
3855
|
-
if ("number" == typeof l && !
|
|
3876
|
+
if ("number" == typeof l && !Hr.includes(l)) throw new Error('"scale" value in candleVectors must be any of the following numbers: '.concat(Hr.join(", ")));
|
|
3856
3877
|
if ("number" != typeof s || !Number.isInteger(s) || s < 0) throw new Error('"patternSize" value in candleVectors must be a positive integer.');
|
|
3857
3878
|
if ("boolean" != typeof h) throw new Error('"autoMinMax" value in candleVectors must be boolean');
|
|
3858
3879
|
return this.inputParams.push({
|
|
@@ -3874,7 +3895,7 @@ var OHLCV_INDICATORS;
|
|
|
3874
3895
|
if (i(this), "number" != typeof t || t <= 1) throw new Error('fastSize" must be a positive number greater than 1 in volumeOscillator.');
|
|
3875
3896
|
if ("number" != typeof e || e <= t) throw new Error('"slowSize" must be a positive number greater than the "fastSize" in volumeOscillator.');
|
|
3876
3897
|
var n = r.scale, o = void 0 === n ? null : n;
|
|
3877
|
-
if ("number" == typeof o && !
|
|
3898
|
+
if ("number" == typeof o && !Hr.includes(o)) throw new Error('"scale" value in volumeOscillator must be any of the following numbers: '.concat(Hr.join(", ")));
|
|
3878
3899
|
return this.inputParams.push({
|
|
3879
3900
|
key: "volumeOscillator",
|
|
3880
3901
|
params: [ t, e, {
|
|
@@ -3898,7 +3919,7 @@ var OHLCV_INDICATORS;
|
|
|
3898
3919
|
params: []
|
|
3899
3920
|
}), this;
|
|
3900
3921
|
}
|
|
3901
|
-
} ], e &&
|
|
3922
|
+
} ], e && Nr(t.prototype, e), r && Nr(t, r), Object.defineProperty(t, "prototype", {
|
|
3902
3923
|
writable: !1
|
|
3903
3924
|
}), t;
|
|
3904
3925
|
var t, e, r;
|