ohlcv-indicators 3.3.1 → 3.3.2
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 */ Hr
|
|
99
99
|
});
|
|
100
100
|
var o = function(t) {
|
|
101
101
|
return "string" == typeof t && /^\d{4}-\d{2}-\d{2}/.test(t);
|
|
@@ -198,7 +198,7 @@ var OHLCV_INDICATORS;
|
|
|
198
198
|
if (!n[0]) return t.s = i, t.c = [ t.e = 0 ], t;
|
|
199
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
|
+
_ = S.c = [], j = 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,
|
|
@@ -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
|
-
j
|
|
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 _[0] || 1 == j || (
|
|
235
235
|
// There can't be more than one zero.
|
|
236
|
-
|
|
236
|
+
_.shift(), S.e--, P--),
|
|
237
237
|
// Round?
|
|
238
|
-
|
|
238
|
+
j > 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.
|
|
@@ -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, _() ? 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 (_()) 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 && j(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
|
+
}), j(r, t);
|
|
659
659
|
}, S(t);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function _() {
|
|
662
662
|
try {
|
|
663
663
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
664
664
|
} catch (t) {}
|
|
665
|
-
return (
|
|
665
|
+
return (_ = function() {
|
|
666
666
|
return !!t;
|
|
667
667
|
})();
|
|
668
668
|
}
|
|
669
|
-
function
|
|
670
|
-
return
|
|
669
|
+
function j(t, e) {
|
|
670
|
+
return j = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
671
671
|
return t.__proto__ = e, t;
|
|
672
|
-
},
|
|
672
|
+
}, j(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 && j(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 && q(t, e);
|
|
835
835
|
}
|
|
836
|
-
function
|
|
837
|
-
return
|
|
836
|
+
function q(t, e) {
|
|
837
|
+
return q = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
|
|
838
838
|
return t.__proto__ = e, t;
|
|
839
|
-
},
|
|
839
|
+
}, q(t, e);
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function z(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), z(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",
|
|
@@ -1148,7 +1148,7 @@ var OHLCV_INDICATORS;
|
|
|
1148
1148
|
}(t, "string");
|
|
1149
1149
|
return "symbol" == dt(e) ? e : e + "";
|
|
1150
1150
|
}
|
|
1151
|
-
var
|
|
1151
|
+
var _t = 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),
|
|
@@ -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 jt(t) {
|
|
1191
|
+
return jt = "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
|
+
}, jt(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" == jt(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" != jt(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" != jt(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" == jt(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 qt = 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 zt(t) {
|
|
1383
|
+
return zt = "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
|
+
}, zt(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" == zt(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" != zt(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" != zt(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" == zt(e) ? e : e + "";
|
|
1464
1464
|
}
|
|
1465
1465
|
var te = function(t) {
|
|
1466
1466
|
function e(t) {
|
|
@@ -1588,14 +1588,15 @@ var OHLCV_INDICATORS;
|
|
|
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
1590
|
}, se = function(t, e, r, n, o) {
|
|
1591
|
-
|
|
1592
|
-
t.length
|
|
1593
|
-
|
|
1591
|
+
var i = n > 0, a = Math.abs(n);
|
|
1592
|
+
if (o ? t[e][t[e].length - 1] = a : t[e].push(a), t[e].length > r && t[e].shift(),
|
|
1593
|
+
t[e].length < r) return null;
|
|
1594
|
+
var u = t[e].reduce((function(t, e) {
|
|
1594
1595
|
return t + e;
|
|
1595
|
-
}), 0) / r,
|
|
1596
|
-
return t + Math.pow(e -
|
|
1597
|
-
}), 0) / r);
|
|
1598
|
-
return
|
|
1596
|
+
}), 0) / r, l = Math.sqrt(t[e].reduce((function(t, e) {
|
|
1597
|
+
return t + Math.pow(e - u, 2);
|
|
1598
|
+
}), 0) / r), c = (a - u) / l;
|
|
1599
|
+
return i ? c : -c;
|
|
1599
1600
|
};
|
|
1600
1601
|
// ./src/moving-averages/movingAverages.js
|
|
1601
1602
|
function fe(t) {
|
|
@@ -1671,30 +1672,10 @@ var OHLCV_INDICATORS;
|
|
|
1671
1672
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1672
1673
|
return n;
|
|
1673
1674
|
}
|
|
1674
|
-
|
|
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 = {
|
|
1675
|
+
var be = {
|
|
1695
1676
|
ema: Dt,
|
|
1696
1677
|
sma: nt
|
|
1697
|
-
},
|
|
1678
|
+
}, de = function(t, e, r, n) {
|
|
1698
1679
|
if (!r || "object" !== fe(r)) throw new Error('"options" must be an object in '.concat(t, ". eg: {target, height, range}"));
|
|
1699
1680
|
var o = r.target, i = void 0 === o ? "close" : o, a = r.diff, u = void 0 === a ? null : a;
|
|
1700
1681
|
if ("string" != typeof i) throw new Error('"target" must be a valid keyName '.concat(t, "."));
|
|
@@ -1724,26 +1705,26 @@ var OHLCV_INDICATORS;
|
|
|
1724
1705
|
return l;
|
|
1725
1706
|
};
|
|
1726
1707
|
// ./src/moving-averages/macd.js
|
|
1727
|
-
function
|
|
1728
|
-
return
|
|
1708
|
+
function me(t) {
|
|
1709
|
+
return me = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1729
1710
|
return typeof t;
|
|
1730
1711
|
} : function(t) {
|
|
1731
1712
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1732
|
-
},
|
|
1713
|
+
}, me(t);
|
|
1733
1714
|
}
|
|
1734
|
-
function
|
|
1715
|
+
function ge(t, e, r) {
|
|
1735
1716
|
return (e = function(t) {
|
|
1736
1717
|
var e = function(t, e) {
|
|
1737
|
-
if ("object" !=
|
|
1718
|
+
if ("object" != me(t) || !t) return t;
|
|
1738
1719
|
var r = t[Symbol.toPrimitive];
|
|
1739
1720
|
if (void 0 !== r) {
|
|
1740
1721
|
var n = r.call(t, e || "default");
|
|
1741
|
-
if ("object" !=
|
|
1722
|
+
if ("object" != me(n)) return n;
|
|
1742
1723
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1743
1724
|
}
|
|
1744
1725
|
return ("string" === e ? String : Number)(t);
|
|
1745
1726
|
}(t, "string");
|
|
1746
|
-
return "symbol" ==
|
|
1727
|
+
return "symbol" == me(e) ? e : e + "";
|
|
1747
1728
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1748
1729
|
value: r,
|
|
1749
1730
|
enumerable: !0,
|
|
@@ -1751,57 +1732,57 @@ var OHLCV_INDICATORS;
|
|
|
1751
1732
|
writable: !0
|
|
1752
1733
|
}) : t[e] = r, t;
|
|
1753
1734
|
}
|
|
1754
|
-
function
|
|
1735
|
+
function we(t) {
|
|
1755
1736
|
return function(t) {
|
|
1756
|
-
if (Array.isArray(t)) return
|
|
1737
|
+
if (Array.isArray(t)) return Oe(t);
|
|
1757
1738
|
}(t) || function(t) {
|
|
1758
1739
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1759
1740
|
}(t) || function(t, e) {
|
|
1760
1741
|
if (t) {
|
|
1761
|
-
if ("string" == typeof t) return
|
|
1742
|
+
if ("string" == typeof t) return Oe(t, e);
|
|
1762
1743
|
var r = {}.toString.call(t).slice(8, -1);
|
|
1763
|
-
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
1744
|
+
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) ? Oe(t, e) : void 0;
|
|
1764
1745
|
}
|
|
1765
1746
|
}(t) || function() {
|
|
1766
1747
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1767
1748
|
}();
|
|
1768
1749
|
}
|
|
1769
|
-
function
|
|
1750
|
+
function Oe(t, e) {
|
|
1770
1751
|
(null == e || e > t.length) && (e = t.length);
|
|
1771
1752
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1772
1753
|
return n;
|
|
1773
1754
|
}
|
|
1774
|
-
var
|
|
1755
|
+
var Se = "close";
|
|
1775
1756
|
// ./src/moving-averages/relativeVolume.js
|
|
1776
1757
|
function _e(t) {
|
|
1777
1758
|
return function(t) {
|
|
1778
|
-
if (Array.isArray(t)) return
|
|
1759
|
+
if (Array.isArray(t)) return je(t);
|
|
1779
1760
|
}(t) || function(t) {
|
|
1780
1761
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1781
1762
|
}(t) || function(t, e) {
|
|
1782
1763
|
if (t) {
|
|
1783
|
-
if ("string" == typeof t) return
|
|
1764
|
+
if ("string" == typeof t) return je(t, e);
|
|
1784
1765
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
1766
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? je(t, e) : void 0;
|
|
1786
1767
|
}
|
|
1787
1768
|
}(t) || function() {
|
|
1788
1769
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1789
1770
|
}();
|
|
1790
1771
|
}
|
|
1791
|
-
function
|
|
1772
|
+
function je(t, e) {
|
|
1792
1773
|
(null == e || e > t.length) && (e = t.length);
|
|
1793
1774
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1794
1775
|
return n;
|
|
1795
1776
|
}
|
|
1796
1777
|
// ./src/moving-averages/donchianChannel.js
|
|
1797
|
-
function
|
|
1798
|
-
return
|
|
1778
|
+
function Pe(t) {
|
|
1779
|
+
return Pe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1799
1780
|
return typeof t;
|
|
1800
1781
|
} : function(t) {
|
|
1801
1782
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1802
|
-
},
|
|
1783
|
+
}, Pe(t);
|
|
1803
1784
|
}
|
|
1804
|
-
function
|
|
1785
|
+
function Ae(t, e) {
|
|
1805
1786
|
var r = Object.keys(t);
|
|
1806
1787
|
if (Object.getOwnPropertySymbols) {
|
|
1807
1788
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -1811,19 +1792,19 @@ var OHLCV_INDICATORS;
|
|
|
1811
1792
|
}
|
|
1812
1793
|
return r;
|
|
1813
1794
|
}
|
|
1814
|
-
function
|
|
1795
|
+
function Ee(t, e, r) {
|
|
1815
1796
|
return (e = function(t) {
|
|
1816
1797
|
var e = function(t, e) {
|
|
1817
|
-
if ("object" !=
|
|
1798
|
+
if ("object" != Pe(t) || !t) return t;
|
|
1818
1799
|
var r = t[Symbol.toPrimitive];
|
|
1819
1800
|
if (void 0 !== r) {
|
|
1820
1801
|
var n = r.call(t, e || "default");
|
|
1821
|
-
if ("object" !=
|
|
1802
|
+
if ("object" != Pe(n)) return n;
|
|
1822
1803
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1823
1804
|
}
|
|
1824
1805
|
return ("string" === e ? String : Number)(t);
|
|
1825
1806
|
}(t, "string");
|
|
1826
|
-
return "symbol" ==
|
|
1807
|
+
return "symbol" == Pe(e) ? e : e + "";
|
|
1827
1808
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1828
1809
|
value: r,
|
|
1829
1810
|
enumerable: !0,
|
|
@@ -1831,19 +1812,19 @@ var OHLCV_INDICATORS;
|
|
|
1831
1812
|
writable: !0
|
|
1832
1813
|
}) : t[e] = r, t;
|
|
1833
1814
|
}
|
|
1834
|
-
function
|
|
1815
|
+
function Me(t) {
|
|
1835
1816
|
return function(t) {
|
|
1836
|
-
if (Array.isArray(t)) return
|
|
1817
|
+
if (Array.isArray(t)) return Te(t);
|
|
1837
1818
|
}(t) || function(t) {
|
|
1838
1819
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1839
|
-
}(t) ||
|
|
1820
|
+
}(t) || ke(t) || function() {
|
|
1840
1821
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1841
1822
|
}();
|
|
1842
1823
|
}
|
|
1843
|
-
function
|
|
1824
|
+
function xe(t, e) {
|
|
1844
1825
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1845
1826
|
if (!r) {
|
|
1846
|
-
if (Array.isArray(t) || (r =
|
|
1827
|
+
if (Array.isArray(t) || (r = ke(t)) || e && t && "number" == typeof t.length) {
|
|
1847
1828
|
r && (t = r);
|
|
1848
1829
|
var n = 0, o = function() {};
|
|
1849
1830
|
return {
|
|
@@ -1885,27 +1866,27 @@ var OHLCV_INDICATORS;
|
|
|
1885
1866
|
}
|
|
1886
1867
|
};
|
|
1887
1868
|
}
|
|
1888
|
-
function
|
|
1869
|
+
function ke(t, e) {
|
|
1889
1870
|
if (t) {
|
|
1890
|
-
if ("string" == typeof t) return
|
|
1871
|
+
if ("string" == typeof t) return Te(t, e);
|
|
1891
1872
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
1873
|
+
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) ? Te(t, e) : void 0;
|
|
1893
1874
|
}
|
|
1894
1875
|
}
|
|
1895
|
-
function
|
|
1876
|
+
function Te(t, e) {
|
|
1896
1877
|
(null == e || e > t.length) && (e = t.length);
|
|
1897
1878
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
1898
1879
|
return n;
|
|
1899
1880
|
}
|
|
1900
1881
|
// ./src/moving-averages/bollingerBands.js
|
|
1901
|
-
function
|
|
1902
|
-
return
|
|
1882
|
+
function Ie(t) {
|
|
1883
|
+
return Ie = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
1903
1884
|
return typeof t;
|
|
1904
1885
|
} : function(t) {
|
|
1905
1886
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1906
|
-
},
|
|
1887
|
+
}, Ie(t);
|
|
1907
1888
|
}
|
|
1908
|
-
function
|
|
1889
|
+
function Ce(t, e) {
|
|
1909
1890
|
var r = Object.keys(t);
|
|
1910
1891
|
if (Object.getOwnPropertySymbols) {
|
|
1911
1892
|
var n = Object.getOwnPropertySymbols(t);
|
|
@@ -1915,19 +1896,19 @@ var OHLCV_INDICATORS;
|
|
|
1915
1896
|
}
|
|
1916
1897
|
return r;
|
|
1917
1898
|
}
|
|
1918
|
-
function
|
|
1899
|
+
function Re(t, e, r) {
|
|
1919
1900
|
return (e = function(t) {
|
|
1920
1901
|
var e = function(t, e) {
|
|
1921
|
-
if ("object" !=
|
|
1902
|
+
if ("object" != Ie(t) || !t) return t;
|
|
1922
1903
|
var r = t[Symbol.toPrimitive];
|
|
1923
1904
|
if (void 0 !== r) {
|
|
1924
1905
|
var n = r.call(t, e || "default");
|
|
1925
|
-
if ("object" !=
|
|
1906
|
+
if ("object" != Ie(n)) return n;
|
|
1926
1907
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1927
1908
|
}
|
|
1928
1909
|
return ("string" === e ? String : Number)(t);
|
|
1929
1910
|
}(t, "string");
|
|
1930
|
-
return "symbol" ==
|
|
1911
|
+
return "symbol" == Ie(e) ? e : e + "";
|
|
1931
1912
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
1932
1913
|
value: r,
|
|
1933
1914
|
enumerable: !0,
|
|
@@ -1935,19 +1916,19 @@ var OHLCV_INDICATORS;
|
|
|
1935
1916
|
writable: !0
|
|
1936
1917
|
}) : t[e] = r, t;
|
|
1937
1918
|
}
|
|
1938
|
-
function
|
|
1919
|
+
function De(t) {
|
|
1939
1920
|
return function(t) {
|
|
1940
|
-
if (Array.isArray(t)) return
|
|
1921
|
+
if (Array.isArray(t)) return Ne(t);
|
|
1941
1922
|
}(t) || function(t) {
|
|
1942
1923
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
1943
|
-
}(t) ||
|
|
1924
|
+
}(t) || Be(t) || function() {
|
|
1944
1925
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1945
1926
|
}();
|
|
1946
1927
|
}
|
|
1947
|
-
function
|
|
1928
|
+
function Ve(t, e) {
|
|
1948
1929
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
1949
1930
|
if (!r) {
|
|
1950
|
-
if (Array.isArray(t) || (r =
|
|
1931
|
+
if (Array.isArray(t) || (r = Be(t)) || e && t && "number" == typeof t.length) {
|
|
1951
1932
|
r && (t = r);
|
|
1952
1933
|
var n = 0, o = function() {};
|
|
1953
1934
|
return {
|
|
@@ -1989,46 +1970,46 @@ var OHLCV_INDICATORS;
|
|
|
1989
1970
|
}
|
|
1990
1971
|
};
|
|
1991
1972
|
}
|
|
1992
|
-
function
|
|
1973
|
+
function Be(t, e) {
|
|
1993
1974
|
if (t) {
|
|
1994
|
-
if ("string" == typeof t) return
|
|
1975
|
+
if ("string" == typeof t) return Ne(t, e);
|
|
1995
1976
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
1977
|
+
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) ? Ne(t, e) : void 0;
|
|
1997
1978
|
}
|
|
1998
1979
|
}
|
|
1999
|
-
function
|
|
1980
|
+
function Ne(t, e) {
|
|
2000
1981
|
(null == e || e > t.length) && (e = t.length);
|
|
2001
1982
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2002
1983
|
return n;
|
|
2003
1984
|
}
|
|
2004
1985
|
// ./src/oscillators/volumeOscillator.js
|
|
2005
|
-
function
|
|
1986
|
+
function Le(t) {
|
|
2006
1987
|
return function(t) {
|
|
2007
|
-
if (Array.isArray(t)) return
|
|
1988
|
+
if (Array.isArray(t)) return He(t);
|
|
2008
1989
|
}(t) || function(t) {
|
|
2009
1990
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2010
1991
|
}(t) || function(t, e) {
|
|
2011
1992
|
if (t) {
|
|
2012
|
-
if ("string" == typeof t) return
|
|
1993
|
+
if ("string" == typeof t) return He(t, e);
|
|
2013
1994
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
1995
|
+
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) ? He(t, e) : void 0;
|
|
2015
1996
|
}
|
|
2016
1997
|
}(t) || function() {
|
|
2017
1998
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2018
1999
|
}();
|
|
2019
2000
|
}
|
|
2020
|
-
function
|
|
2001
|
+
function He(t, e) {
|
|
2021
2002
|
(null == e || e > t.length) && (e = t.length);
|
|
2022
2003
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2023
2004
|
return n;
|
|
2024
2005
|
}
|
|
2025
2006
|
// ./src/studies/candleVectors.js
|
|
2026
|
-
function
|
|
2027
|
-
return
|
|
2007
|
+
function Ue(t) {
|
|
2008
|
+
return Ue = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2028
2009
|
return typeof t;
|
|
2029
2010
|
} : function(t) {
|
|
2030
2011
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2031
|
-
},
|
|
2012
|
+
}, Ue(t);
|
|
2032
2013
|
}
|
|
2033
2014
|
function qe(t, e) {
|
|
2034
2015
|
var r = Object.keys(t);
|
|
@@ -2040,30 +2021,30 @@ var OHLCV_INDICATORS;
|
|
|
2040
2021
|
}
|
|
2041
2022
|
return r;
|
|
2042
2023
|
}
|
|
2043
|
-
function
|
|
2024
|
+
function ze(t) {
|
|
2044
2025
|
for (var e = 1; e < arguments.length; e++) {
|
|
2045
2026
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2046
2027
|
e % 2 ? qe(Object(r), !0).forEach((function(e) {
|
|
2047
|
-
|
|
2028
|
+
$e(t, e, r[e]);
|
|
2048
2029
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : qe(Object(r)).forEach((function(e) {
|
|
2049
2030
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2050
2031
|
}));
|
|
2051
2032
|
}
|
|
2052
2033
|
return t;
|
|
2053
2034
|
}
|
|
2054
|
-
function
|
|
2035
|
+
function $e(t, e, r) {
|
|
2055
2036
|
return (e = function(t) {
|
|
2056
2037
|
var e = function(t, e) {
|
|
2057
|
-
if ("object" !=
|
|
2038
|
+
if ("object" != Ue(t) || !t) return t;
|
|
2058
2039
|
var r = t[Symbol.toPrimitive];
|
|
2059
2040
|
if (void 0 !== r) {
|
|
2060
2041
|
var n = r.call(t, e || "default");
|
|
2061
|
-
if ("object" !=
|
|
2042
|
+
if ("object" != Ue(n)) return n;
|
|
2062
2043
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2063
2044
|
}
|
|
2064
2045
|
return ("string" === e ? String : Number)(t);
|
|
2065
2046
|
}(t, "string");
|
|
2066
|
-
return "symbol" ==
|
|
2047
|
+
return "symbol" == Ue(e) ? e : e + "";
|
|
2067
2048
|
}(e)) in t ? Object.defineProperty(t, e, {
|
|
2068
2049
|
value: r,
|
|
2069
2050
|
enumerable: !0,
|
|
@@ -2071,16 +2052,16 @@ var OHLCV_INDICATORS;
|
|
|
2071
2052
|
writable: !0
|
|
2072
2053
|
}) : t[e] = r, t;
|
|
2073
2054
|
}
|
|
2074
|
-
function
|
|
2055
|
+
function Fe(t) {
|
|
2075
2056
|
return function(t) {
|
|
2076
|
-
if (Array.isArray(t)) return
|
|
2057
|
+
if (Array.isArray(t)) return We(t);
|
|
2077
2058
|
}(t) || function(t) {
|
|
2078
2059
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2079
|
-
}(t) ||
|
|
2060
|
+
}(t) || Je(t) || function() {
|
|
2080
2061
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2081
2062
|
}();
|
|
2082
2063
|
}
|
|
2083
|
-
function
|
|
2064
|
+
function Ke(t, e) {
|
|
2084
2065
|
return function(t) {
|
|
2085
2066
|
if (Array.isArray(t)) return t;
|
|
2086
2067
|
}(t) || function(t, e) {
|
|
@@ -2103,14 +2084,14 @@ var OHLCV_INDICATORS;
|
|
|
2103
2084
|
}
|
|
2104
2085
|
return u;
|
|
2105
2086
|
}
|
|
2106
|
-
}(t, e) ||
|
|
2087
|
+
}(t, e) || Je(t, e) || function() {
|
|
2107
2088
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2108
2089
|
}();
|
|
2109
2090
|
}
|
|
2110
|
-
function
|
|
2091
|
+
function Ge(t, e) {
|
|
2111
2092
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2112
2093
|
if (!r) {
|
|
2113
|
-
if (Array.isArray(t) || (r =
|
|
2094
|
+
if (Array.isArray(t) || (r = Je(t)) || e && t && "number" == typeof t.length) {
|
|
2114
2095
|
r && (t = r);
|
|
2115
2096
|
var n = 0, o = function() {};
|
|
2116
2097
|
return {
|
|
@@ -2152,32 +2133,32 @@ var OHLCV_INDICATORS;
|
|
|
2152
2133
|
}
|
|
2153
2134
|
};
|
|
2154
2135
|
}
|
|
2155
|
-
function
|
|
2136
|
+
function Je(t, e) {
|
|
2156
2137
|
if (t) {
|
|
2157
|
-
if ("string" == typeof t) return
|
|
2138
|
+
if ("string" == typeof t) return We(t, e);
|
|
2158
2139
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
2140
|
+
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) ? We(t, e) : void 0;
|
|
2160
2141
|
}
|
|
2161
2142
|
}
|
|
2162
|
-
function
|
|
2143
|
+
function We(t, e) {
|
|
2163
2144
|
(null == e || e > t.length) && (e = t.length);
|
|
2164
2145
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2165
2146
|
return n;
|
|
2166
2147
|
}
|
|
2167
|
-
var
|
|
2148
|
+
var Ye = function(t, e) {
|
|
2168
2149
|
return t - e;
|
|
2169
2150
|
};
|
|
2170
2151
|
// ./src/studies/lag.js
|
|
2171
|
-
function
|
|
2152
|
+
function Qe(t) {
|
|
2172
2153
|
return function(t) {
|
|
2173
|
-
if (Array.isArray(t)) return
|
|
2154
|
+
if (Array.isArray(t)) return er(t);
|
|
2174
2155
|
}(t) || function(t) {
|
|
2175
2156
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2176
|
-
}(t) ||
|
|
2157
|
+
}(t) || tr(t) || function() {
|
|
2177
2158
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2178
2159
|
}();
|
|
2179
2160
|
}
|
|
2180
|
-
function
|
|
2161
|
+
function Xe(t, e) {
|
|
2181
2162
|
return function(t) {
|
|
2182
2163
|
if (Array.isArray(t)) return t;
|
|
2183
2164
|
}(t) || function(t, e) {
|
|
@@ -2200,14 +2181,14 @@ var OHLCV_INDICATORS;
|
|
|
2200
2181
|
}
|
|
2201
2182
|
return u;
|
|
2202
2183
|
}
|
|
2203
|
-
}(t, e) ||
|
|
2184
|
+
}(t, e) || tr(t, e) || function() {
|
|
2204
2185
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2205
2186
|
}();
|
|
2206
2187
|
}
|
|
2207
|
-
function
|
|
2188
|
+
function Ze(t, e) {
|
|
2208
2189
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2209
2190
|
if (!r) {
|
|
2210
|
-
if (Array.isArray(t) || (r =
|
|
2191
|
+
if (Array.isArray(t) || (r = tr(t)) || e && t && "number" == typeof t.length) {
|
|
2211
2192
|
r && (t = r);
|
|
2212
2193
|
var n = 0, o = function() {};
|
|
2213
2194
|
return {
|
|
@@ -2249,38 +2230,38 @@ var OHLCV_INDICATORS;
|
|
|
2249
2230
|
}
|
|
2250
2231
|
};
|
|
2251
2232
|
}
|
|
2252
|
-
function
|
|
2233
|
+
function tr(t, e) {
|
|
2253
2234
|
if (t) {
|
|
2254
|
-
if ("string" == typeof t) return
|
|
2235
|
+
if ("string" == typeof t) return er(t, e);
|
|
2255
2236
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
2237
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? er(t, e) : void 0;
|
|
2257
2238
|
}
|
|
2258
2239
|
}
|
|
2259
|
-
function
|
|
2240
|
+
function er(t, e) {
|
|
2260
2241
|
(null == e || e > t.length) && (e = t.length);
|
|
2261
2242
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2262
2243
|
return n;
|
|
2263
2244
|
}
|
|
2264
|
-
function
|
|
2265
|
-
return
|
|
2245
|
+
function rr(t) {
|
|
2246
|
+
return rr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2266
2247
|
return typeof t;
|
|
2267
2248
|
} : function(t) {
|
|
2268
2249
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2269
|
-
},
|
|
2250
|
+
}, rr(t);
|
|
2270
2251
|
}
|
|
2271
|
-
var
|
|
2252
|
+
var nr = function(t, e) {
|
|
2272
2253
|
var r = t.instances, n = t.verticalOhlcv, o = t.nullArray;
|
|
2273
2254
|
if (0 === e) {
|
|
2274
2255
|
var i = t.inputParams, a = t.priceBased, u = i.filter((function(t) {
|
|
2275
2256
|
return "lag" === t.key;
|
|
2276
2257
|
}));
|
|
2277
|
-
if ("object" !==
|
|
2258
|
+
if ("object" !== rr(u)) return;
|
|
2278
2259
|
var l, c = u.map((function(t) {
|
|
2279
2260
|
return t.params;
|
|
2280
|
-
})), s =
|
|
2261
|
+
})), s = Ze(c);
|
|
2281
2262
|
try {
|
|
2282
2263
|
for (s.s(); !(l = s.n()).done; ) {
|
|
2283
|
-
var f, h =
|
|
2264
|
+
var f, h = Xe(l.value, 2), y = h[0], p = h[1], v = Ze(y);
|
|
2284
2265
|
try {
|
|
2285
2266
|
for (v.s(); !(f = v.n()).done; ) {
|
|
2286
2267
|
var b = f.value;
|
|
@@ -2301,19 +2282,19 @@ var OHLCV_INDICATORS;
|
|
|
2301
2282
|
lagParams: c
|
|
2302
2283
|
};
|
|
2303
2284
|
}
|
|
2304
|
-
var m, g =
|
|
2285
|
+
var m, g = Ze(r.lag.lagParams);
|
|
2305
2286
|
try {
|
|
2306
2287
|
for (g.s(); !(m = g.n()).done; ) {
|
|
2307
|
-
var w, O =
|
|
2288
|
+
var w, O = Xe(m.value, 2), S = O[0], _ = O[1], j = Ze(S);
|
|
2308
2289
|
try {
|
|
2309
|
-
for (
|
|
2290
|
+
for (j.s(); !(w = j.n()).done; ) {
|
|
2310
2291
|
var P = w.value, A = n[P];
|
|
2311
2292
|
// Initialize lagged arrays only on the first index
|
|
2312
|
-
if (0 === e) for (var E = 1; E <=
|
|
2313
|
-
n["".concat(P, "_lag_").concat(E)] =
|
|
2293
|
+
if (0 === e) for (var E = 1; E <= _; E++) {
|
|
2294
|
+
n["".concat(P, "_lag_").concat(E)] = Qe(o);
|
|
2314
2295
|
}
|
|
2315
2296
|
// Populate lagged values
|
|
2316
|
-
for (var M = 1; M <=
|
|
2297
|
+
for (var M = 1; M <= _; M++) {
|
|
2317
2298
|
var x = "".concat(P, "_lag_").concat(M), k = e - M, T = k <= 0 || void 0 === A[k] ? null : A[k];
|
|
2318
2299
|
t.pushToMain({
|
|
2319
2300
|
index: e,
|
|
@@ -2323,9 +2304,9 @@ var OHLCV_INDICATORS;
|
|
|
2323
2304
|
}
|
|
2324
2305
|
}
|
|
2325
2306
|
} catch (t) {
|
|
2326
|
-
|
|
2307
|
+
j.e(t);
|
|
2327
2308
|
} finally {
|
|
2328
|
-
|
|
2309
|
+
j.f();
|
|
2329
2310
|
}
|
|
2330
2311
|
}
|
|
2331
2312
|
} catch (t) {
|
|
@@ -2336,59 +2317,59 @@ var OHLCV_INDICATORS;
|
|
|
2336
2317
|
return !0;
|
|
2337
2318
|
};
|
|
2338
2319
|
// ./src/studies/findCrosses.js
|
|
2339
|
-
function
|
|
2320
|
+
function or(t) {
|
|
2340
2321
|
return function(t) {
|
|
2341
|
-
if (Array.isArray(t)) return
|
|
2322
|
+
if (Array.isArray(t)) return ar(t);
|
|
2342
2323
|
}(t) || function(t) {
|
|
2343
2324
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2344
|
-
}(t) ||
|
|
2325
|
+
}(t) || ir(t) || function() {
|
|
2345
2326
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2346
2327
|
}();
|
|
2347
2328
|
}
|
|
2348
|
-
function
|
|
2329
|
+
function ir(t, e) {
|
|
2349
2330
|
if (t) {
|
|
2350
|
-
if ("string" == typeof t) return
|
|
2331
|
+
if ("string" == typeof t) return ar(t, e);
|
|
2351
2332
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
2333
|
+
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;
|
|
2353
2334
|
}
|
|
2354
2335
|
}
|
|
2355
|
-
function
|
|
2336
|
+
function ar(t, e) {
|
|
2356
2337
|
(null == e || e > t.length) && (e = t.length);
|
|
2357
2338
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2358
2339
|
return n;
|
|
2359
2340
|
}
|
|
2360
|
-
function
|
|
2361
|
-
return
|
|
2341
|
+
function ur(t) {
|
|
2342
|
+
return ur = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
2362
2343
|
return typeof t;
|
|
2363
2344
|
} : function(t) {
|
|
2364
2345
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2365
|
-
},
|
|
2346
|
+
}, ur(t);
|
|
2366
2347
|
}
|
|
2367
|
-
function
|
|
2348
|
+
function lr(t, e) {
|
|
2368
2349
|
for (var r = 0; r < e.length; r++) {
|
|
2369
2350
|
var n = e[r];
|
|
2370
2351
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
2371
|
-
Object.defineProperty(t,
|
|
2352
|
+
Object.defineProperty(t, cr(n.key), n);
|
|
2372
2353
|
}
|
|
2373
2354
|
}
|
|
2374
|
-
function
|
|
2355
|
+
function cr(t) {
|
|
2375
2356
|
var e = function(t, e) {
|
|
2376
|
-
if ("object" !=
|
|
2357
|
+
if ("object" != ur(t) || !t) return t;
|
|
2377
2358
|
var r = t[Symbol.toPrimitive];
|
|
2378
2359
|
if (void 0 !== r) {
|
|
2379
2360
|
var n = r.call(t, e || "default");
|
|
2380
|
-
if ("object" !=
|
|
2361
|
+
if ("object" != ur(n)) return n;
|
|
2381
2362
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2382
2363
|
}
|
|
2383
2364
|
return ("string" === e ? String : Number)(t);
|
|
2384
2365
|
}(t, "string");
|
|
2385
|
-
return "symbol" ==
|
|
2366
|
+
return "symbol" == ur(e) ? e : e + "";
|
|
2386
2367
|
}
|
|
2387
|
-
var
|
|
2368
|
+
var sr = function(t, e) {
|
|
2388
2369
|
return t > e;
|
|
2389
|
-
},
|
|
2370
|
+
}, fr = function(t, e) {
|
|
2390
2371
|
return t < e;
|
|
2391
|
-
},
|
|
2372
|
+
}, hr = function() {
|
|
2392
2373
|
return t = function t() {
|
|
2393
2374
|
!function(t, e) {
|
|
2394
2375
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -2413,11 +2394,11 @@ var OHLCV_INDICATORS;
|
|
|
2413
2394
|
this.areHighAndLowUndefined || void 0 !== r && void 0 !== o || (this.areHighAndLowUndefined = !0),
|
|
2414
2395
|
null === e || null === n || function(t, e) {
|
|
2415
2396
|
return t === e;
|
|
2416
|
-
}(e, n) ? i = .5 :
|
|
2397
|
+
}(e, n) ? i = .5 : sr(e, n) ? i = this.areHighAndLowUndefined ? 1 : [ o, n, this.prevLow, this.prevSlow ].every((function(t) {
|
|
2417
2398
|
return null !== t;
|
|
2418
|
-
})) &&
|
|
2399
|
+
})) && fr(o, n) && sr(this.prevLow, this.prevSlow) ? 0 : 1 : fr(e, n) && (i = this.areHighAndLowUndefined ? 0 : [ r, n, this.prevHigh, this.prevSlow ].every((function(t) {
|
|
2419
2400
|
return null !== t;
|
|
2420
|
-
})) &&
|
|
2401
|
+
})) && sr(r, n) && fr(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--),
|
|
2421
2402
|
1 === this.interval && this.crossIndexes.up.push(this.index), -1 === this.interval && this.crossIndexes.down.push(this.index),
|
|
2422
2403
|
//save prev state
|
|
2423
2404
|
Object.assign(this, {
|
|
@@ -2434,17 +2415,17 @@ var OHLCV_INDICATORS;
|
|
|
2434
2415
|
value: function() {
|
|
2435
2416
|
return this.interval;
|
|
2436
2417
|
}
|
|
2437
|
-
} ]) &&
|
|
2418
|
+
} ]) && lr(t.prototype, e), r && lr(t, r), Object.defineProperty(t, "prototype", {
|
|
2438
2419
|
writable: !1
|
|
2439
2420
|
}), t;
|
|
2440
2421
|
var t, e, r;
|
|
2441
|
-
}(),
|
|
2422
|
+
}(), yr = function(t, e) {
|
|
2442
2423
|
var r = t.nullArray, n = t.verticalOhlcv, o = t.instances, i = t.len;
|
|
2443
2424
|
if (0 === e) {
|
|
2444
2425
|
var a = t.inputParams.filter((function(t) {
|
|
2445
2426
|
return "crossPairs" === t.key;
|
|
2446
2427
|
}));
|
|
2447
|
-
if ("object" !==
|
|
2428
|
+
if ("object" !== ur(a)) return;
|
|
2448
2429
|
o.crossPairs = {
|
|
2449
2430
|
crossPairsList: a.flatMap((function(t) {
|
|
2450
2431
|
return t.params.flat();
|
|
@@ -2454,7 +2435,7 @@ var OHLCV_INDICATORS;
|
|
|
2454
2435
|
var u, l = function(t, e) {
|
|
2455
2436
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2456
2437
|
if (!r) {
|
|
2457
|
-
if (Array.isArray(t) || (r =
|
|
2438
|
+
if (Array.isArray(t) || (r = ir(t)) || e && t && "number" == typeof t.length) {
|
|
2458
2439
|
r && (t = r);
|
|
2459
2440
|
var n = 0, o = function() {};
|
|
2460
2441
|
return {
|
|
@@ -2504,7 +2485,7 @@ var OHLCV_INDICATORS;
|
|
|
2504
2485
|
if (0 === e) {
|
|
2505
2486
|
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"'));
|
|
2506
2487
|
if (!n.hasOwnProperty(f)) throw Error('slow "'.concat(f, ' not found in crossPairs"'));
|
|
2507
|
-
o[h] = new
|
|
2488
|
+
o[h] = new hr, n[h] = or(r);
|
|
2508
2489
|
}
|
|
2509
2490
|
var y = void 0, p = void 0, v = void 0, b = void 0, d = void 0;
|
|
2510
2491
|
"price" === s ? (p = n.close[e], v = n.high[e], b = n.low[e], d = n[f][e], o[h].update({
|
|
@@ -2529,27 +2510,27 @@ var OHLCV_INDICATORS;
|
|
|
2529
2510
|
}
|
|
2530
2511
|
};
|
|
2531
2512
|
// ./src/studies/dateTime.js
|
|
2532
|
-
function
|
|
2513
|
+
function pr(t) {
|
|
2533
2514
|
return function(t) {
|
|
2534
|
-
if (Array.isArray(t)) return
|
|
2515
|
+
if (Array.isArray(t)) return vr(t);
|
|
2535
2516
|
}(t) || function(t) {
|
|
2536
2517
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2537
2518
|
}(t) || function(t, e) {
|
|
2538
2519
|
if (t) {
|
|
2539
|
-
if ("string" == typeof t) return
|
|
2520
|
+
if ("string" == typeof t) return vr(t, e);
|
|
2540
2521
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
2522
|
+
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) ? vr(t, e) : void 0;
|
|
2542
2523
|
}
|
|
2543
2524
|
}(t) || function() {
|
|
2544
2525
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2545
2526
|
}();
|
|
2546
2527
|
}
|
|
2547
|
-
function
|
|
2528
|
+
function vr(t, e) {
|
|
2548
2529
|
(null == e || e > t.length) && (e = t.length);
|
|
2549
2530
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2550
2531
|
return n;
|
|
2551
2532
|
}
|
|
2552
|
-
var
|
|
2533
|
+
var br = function(t) {
|
|
2553
2534
|
var e = new Date(t), r = e.getMonth(), n = e.getFullYear(), o = e.getHours(), i = e.getMinutes(), a = e.getDay(), u = e.getDate(), l = new Date(e.getFullYear(), e.getMonth(), 1).getDay();
|
|
2554
2535
|
return {
|
|
2555
2536
|
month: r,
|
|
@@ -2562,31 +2543,31 @@ var OHLCV_INDICATORS;
|
|
|
2562
2543
|
};
|
|
2563
2544
|
};
|
|
2564
2545
|
// ./src/studies/priceVariations.js
|
|
2565
|
-
function
|
|
2546
|
+
function dr(t) {
|
|
2566
2547
|
return function(t) {
|
|
2567
|
-
if (Array.isArray(t)) return
|
|
2548
|
+
if (Array.isArray(t)) return mr(t);
|
|
2568
2549
|
}(t) || function(t) {
|
|
2569
2550
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2570
2551
|
}(t) || function(t, e) {
|
|
2571
2552
|
if (t) {
|
|
2572
|
-
if ("string" == typeof t) return
|
|
2553
|
+
if ("string" == typeof t) return mr(t, e);
|
|
2573
2554
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
2555
|
+
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) ? mr(t, e) : void 0;
|
|
2575
2556
|
}
|
|
2576
2557
|
}(t) || function() {
|
|
2577
2558
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2578
2559
|
}();
|
|
2579
2560
|
}
|
|
2580
|
-
function
|
|
2561
|
+
function mr(t, e) {
|
|
2581
2562
|
(null == e || e > t.length) && (e = t.length);
|
|
2582
2563
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2583
2564
|
return n;
|
|
2584
2565
|
}
|
|
2585
|
-
var
|
|
2586
|
-
function
|
|
2566
|
+
var gr = [ "open", "high", "low", "close" ];
|
|
2567
|
+
function wr(t, e) {
|
|
2587
2568
|
var r = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
|
|
2588
2569
|
if (!r) {
|
|
2589
|
-
if (Array.isArray(t) || (r =
|
|
2570
|
+
if (Array.isArray(t) || (r = jr(t)) || e && t && "number" == typeof t.length) {
|
|
2590
2571
|
r && (t = r);
|
|
2591
2572
|
var n = 0, o = function() {};
|
|
2592
2573
|
return {
|
|
@@ -2628,7 +2609,7 @@ var OHLCV_INDICATORS;
|
|
|
2628
2609
|
}
|
|
2629
2610
|
};
|
|
2630
2611
|
}
|
|
2631
|
-
function
|
|
2612
|
+
function Or(t, e) {
|
|
2632
2613
|
if (null == t) return {};
|
|
2633
2614
|
var r, n, o = function(t, e) {
|
|
2634
2615
|
if (null == t) return {};
|
|
@@ -2645,12 +2626,12 @@ var OHLCV_INDICATORS;
|
|
|
2645
2626
|
}
|
|
2646
2627
|
return o;
|
|
2647
2628
|
}
|
|
2648
|
-
function
|
|
2629
|
+
function Sr(t) {
|
|
2649
2630
|
return function(t) {
|
|
2650
|
-
if (Array.isArray(t)) return
|
|
2631
|
+
if (Array.isArray(t)) return Pr(t);
|
|
2651
2632
|
}(t) || function(t) {
|
|
2652
2633
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
2653
|
-
}(t) ||
|
|
2634
|
+
}(t) || jr(t) || function() {
|
|
2654
2635
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2655
2636
|
}();
|
|
2656
2637
|
}
|
|
@@ -2679,23 +2660,23 @@ var OHLCV_INDICATORS;
|
|
|
2679
2660
|
}
|
|
2680
2661
|
return u;
|
|
2681
2662
|
}
|
|
2682
|
-
}(t, e) ||
|
|
2663
|
+
}(t, e) || jr(t, e) || function() {
|
|
2683
2664
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2684
2665
|
}();
|
|
2685
2666
|
}
|
|
2686
|
-
function
|
|
2667
|
+
function jr(t, e) {
|
|
2687
2668
|
if (t) {
|
|
2688
|
-
if ("string" == typeof t) return
|
|
2669
|
+
if ("string" == typeof t) return Pr(t, e);
|
|
2689
2670
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
2671
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Pr(t, e) : void 0;
|
|
2691
2672
|
}
|
|
2692
2673
|
}
|
|
2693
|
-
function
|
|
2674
|
+
function Pr(t, e) {
|
|
2694
2675
|
(null == e || e > t.length) && (e = t.length);
|
|
2695
2676
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
2696
2677
|
return n;
|
|
2697
2678
|
}
|
|
2698
|
-
var
|
|
2679
|
+
var Ar = {
|
|
2699
2680
|
dateTime: function(t, e) {
|
|
2700
2681
|
var r = t.instances, n = t.verticalOhlcv;
|
|
2701
2682
|
if (0 === e) {
|
|
@@ -2710,17 +2691,17 @@ var OHLCV_INDICATORS;
|
|
|
2710
2691
|
cachedDayInfo: i
|
|
2711
2692
|
}
|
|
2712
2693
|
}), Object.assign(n, {
|
|
2713
|
-
day_of_the_week:
|
|
2714
|
-
day_of_the_month:
|
|
2715
|
-
week_of_the_month:
|
|
2716
|
-
hour:
|
|
2717
|
-
month:
|
|
2718
|
-
year:
|
|
2719
|
-
session_daily_index:
|
|
2720
|
-
session_intraday_index:
|
|
2694
|
+
day_of_the_week: pr(o),
|
|
2695
|
+
day_of_the_month: pr(o),
|
|
2696
|
+
week_of_the_month: pr(o),
|
|
2697
|
+
hour: pr(o),
|
|
2698
|
+
month: pr(o),
|
|
2699
|
+
year: pr(o),
|
|
2700
|
+
session_daily_index: pr(o),
|
|
2701
|
+
session_intraday_index: pr(o)
|
|
2721
2702
|
});
|
|
2722
2703
|
}
|
|
2723
|
-
var a = n.date[e], u =
|
|
2704
|
+
var a = n.date[e], u = br(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);
|
|
2724
2705
|
p !== r.dateTime.prevDateStr && (r.dateTime.prevDateStr = p, r.dateTime.sessionDailyIndexCount++,
|
|
2725
2706
|
r.dateTime.sessionIntradayIndexCount = 0), t.pushToMain({
|
|
2726
2707
|
index: e,
|
|
@@ -2757,10 +2738,10 @@ var OHLCV_INDICATORS;
|
|
|
2757
2738
|
}), r.dateTime.sessionIntradayIndexCount++;
|
|
2758
2739
|
},
|
|
2759
2740
|
priceVariations: function(t, e) {
|
|
2760
|
-
0 === e && (t.priceBased =
|
|
2741
|
+
0 === e && (t.priceBased = dr(new Set([].concat(dr(t.priceBased), [ "mid_price_open_close", "mid_price_high_low" ]))),
|
|
2761
2742
|
Object.assign(t.verticalOhlcv, {
|
|
2762
|
-
mid_price_open_close:
|
|
2763
|
-
mid_price_high_low:
|
|
2743
|
+
mid_price_open_close: dr(t.nullArray),
|
|
2744
|
+
mid_price_high_low: dr(t.nullArray)
|
|
2764
2745
|
}));
|
|
2765
2746
|
var r = t.verticalOhlcv.open[e], n = t.verticalOhlcv.high[e], o = t.verticalOhlcv.low[e], i = t.verticalOhlcv.close[e];
|
|
2766
2747
|
t.pushToMain({
|
|
@@ -2817,17 +2798,16 @@ var OHLCV_INDICATORS;
|
|
|
2817
2798
|
});
|
|
2818
2799
|
},
|
|
2819
2800
|
movingAverages: function(t, e, r, n, o) {
|
|
2820
|
-
var i = o.target, a = o.diff, u =
|
|
2801
|
+
var i = o.target, a = o.diff, u = t.verticalOhlcv, l = t.instances, c = t.priceBased, s = t.lastIndexReplace, f = "string" == typeof i && u.hasOwnProperty(i) && "close" !== i ? "_".concat(i) : "", h = "".concat(r, "_").concat(n).concat(f), y = "".concat(r, "_").concat(n, "_diff").concat(f);
|
|
2821
2802
|
if (0 === e) {
|
|
2822
2803
|
var p = t.nullArray;
|
|
2823
2804
|
if (!u.hasOwnProperty(i)) throw new Error("Target property ".concat(i, " not found in verticalOhlcv for ").concat(r, "."));
|
|
2824
2805
|
// Create the main moving average instance.
|
|
2825
2806
|
// If diff configuration is provided, create the diff indicator.
|
|
2826
2807
|
if (l[h] = {
|
|
2827
|
-
maInstance: new
|
|
2828
|
-
arrayChunk: be({}, y, [])
|
|
2808
|
+
maInstance: new be[r](n)
|
|
2829
2809
|
}, u[h] = ye(p), null !== a) {
|
|
2830
|
-
l[h].diffInstance = new
|
|
2810
|
+
l[h].diffInstance = new _t(a.size, a.stdDev);
|
|
2831
2811
|
var v, b = [], d = he(a.targets);
|
|
2832
2812
|
try {
|
|
2833
2813
|
for (d.s(); !(v = d.n()).done; ) {
|
|
@@ -2845,7 +2825,7 @@ var OHLCV_INDICATORS;
|
|
|
2845
2825
|
c.push(h);
|
|
2846
2826
|
}
|
|
2847
2827
|
// Retrieve the current price value.
|
|
2848
|
-
var g = u[i][e], w = l[h], O = w.maInstance, S = w.diffInstance
|
|
2828
|
+
var g = u[i][e], w = l[h], O = w.maInstance, S = w.diffInstance;
|
|
2849
2829
|
// Update the moving average instance.
|
|
2850
2830
|
O.update(g, s);
|
|
2851
2831
|
var _ = null;
|
|
@@ -2861,44 +2841,44 @@ var OHLCV_INDICATORS;
|
|
|
2861
2841
|
key: h,
|
|
2862
2842
|
value: _
|
|
2863
2843
|
}), null !== a) {
|
|
2864
|
-
var
|
|
2844
|
+
var j, P = he(a.targets);
|
|
2865
2845
|
try {
|
|
2866
|
-
for (
|
|
2867
|
-
var
|
|
2846
|
+
for (P.s(); !(j = P.n()).done; ) {
|
|
2847
|
+
var A = j.value, E = null;
|
|
2868
2848
|
// Compute diffValue only if we have a valid MA value.
|
|
2869
|
-
null !== _ && "number" == typeof _ && (
|
|
2849
|
+
null !== _ && "number" == typeof _ && (E = u[A][e] - _),
|
|
2870
2850
|
// Update the diff indicator only if diffValue is a valid number.
|
|
2871
|
-
null !==
|
|
2872
|
-
var
|
|
2851
|
+
null !== E && "number" == typeof E && S.update(Math.abs(E), s);
|
|
2852
|
+
var M = null;
|
|
2873
2853
|
try {
|
|
2874
|
-
|
|
2854
|
+
M = S.getResult();
|
|
2875
2855
|
} catch (t) {
|
|
2876
|
-
|
|
2856
|
+
M = null;
|
|
2877
2857
|
}
|
|
2878
|
-
ce(
|
|
2858
|
+
var x = ce(E, M, a.scale, a.autoMinMax);
|
|
2879
2859
|
t.pushToMain({
|
|
2880
2860
|
index: e,
|
|
2881
|
-
key: "".concat(y, "_").concat(
|
|
2861
|
+
key: "".concat(y, "_").concat(A),
|
|
2882
2862
|
value: x
|
|
2883
2863
|
});
|
|
2884
2864
|
}
|
|
2885
2865
|
} catch (t) {
|
|
2886
|
-
|
|
2866
|
+
P.e(t);
|
|
2887
2867
|
} finally {
|
|
2888
|
-
|
|
2868
|
+
P.f();
|
|
2889
2869
|
}
|
|
2890
2870
|
}
|
|
2891
2871
|
return !0;
|
|
2892
2872
|
},
|
|
2893
2873
|
macd: function(t, e, r, n, o, i) {
|
|
2894
|
-
var a = i.target, u = t.verticalOhlcv, l = t.instances, c = t.lastIndexReplace, s = "".concat(r, "_").concat(n, "_").concat(o).concat(a ===
|
|
2874
|
+
var a = i.target, u = t.verticalOhlcv, l = t.instances, c = t.lastIndexReplace, s = "".concat(r, "_").concat(n, "_").concat(o).concat(a === Se ? "" : "_".concat(a));
|
|
2895
2875
|
// Initialization on the first index.
|
|
2896
2876
|
if (0 === e) {
|
|
2897
2877
|
var f = t.inputParams, h = t.crossPairsList, y = t.nullArray, p = t.priceBased;
|
|
2898
2878
|
if (!u.hasOwnProperty(a)) throw new Error("Target property ".concat(a, " not found in verticalOhlcv for macd."));
|
|
2899
2879
|
var v = f.filter((function(t) {
|
|
2900
2880
|
return "macd" === t.key;
|
|
2901
|
-
})).length, b = v > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", d = a ===
|
|
2881
|
+
})).length, b = v > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", d = a === Se ? "".concat(b, "_diff") : "".concat(b, "_diff_").concat(a), m = a === Se ? "".concat(b, "_dea") : "".concat(b, "_dea_").concat(a), g = a === Se ? "".concat(b, "_histogram") : "".concat(b, "_histogram_").concat(a);
|
|
2902
2882
|
// Choose a display prefix based on the number of indicators.
|
|
2903
2883
|
h.push({
|
|
2904
2884
|
fast: d,
|
|
@@ -2907,10 +2887,10 @@ var OHLCV_INDICATORS;
|
|
|
2907
2887
|
}), l.hasOwnProperty("macd") || (l.macd = {
|
|
2908
2888
|
numberOfIndicators: v,
|
|
2909
2889
|
settings: {}
|
|
2910
|
-
}), l.macd.settings[s] = new
|
|
2890
|
+
}), l.macd.settings[s] = new qt(new Dt(r), new Dt(n), new Dt(o)), Object.assign(u, ge(ge(ge({}, d, we(y)), m, we(y)), g, we(y))),
|
|
2911
2891
|
p.push(d, m, g);
|
|
2912
2892
|
}
|
|
2913
|
-
var w = l.macd, O = w.numberOfIndicators, S = w.settings,
|
|
2893
|
+
var w = l.macd, O = w.numberOfIndicators, S = w.settings, _ = O > 1 ? "macd_".concat(r, "_").concat(n, "_").concat(o) : "macd", j = a === Se ? "".concat(_, "_diff") : "".concat(_, "_diff_").concat(a), P = a === Se ? "".concat(_, "_dea") : "".concat(_, "_dea_").concat(a), A = a === Se ? "".concat(_, "_histogram") : "".concat(_, "_histogram_").concat(a), E = S[s], M = u[a][e];
|
|
2914
2894
|
E.update(M, c);
|
|
2915
2895
|
var x = null;
|
|
2916
2896
|
try {
|
|
@@ -2922,7 +2902,7 @@ var OHLCV_INDICATORS;
|
|
|
2922
2902
|
// Always push values; use null as fallback when macdResult is missing.
|
|
2923
2903
|
return t.pushToMain({
|
|
2924
2904
|
index: e,
|
|
2925
|
-
key:
|
|
2905
|
+
key: j,
|
|
2926
2906
|
value: x ? x.macd : null
|
|
2927
2907
|
}), t.pushToMain({
|
|
2928
2908
|
index: e,
|
|
@@ -2972,7 +2952,7 @@ var OHLCV_INDICATORS;
|
|
|
2972
2952
|
settings: {}
|
|
2973
2953
|
});
|
|
2974
2954
|
// Set up additional arrays for each range property.
|
|
2975
|
-
var w, O =
|
|
2955
|
+
var w, O = xe(a);
|
|
2976
2956
|
try {
|
|
2977
2957
|
for (O.s(); !(w = O.n()).done; ) {
|
|
2978
2958
|
var S = w.value;
|
|
@@ -2984,54 +2964,54 @@ var OHLCV_INDICATORS;
|
|
|
2984
2964
|
} finally {
|
|
2985
2965
|
O.f();
|
|
2986
2966
|
}
|
|
2987
|
-
var
|
|
2988
|
-
return [ t,
|
|
2967
|
+
var _ = Object.fromEntries(g.map((function(t) {
|
|
2968
|
+
return [ t, Me(b) ];
|
|
2989
2969
|
})));
|
|
2990
2970
|
Object.assign(f, function(t) {
|
|
2991
2971
|
for (var e = 1; e < arguments.length; e++) {
|
|
2992
2972
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
2993
|
-
e % 2 ?
|
|
2994
|
-
|
|
2995
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
2973
|
+
e % 2 ? Ae(Object(r), !0).forEach((function(e) {
|
|
2974
|
+
Ee(t, e, r[e]);
|
|
2975
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Ae(Object(r)).forEach((function(e) {
|
|
2996
2976
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
2997
2977
|
}));
|
|
2998
2978
|
}
|
|
2999
2979
|
return t;
|
|
3000
|
-
}({},
|
|
2980
|
+
}({}, _)), l > 0 && t.lag(g, l), v.push("".concat(m, "_upper"), "".concat(m, "_basis"), "".concat(m, "_lower")),
|
|
3001
2981
|
h.donchian_channel.settings[s] = {
|
|
3002
2982
|
maxDeque: [],
|
|
3003
2983
|
// will hold indices for highs in descending order
|
|
3004
2984
|
minDeque: []
|
|
3005
2985
|
};
|
|
3006
2986
|
}
|
|
3007
|
-
var
|
|
2987
|
+
var j = 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;
|
|
3008
2988
|
// window: [startIdx, endIdx)
|
|
3009
2989
|
// If the window is not fully available, push null values for all computed outputs.
|
|
3010
2990
|
if (k < 0 || x > y) {
|
|
3011
2991
|
t.pushToMain({
|
|
3012
2992
|
index: e,
|
|
3013
|
-
key: "".concat(
|
|
2993
|
+
key: "".concat(j, "_upper"),
|
|
3014
2994
|
value: null
|
|
3015
2995
|
}), t.pushToMain({
|
|
3016
2996
|
index: e,
|
|
3017
|
-
key: "".concat(
|
|
2997
|
+
key: "".concat(j, "_basis"),
|
|
3018
2998
|
value: null
|
|
3019
2999
|
}), t.pushToMain({
|
|
3020
3000
|
index: e,
|
|
3021
|
-
key: "".concat(
|
|
3001
|
+
key: "".concat(j, "_lower"),
|
|
3022
3002
|
value: null
|
|
3023
3003
|
}), i && t.pushToMain({
|
|
3024
3004
|
index: e,
|
|
3025
|
-
key: "".concat(
|
|
3005
|
+
key: "".concat(j, "_height"),
|
|
3026
3006
|
value: null
|
|
3027
3007
|
});
|
|
3028
|
-
var T, I =
|
|
3008
|
+
var T, I = xe(a);
|
|
3029
3009
|
try {
|
|
3030
3010
|
for (I.s(); !(T = I.n()).done; ) {
|
|
3031
3011
|
var C = T.value;
|
|
3032
3012
|
t.pushToMain({
|
|
3033
3013
|
index: e,
|
|
3034
|
-
key: "".concat(
|
|
3014
|
+
key: "".concat(j, "_range_").concat(C),
|
|
3035
3015
|
value: null
|
|
3036
3016
|
});
|
|
3037
3017
|
}
|
|
@@ -3056,35 +3036,35 @@ var OHLCV_INDICATORS;
|
|
|
3056
3036
|
// Always push the main indicator values.
|
|
3057
3037
|
t.pushToMain({
|
|
3058
3038
|
index: e,
|
|
3059
|
-
key: "".concat(
|
|
3039
|
+
key: "".concat(j, "_upper"),
|
|
3060
3040
|
value: V
|
|
3061
3041
|
}), t.pushToMain({
|
|
3062
3042
|
index: e,
|
|
3063
|
-
key: "".concat(
|
|
3043
|
+
key: "".concat(j, "_basis"),
|
|
3064
3044
|
value: N
|
|
3065
3045
|
}), t.pushToMain({
|
|
3066
3046
|
index: e,
|
|
3067
|
-
key: "".concat(
|
|
3047
|
+
key: "".concat(j, "_lower"),
|
|
3068
3048
|
value: B
|
|
3069
3049
|
}), i) {
|
|
3070
3050
|
var L = null;
|
|
3071
3051
|
"number" == typeof V && "number" == typeof B && 0 !== B && (L = ne((V - B) / B, .001)),
|
|
3072
3052
|
t.pushToMain({
|
|
3073
3053
|
index: e,
|
|
3074
|
-
key: "".concat(
|
|
3054
|
+
key: "".concat(j, "_height"),
|
|
3075
3055
|
value: L
|
|
3076
3056
|
});
|
|
3077
3057
|
}
|
|
3078
3058
|
// Process each range property.
|
|
3079
|
-
var H, U =
|
|
3059
|
+
var H, U = xe(a);
|
|
3080
3060
|
try {
|
|
3081
3061
|
for (U.s(); !(H = U.n()).done; ) {
|
|
3082
|
-
var
|
|
3083
|
-
"number" == typeof $ && "number" == typeof V && "number" == typeof B && V - B != 0 && (
|
|
3084
|
-
u && (
|
|
3062
|
+
var q = H.value, z = null, $ = f[q][e];
|
|
3063
|
+
"number" == typeof $ && "number" == typeof V && "number" == typeof B && V - B != 0 && (z = c ? Math.max(Math.min(($ - B) / (V - B), 1), 0) : ($ - B) / (V - B),
|
|
3064
|
+
u && (z = ne(z, u))), t.pushToMain({
|
|
3085
3065
|
index: e,
|
|
3086
|
-
key: "".concat(
|
|
3087
|
-
value:
|
|
3066
|
+
key: "".concat(j, "_range_").concat(q),
|
|
3067
|
+
value: z
|
|
3088
3068
|
});
|
|
3089
3069
|
}
|
|
3090
3070
|
} catch (t) {
|
|
@@ -3095,30 +3075,30 @@ var OHLCV_INDICATORS;
|
|
|
3095
3075
|
return !0;
|
|
3096
3076
|
},
|
|
3097
3077
|
bollingerBands: function(t, e, r, n, o) {
|
|
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),
|
|
3078
|
+
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), _ = "".concat(r, "_").concat(n).concat(S);
|
|
3099
3079
|
// Initialization on the first call.
|
|
3100
3080
|
if (0 === e) {
|
|
3101
|
-
var
|
|
3081
|
+
var j = t.priceBased, P = t.inputParams, A = t.nullArray, E = t.verticalOhlcv;
|
|
3102
3082
|
if (!(v in E)) throw new Error('bollingerBands could not find target "'.concat(v, '"'));
|
|
3103
3083
|
var M = P.filter((function(t) {
|
|
3104
3084
|
return "bollingerBands" === t.key;
|
|
3105
3085
|
})).length;
|
|
3106
|
-
f = M > 1 ? "bollinger_bands_".concat(
|
|
3086
|
+
f = M > 1 ? "bollinger_bands_".concat(_) : "bollinger_bands".concat(S),
|
|
3107
3087
|
// Only create the container if it doesn't already exist.
|
|
3108
3088
|
w.bollinger_bands || (w.bollinger_bands = {
|
|
3109
3089
|
numberOfIndicators: M,
|
|
3110
3090
|
settings: {}
|
|
3111
3091
|
}),
|
|
3112
3092
|
// Add (or override) the indicator instance keyed by indicatorKey.
|
|
3113
|
-
w.bollinger_bands.settings[
|
|
3093
|
+
w.bollinger_bands.settings[_] = new _t(r, n);
|
|
3114
3094
|
var x = [ "".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower") ];
|
|
3115
3095
|
h && x.push("".concat(f, "_height"));
|
|
3116
3096
|
// Set up additional arrays for each range property.
|
|
3117
|
-
var k, T =
|
|
3097
|
+
var k, T = Ve(p);
|
|
3118
3098
|
try {
|
|
3119
3099
|
for (T.s(); !(k = T.n()).done; ) {
|
|
3120
3100
|
var I = k.value;
|
|
3121
|
-
if (!(I in E) || !
|
|
3101
|
+
if (!(I in E) || !j.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(j)));
|
|
3122
3102
|
x.push("".concat(f, "_range_").concat(I)), m && t.autoMinMaxKeys.push("".concat(f, "_range_").concat(I));
|
|
3123
3103
|
}
|
|
3124
3104
|
} catch (t) {
|
|
@@ -3127,23 +3107,23 @@ var OHLCV_INDICATORS;
|
|
|
3127
3107
|
T.f();
|
|
3128
3108
|
}
|
|
3129
3109
|
var C = Object.fromEntries(x.map((function(t) {
|
|
3130
|
-
return [ t,
|
|
3110
|
+
return [ t, De(A) ];
|
|
3131
3111
|
})));
|
|
3132
3112
|
Object.assign(E, function(t) {
|
|
3133
3113
|
for (var e = 1; e < arguments.length; e++) {
|
|
3134
3114
|
var r = null != arguments[e] ? arguments[e] : {};
|
|
3135
|
-
e % 2 ?
|
|
3136
|
-
|
|
3137
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
|
3115
|
+
e % 2 ? Ce(Object(r), !0).forEach((function(e) {
|
|
3116
|
+
Re(t, e, r[e]);
|
|
3117
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : Ce(Object(r)).forEach((function(e) {
|
|
3138
3118
|
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
3139
3119
|
}));
|
|
3140
3120
|
}
|
|
3141
3121
|
return t;
|
|
3142
|
-
}({}, C)), d > 0 && t.lag(x, d),
|
|
3122
|
+
}({}, C)), d > 0 && t.lag(x, d), j.push("".concat(f, "_upper"), "".concat(f, "_middle"), "".concat(f, "_lower"));
|
|
3143
3123
|
}
|
|
3144
3124
|
// Derive prefix for subsequent calls if not set.
|
|
3145
|
-
f || (f = w.bollinger_bands.numberOfIndicators > 1 ? "bollinger_bands_".concat(
|
|
3146
|
-
var R = f, D = w.bollinger_bands.settings[
|
|
3125
|
+
f || (f = w.bollinger_bands.numberOfIndicators > 1 ? "bollinger_bands_".concat(_) : "bollinger_bands".concat(S));
|
|
3126
|
+
var R = f, D = w.bollinger_bands.settings[_], V = g[v][e];
|
|
3147
3127
|
// Update the indicator with the current value.
|
|
3148
3128
|
D.update(V, O);
|
|
3149
3129
|
// Attempt to retrieve the result.
|
|
@@ -3180,10 +3160,10 @@ var OHLCV_INDICATORS;
|
|
|
3180
3160
|
});
|
|
3181
3161
|
}
|
|
3182
3162
|
// Process each range property.
|
|
3183
|
-
var
|
|
3163
|
+
var q, z = Ve(p);
|
|
3184
3164
|
try {
|
|
3185
|
-
for (
|
|
3186
|
-
var $ =
|
|
3165
|
+
for (z.s(); !(q = z.n()).done; ) {
|
|
3166
|
+
var $ = q.value, F = null, K = g[$][e];
|
|
3187
3167
|
"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),
|
|
3188
3168
|
b && (F = ne(F, b))), t.pushToMain({
|
|
3189
3169
|
index: e,
|
|
@@ -3192,9 +3172,9 @@ var OHLCV_INDICATORS;
|
|
|
3192
3172
|
});
|
|
3193
3173
|
}
|
|
3194
3174
|
} catch (t) {
|
|
3195
|
-
|
|
3175
|
+
z.e(t);
|
|
3196
3176
|
} finally {
|
|
3197
|
-
|
|
3177
|
+
z.f();
|
|
3198
3178
|
}
|
|
3199
3179
|
return !0;
|
|
3200
3180
|
},
|
|
@@ -3207,7 +3187,7 @@ var OHLCV_INDICATORS;
|
|
|
3207
3187
|
fastEMA: new Dt(r),
|
|
3208
3188
|
slowEMA: new Dt(n)
|
|
3209
3189
|
}
|
|
3210
|
-
}), a[s] =
|
|
3190
|
+
}), a[s] = Le(h), f.push({
|
|
3211
3191
|
fast: s,
|
|
3212
3192
|
slow: 0,
|
|
3213
3193
|
isDefault: !0
|
|
@@ -3238,11 +3218,11 @@ var OHLCV_INDICATORS;
|
|
|
3238
3218
|
var o = n.patternSize, i = n.lag, a = n.autoMinMax, u = t.verticalOhlcv, l = t.instances, c = t.lastIndexReplace;
|
|
3239
3219
|
if (0 === e) {
|
|
3240
3220
|
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++) {
|
|
3241
|
-
var b, d =
|
|
3221
|
+
var b, d = Ge(h);
|
|
3242
3222
|
try {
|
|
3243
3223
|
for (d.s(); !(b = d.n()).done; ) {
|
|
3244
|
-
var m =
|
|
3245
|
-
y.push("candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)), p["candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)] =
|
|
3224
|
+
var m = Ke(b.value, 2), g = m[0], w = m[1];
|
|
3225
|
+
y.push("candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)), p["candle_change_".concat(v + 1, "_").concat(g, "_").concat(w)] = Fe(s),
|
|
3246
3226
|
a && t.autoMinMaxKeys.push("candle_change_".concat(v + 1, "_").concat(g, "_").concat(w));
|
|
3247
3227
|
}
|
|
3248
3228
|
} catch (t) {
|
|
@@ -3251,38 +3231,38 @@ var OHLCV_INDICATORS;
|
|
|
3251
3231
|
d.f();
|
|
3252
3232
|
}
|
|
3253
3233
|
}
|
|
3254
|
-
for (var O = [], S = {},
|
|
3255
|
-
var P =
|
|
3256
|
-
O.push("candle_body_".concat(A, "_").concat(E)), S["candle_body_".concat(A, "_").concat(E)] =
|
|
3234
|
+
for (var O = [], S = {}, _ = 0, j = f; _ < j.length; _++) {
|
|
3235
|
+
var P = Ke(j[_], 2), A = P[0], E = P[1];
|
|
3236
|
+
O.push("candle_body_".concat(A, "_").concat(E)), S["candle_body_".concat(A, "_").concat(E)] = Fe(s),
|
|
3257
3237
|
a && t.autoMinMaxKeys.push("candle_body_".concat(A, "_").concat(E));
|
|
3258
3238
|
}
|
|
3259
3239
|
var M = [].concat(O, y);
|
|
3260
|
-
Object.assign(u,
|
|
3240
|
+
Object.assign(u, ze(ze({}, S), p)), Object.assign(l, {
|
|
3261
3241
|
candleVectors: {
|
|
3262
3242
|
bodyVectors: f,
|
|
3263
3243
|
lookBackVectors: h,
|
|
3264
3244
|
keyNames: M,
|
|
3265
|
-
arrayChunk:
|
|
3245
|
+
arrayChunk: ze({}, Object.fromEntries(M.map((function(t) {
|
|
3266
3246
|
return [ t, [] ];
|
|
3267
3247
|
}))))
|
|
3268
3248
|
}
|
|
3269
3249
|
}), i > 0 && t.lag(M, i);
|
|
3270
3250
|
}
|
|
3271
3251
|
for (var x = l.candleVectors, k = x.bodyVectors, T = x.lookBackVectors, I = x.arrayChunk, C = 0; C < k.length; C++) {
|
|
3272
|
-
var R =
|
|
3252
|
+
var R = Ke(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 = Ye(B, N), U = se(I, L, r, H, c);
|
|
3273
3253
|
t.pushToMain({
|
|
3274
3254
|
index: e,
|
|
3275
3255
|
key: L,
|
|
3276
3256
|
value: U
|
|
3277
3257
|
});
|
|
3278
3258
|
}
|
|
3279
|
-
for (var
|
|
3280
|
-
var
|
|
3259
|
+
for (var q = 0; q < o; q++) {
|
|
3260
|
+
var z, $ = Ge(T);
|
|
3281
3261
|
try {
|
|
3282
|
-
for ($.s(); !(
|
|
3283
|
-
var F =
|
|
3262
|
+
for ($.s(); !(z = $.n()).done; ) {
|
|
3263
|
+
var F = Ke(z.value, 2), K = F[0], G = F[1], J = u[K][e], W = u[G][e - (q + 1)], Y = "candle_change_".concat(q + 1, "_").concat(K, "_").concat(G);
|
|
3284
3264
|
if (void 0 !== W) {
|
|
3285
|
-
var Q =
|
|
3265
|
+
var Q = Ye(J, W), X = se(I, Y, r, Q, c);
|
|
3286
3266
|
t.pushToMain({
|
|
3287
3267
|
index: e,
|
|
3288
3268
|
key: Y,
|
|
@@ -3302,7 +3282,7 @@ var OHLCV_INDICATORS;
|
|
|
3302
3282
|
}
|
|
3303
3283
|
return !0;
|
|
3304
3284
|
}
|
|
3305
|
-
},
|
|
3285
|
+
}, Er = function(t, e, r) {
|
|
3306
3286
|
var n = function(t) {
|
|
3307
3287
|
return r > 1 ? t * r : t;
|
|
3308
3288
|
};
|
|
@@ -3313,9 +3293,9 @@ var OHLCV_INDICATORS;
|
|
|
3313
3293
|
}
|
|
3314
3294
|
return 0;
|
|
3315
3295
|
// Optionally: throw an error if type is not recognized
|
|
3316
|
-
},
|
|
3296
|
+
}, Mr = function(t, e) {
|
|
3317
3297
|
return "number" === e ? t : "string" === e ? Number(oe(t)) : 0;
|
|
3318
|
-
},
|
|
3298
|
+
}, xr = function(t, e) {
|
|
3319
3299
|
var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, o = e.len, i = e.inputParams, a = e.hasVolume;
|
|
3320
3300
|
//do not move nullArray from here
|
|
3321
3301
|
e.nullArray = new Array(o).fill(null);
|
|
@@ -3346,14 +3326,14 @@ var OHLCV_INDICATORS;
|
|
|
3346
3326
|
i.f();
|
|
3347
3327
|
}
|
|
3348
3328
|
}(e), u.forEach((function(t) {
|
|
3349
|
-
e.verticalOhlcv[t] =
|
|
3329
|
+
e.verticalOhlcv[t] = Sr(e.nullArray);
|
|
3350
3330
|
}));
|
|
3351
3331
|
// Identify any additional keys from the first input row and initialize them
|
|
3352
3332
|
var c = Object.keys(t[0]).filter((function(t) {
|
|
3353
3333
|
return !l.has(t);
|
|
3354
3334
|
}));
|
|
3355
3335
|
c.forEach((function(t) {
|
|
3356
|
-
e.verticalOhlcv[t] =
|
|
3336
|
+
e.verticalOhlcv[t] = Sr(e.nullArray);
|
|
3357
3337
|
})), e.otherKeys = c,
|
|
3358
3338
|
// Set the input types once using the first row
|
|
3359
3339
|
function(t, e) {
|
|
@@ -3380,12 +3360,12 @@ var OHLCV_INDICATORS;
|
|
|
3380
3360
|
var e = t.key, r = t.params;
|
|
3381
3361
|
return {
|
|
3382
3362
|
key: e,
|
|
3383
|
-
fn:
|
|
3363
|
+
fn: Ar[e],
|
|
3384
3364
|
args: r
|
|
3385
3365
|
};
|
|
3386
3366
|
})) : [];
|
|
3387
3367
|
}(i), f = n; f < o; f++) {
|
|
3388
|
-
var h = t[f], y = h.open, p = h.high, v = h.low, b = h.close, d =
|
|
3368
|
+
var h = t[f], y = h.open, p = h.high, v = h.low, b = h.close, d = Or(h, gr), m = e.precisionMultiplier, g = Er(y, e.inputTypes.open, m), w = Er(p, e.inputTypes.high, m), O = Er(v, e.inputTypes.low, m), S = Er(b, e.inputTypes.close, m);
|
|
3389
3369
|
// Destructure the base keys and use the rest for other properties
|
|
3390
3370
|
//sets volume to 0
|
|
3391
3371
|
if (e.pushToMain({
|
|
@@ -3405,15 +3385,15 @@ var OHLCV_INDICATORS;
|
|
|
3405
3385
|
key: "close",
|
|
3406
3386
|
value: S
|
|
3407
3387
|
}), a) {
|
|
3408
|
-
var
|
|
3388
|
+
var _ = h.volume, j = Mr(_, e.inputTypes.volume);
|
|
3409
3389
|
e.pushToMain({
|
|
3410
3390
|
index: f,
|
|
3411
3391
|
key: "volume",
|
|
3412
|
-
value:
|
|
3392
|
+
value: j
|
|
3413
3393
|
});
|
|
3414
3394
|
} else delete d.volume;
|
|
3415
3395
|
// Populate any extra keys identified during initialization
|
|
3416
|
-
var P, A =
|
|
3396
|
+
var P, A = wr(e.otherKeys);
|
|
3417
3397
|
try {
|
|
3418
3398
|
for (A.s(); !(P = A.n()).done; ) {
|
|
3419
3399
|
var E = P.value;
|
|
@@ -3429,11 +3409,11 @@ var OHLCV_INDICATORS;
|
|
|
3429
3409
|
} finally {
|
|
3430
3410
|
A.f();
|
|
3431
3411
|
}
|
|
3432
|
-
var M, x =
|
|
3412
|
+
var M, x = wr(s);
|
|
3433
3413
|
try {
|
|
3434
3414
|
for (x.s(); !(M = x.n()).done; ) {
|
|
3435
3415
|
var k = M.value, T = k.key, I = k.fn, C = k.args;
|
|
3436
|
-
[ "crossPairs", "lag" ].includes(T) || I.apply(void 0, [ e, f ].concat(
|
|
3416
|
+
[ "crossPairs", "lag" ].includes(T) || I.apply(void 0, [ e, f ].concat(Sr(C)));
|
|
3437
3417
|
}
|
|
3438
3418
|
// Process these indicators separately (ensuring their execution order)
|
|
3439
3419
|
} catch (t) {
|
|
@@ -3441,9 +3421,9 @@ var OHLCV_INDICATORS;
|
|
|
3441
3421
|
} finally {
|
|
3442
3422
|
x.f();
|
|
3443
3423
|
}
|
|
3444
|
-
|
|
3424
|
+
nr(e, f), yr(e, f), e.lastComputedIndex++;
|
|
3445
3425
|
}
|
|
3446
|
-
},
|
|
3426
|
+
}, kr = function(t, e) {
|
|
3447
3427
|
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]),
|
|
3448
3428
|
n.isStable) {
|
|
3449
3429
|
var c = n.getResult();
|
|
@@ -3453,10 +3433,10 @@ var OHLCV_INDICATORS;
|
|
|
3453
3433
|
return o.map((function(t) {
|
|
3454
3434
|
return null !== t ? (t - s) / h : null;
|
|
3455
3435
|
}));
|
|
3456
|
-
},
|
|
3436
|
+
}, Tr = function(t, e) {
|
|
3457
3437
|
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 5;
|
|
3458
3438
|
if (t.length !== e.length) throw new Error("Both arrays must have the same length");
|
|
3459
|
-
for (var n =
|
|
3439
|
+
for (var n = kr(t, r), o = kr(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++) {
|
|
3460
3440
|
if (null !== n[p] && null !== o[p]) {
|
|
3461
3441
|
y = p;
|
|
3462
3442
|
break;
|
|
@@ -3480,23 +3460,23 @@ var OHLCV_INDICATORS;
|
|
|
3480
3460
|
};
|
|
3481
3461
|
// Processes the inputParams into a list of indicator calls
|
|
3482
3462
|
// ./index.js
|
|
3483
|
-
function
|
|
3463
|
+
function Ir(t) {
|
|
3484
3464
|
return function(t) {
|
|
3485
|
-
if (Array.isArray(t)) return
|
|
3465
|
+
if (Array.isArray(t)) return Vr(t);
|
|
3486
3466
|
}(t) || function(t) {
|
|
3487
3467
|
if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t);
|
|
3488
|
-
}(t) ||
|
|
3468
|
+
}(t) || Dr(t) || function() {
|
|
3489
3469
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3490
3470
|
}();
|
|
3491
3471
|
}
|
|
3492
|
-
function
|
|
3493
|
-
return
|
|
3472
|
+
function Cr(t) {
|
|
3473
|
+
return Cr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
|
|
3494
3474
|
return typeof t;
|
|
3495
3475
|
} : function(t) {
|
|
3496
3476
|
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
3497
|
-
},
|
|
3477
|
+
}, Cr(t);
|
|
3498
3478
|
}
|
|
3499
|
-
function
|
|
3479
|
+
function Rr(t, e) {
|
|
3500
3480
|
return function(t) {
|
|
3501
3481
|
if (Array.isArray(t)) return t;
|
|
3502
3482
|
}(t) || function(t, e) {
|
|
@@ -3519,36 +3499,36 @@ var OHLCV_INDICATORS;
|
|
|
3519
3499
|
}
|
|
3520
3500
|
return u;
|
|
3521
3501
|
}
|
|
3522
|
-
}(t, e) ||
|
|
3502
|
+
}(t, e) || Dr(t, e) || function() {
|
|
3523
3503
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3524
3504
|
}();
|
|
3525
3505
|
}
|
|
3526
|
-
function
|
|
3506
|
+
function Dr(t, e) {
|
|
3527
3507
|
if (t) {
|
|
3528
|
-
if ("string" == typeof t) return
|
|
3508
|
+
if ("string" == typeof t) return Vr(t, e);
|
|
3529
3509
|
var r = {}.toString.call(t).slice(8, -1);
|
|
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) ?
|
|
3510
|
+
return "Object" === r && t.constructor && (r = t.constructor.name), "Map" === r || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Vr(t, e) : void 0;
|
|
3531
3511
|
}
|
|
3532
3512
|
}
|
|
3533
|
-
function
|
|
3513
|
+
function Vr(t, e) {
|
|
3534
3514
|
(null == e || e > t.length) && (e = t.length);
|
|
3535
3515
|
for (var r = 0, n = Array(e); r < e; r++) n[r] = t[r];
|
|
3536
3516
|
return n;
|
|
3537
3517
|
}
|
|
3538
|
-
function
|
|
3518
|
+
function Br(t, e) {
|
|
3539
3519
|
for (var r = 0; r < e.length; r++) {
|
|
3540
3520
|
var n = e[r];
|
|
3541
3521
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
3542
|
-
Object.defineProperty(t,
|
|
3522
|
+
Object.defineProperty(t, Nr(n.key), n);
|
|
3543
3523
|
}
|
|
3544
3524
|
}
|
|
3545
|
-
function
|
|
3525
|
+
function Nr(t) {
|
|
3546
3526
|
var e = function(t, e) {
|
|
3547
|
-
if ("object" !=
|
|
3527
|
+
if ("object" != Cr(t) || !t) return t;
|
|
3548
3528
|
var r = t[Symbol.toPrimitive];
|
|
3549
3529
|
if (void 0 !== r) {
|
|
3550
3530
|
var n = r.call(t, e || "default");
|
|
3551
|
-
if ("object" !=
|
|
3531
|
+
if ("object" != Cr(n)) return n;
|
|
3552
3532
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3553
3533
|
}
|
|
3554
3534
|
return ("string" === e ? String : Number)(t);
|
|
@@ -3561,9 +3541,9 @@ var OHLCV_INDICATORS;
|
|
|
3561
3541
|
* to parallel compute various technical indicators in 1 single loop.
|
|
3562
3542
|
* OHLCV datasets.
|
|
3563
3543
|
*/ (t, "string");
|
|
3564
|
-
return "symbol" ==
|
|
3544
|
+
return "symbol" == Cr(e) ? e : e + "";
|
|
3565
3545
|
}
|
|
3566
|
-
var
|
|
3546
|
+
var Lr = [ .001, .002, .0025, .005, .01, .02, .025, .05, .1, .2, .25, .5, 1, 2, 2.5, 5, 10 ], Hr = function() {
|
|
3567
3547
|
return t = function t(e) {
|
|
3568
3548
|
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;
|
|
3569
3549
|
if (function(t, e) {
|
|
@@ -3586,7 +3566,7 @@ var OHLCV_INDICATORS;
|
|
|
3586
3566
|
}, this.priceBased = [ "open", "high", "low", "close" ], this.len = n.length, this.lastIndexReplace = !1,
|
|
3587
3567
|
this.instances = {}, this.crossPairsList = [], this.verticalOhlcv = {}, this.studies = {},
|
|
3588
3568
|
this.utilities = {
|
|
3589
|
-
correlation:
|
|
3569
|
+
correlation: Tr
|
|
3590
3570
|
}, this.invalidValueIndex = -1, this.precision = u, this.precisionMultiplier = !0 === this.precision ? 0 : 1,
|
|
3591
3571
|
this.autoMinMaxKeys = [], this.minMaxRanges = {}, Array.isArray(c) && (this.inputParams = c,
|
|
3592
3572
|
this.compute()), this.inputParams = [], this.pushToMain = function(t) {
|
|
@@ -3638,7 +3618,7 @@ var OHLCV_INDICATORS;
|
|
|
3638
3618
|
var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
|
|
3639
3619
|
this.compute();
|
|
3640
3620
|
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++) {
|
|
3641
|
-
var h =
|
|
3621
|
+
var h = Rr(f[s], 2), y = h[0], p = h[1], v = l ? p.slice(-c) : p;
|
|
3642
3622
|
// If slicing is needed, create a sliced copy, otherwise re-use the array.
|
|
3643
3623
|
// If this key is price based and precision is enabled, map over the array.
|
|
3644
3624
|
r && a.includes(y) && (v = v.map((function(t) {
|
|
@@ -3700,7 +3680,7 @@ var OHLCV_INDICATORS;
|
|
|
3700
3680
|
//compute method can be used to process indicators if no arguments are provided
|
|
3701
3681
|
//compute method can be called to access the .verticalOhlcv object
|
|
3702
3682
|
//compute method is called automatically if getLastValues or getDate methods are called
|
|
3703
|
-
this.len > this.lastComputedIndex && !t &&
|
|
3683
|
+
this.len > this.lastComputedIndex && !t && xr(this.input, this, 0), t && "object" === Cr(t)) {
|
|
3704
3684
|
var e;
|
|
3705
3685
|
if (![ "open", "high", "low", "close", "volume", "date" ].every((function(e) {
|
|
3706
3686
|
return Object.keys(t).includes(e);
|
|
@@ -3711,16 +3691,16 @@ var OHLCV_INDICATORS;
|
|
|
3711
3691
|
//fallback if .compute(change) is triggered before .compute() alone
|
|
3712
3692
|
0 === this.lastComputedIndex && this.compute(), i !== r ? (
|
|
3713
3693
|
// Add new item
|
|
3714
|
-
this.len++, this.input.push(t),
|
|
3694
|
+
this.len++, this.input.push(t), xr(this.input, this, this.len)) : (
|
|
3715
3695
|
// Modify the last item
|
|
3716
|
-
this.input[n] = t,
|
|
3696
|
+
this.input[n] = t, xr(this.input, this, n));
|
|
3717
3697
|
}
|
|
3718
3698
|
return this;
|
|
3719
3699
|
}
|
|
3720
3700
|
}, {
|
|
3721
3701
|
key: "crossPairs",
|
|
3722
3702
|
value: function(t) {
|
|
3723
|
-
return i(this), this.crossPairsList = [].concat(
|
|
3703
|
+
return i(this), this.crossPairsList = [].concat(Ir(this.crossPairsList), Ir(t)),
|
|
3724
3704
|
this.inputParams.push({
|
|
3725
3705
|
key: "crossPairs",
|
|
3726
3706
|
params: [ this.crossPairsList ]
|
|
@@ -3751,7 +3731,7 @@ var OHLCV_INDICATORS;
|
|
|
3751
3731
|
if (!1 === this.hasVolume) throw new Error('If "relativeVolume" is called the input ohlcv must contain valid volume properties.');
|
|
3752
3732
|
i(this);
|
|
3753
3733
|
var r = e.scale, n = void 0 === r ? null : r;
|
|
3754
|
-
if ("number" == typeof n && !
|
|
3734
|
+
if ("number" == typeof n && !Lr.includes(n)) throw new Error('"scale" value in relativeVolume must be any of the following numbers: '.concat(Lr.join(", ")));
|
|
3755
3735
|
return this.inputParams.push({
|
|
3756
3736
|
key: "relativeVolume",
|
|
3757
3737
|
params: [ t, {
|
|
@@ -3764,7 +3744,7 @@ var OHLCV_INDICATORS;
|
|
|
3764
3744
|
value: function(t) {
|
|
3765
3745
|
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
3766
3746
|
i(this);
|
|
3767
|
-
var r =
|
|
3747
|
+
var r = de("ema", t, e, Lr);
|
|
3768
3748
|
return this.inputParams.push({
|
|
3769
3749
|
key: "movingAverages",
|
|
3770
3750
|
params: [ "ema", t, r ]
|
|
@@ -3775,7 +3755,7 @@ var OHLCV_INDICATORS;
|
|
|
3775
3755
|
value: function(t) {
|
|
3776
3756
|
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
3777
3757
|
i(this);
|
|
3778
|
-
var r =
|
|
3758
|
+
var r = de("sma", t, e, Lr);
|
|
3779
3759
|
return this.inputParams.push({
|
|
3780
3760
|
key: "movingAverages",
|
|
3781
3761
|
params: [ "sma", t, r ]
|
|
@@ -3788,7 +3768,7 @@ var OHLCV_INDICATORS;
|
|
|
3788
3768
|
if (i(this), "number" != typeof t || t <= 0) throw new Error('"fast" must be a positive number in macd.');
|
|
3789
3769
|
if ("number" != typeof e || e <= t) throw new Error('"slow" must be a positive number greater than "fast" in macd.');
|
|
3790
3770
|
if ("number" != typeof r || r <= 0) throw new Error('"signal" must be a positive number in macd.');
|
|
3791
|
-
if ("object" !==
|
|
3771
|
+
if ("object" !== Cr(n)) throw new Error('"options" must be an object in macd. eg: {target}');
|
|
3792
3772
|
var o = n.target, a = void 0 === o ? "close" : o;
|
|
3793
3773
|
return this.inputParams.push({
|
|
3794
3774
|
key: "macd",
|
|
@@ -3801,7 +3781,7 @@ var OHLCV_INDICATORS;
|
|
|
3801
3781
|
key: "bollingerBands",
|
|
3802
3782
|
value: function() {
|
|
3803
3783
|
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] : {};
|
|
3804
|
-
if (i(this), !r || "object" !==
|
|
3784
|
+
if (i(this), !r || "object" !== Cr(r)) throw new Error('"options" must be an object in bollingerBands. eg: {target, height, range}');
|
|
3805
3785
|
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;
|
|
3806
3786
|
// Validate size and times
|
|
3807
3787
|
if ("number" != typeof t || t <= 0) throw new Error('"size" must be a positive number in bollingerBands.');
|
|
@@ -3810,7 +3790,7 @@ var OHLCV_INDICATORS;
|
|
|
3810
3790
|
if ("number" != typeof y) throw new Error('"lag" value must be a number in bollingerBands.');
|
|
3811
3791
|
if ("boolean" != typeof v) throw new Error('"autoMinMax" value in rsi must be a number in bollingerBands.');
|
|
3812
3792
|
if ("boolean" != typeof u) throw new Error('"height" must be a boolean in bollingerBands.');
|
|
3813
|
-
if ("number" == typeof f && !
|
|
3793
|
+
if ("number" == typeof f && !Lr.includes(f)) throw new Error('"scale" value in bollingerBands must be any of the following numbers: '.concat(Lr.join(", ")));
|
|
3814
3794
|
return this.inputParams.push({
|
|
3815
3795
|
key: "bollingerBands",
|
|
3816
3796
|
params: [ t, e, {
|
|
@@ -3830,7 +3810,7 @@ var OHLCV_INDICATORS;
|
|
|
3830
3810
|
// Validate size and times
|
|
3831
3811
|
if (i(this), "number" != typeof t || t <= 0) throw new Error('"size" must be a positive number in rsi.');
|
|
3832
3812
|
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;
|
|
3833
|
-
if ("number" == typeof n && !
|
|
3813
|
+
if ("number" == typeof n && !Lr.includes(n)) throw new Error('"scale" value in rsi must be any of the following numbers: '.concat(Lr.join(", ")));
|
|
3834
3814
|
if ("number" != typeof l) throw new Error('"lag" value in rsi must be a number in rsi.');
|
|
3835
3815
|
if ("boolean" != typeof s) throw new Error('"autoMinMax" value in rsi must be a number in rsi.');
|
|
3836
3816
|
return this.inputParams.push({
|
|
@@ -3854,7 +3834,7 @@ var OHLCV_INDICATORS;
|
|
|
3854
3834
|
if ("number" != typeof f) throw new Error('"lag" value in rsi must be a number in donchianChannels.');
|
|
3855
3835
|
if ("boolean" != typeof y) throw new Error('"autoMinMax" value in rsi must be a number in donchianChannels.');
|
|
3856
3836
|
if ("boolean" != typeof o) throw new Error('"height" must be a boolean in donchianChannels.');
|
|
3857
|
-
if ("number" == typeof c && !
|
|
3837
|
+
if ("number" == typeof c && !Lr.includes(c)) throw new Error('"scale" value in donchianChannels must be any of the following numbers: '.concat(Lr.join(", ")));
|
|
3858
3838
|
return this.inputParams.push({
|
|
3859
3839
|
key: "donchianChannels",
|
|
3860
3840
|
params: [ t, e, {
|
|
@@ -3873,7 +3853,7 @@ var OHLCV_INDICATORS;
|
|
|
3873
3853
|
if (i(this), "number" != typeof t || t <= 0) throw new Error('"size" must be a positive number greater than 0 in candleVectors.');
|
|
3874
3854
|
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;
|
|
3875
3855
|
if ("number" != typeof n || n <= 0) throw new Error('"stdDev" must be a positive number greater than 0 in candleVectors.');
|
|
3876
|
-
if ("number" == typeof l && !
|
|
3856
|
+
if ("number" == typeof l && !Lr.includes(l)) throw new Error('"scale" value in candleVectors must be any of the following numbers: '.concat(Lr.join(", ")));
|
|
3877
3857
|
if ("number" != typeof s || !Number.isInteger(s) || s < 0) throw new Error('"patternSize" value in candleVectors must be a positive integer.');
|
|
3878
3858
|
if ("boolean" != typeof h) throw new Error('"autoMinMax" value in candleVectors must be boolean');
|
|
3879
3859
|
return this.inputParams.push({
|
|
@@ -3895,7 +3875,7 @@ var OHLCV_INDICATORS;
|
|
|
3895
3875
|
if (i(this), "number" != typeof t || t <= 1) throw new Error('fastSize" must be a positive number greater than 1 in volumeOscillator.');
|
|
3896
3876
|
if ("number" != typeof e || e <= t) throw new Error('"slowSize" must be a positive number greater than the "fastSize" in volumeOscillator.');
|
|
3897
3877
|
var n = r.scale, o = void 0 === n ? null : n;
|
|
3898
|
-
if ("number" == typeof o && !
|
|
3878
|
+
if ("number" == typeof o && !Lr.includes(o)) throw new Error('"scale" value in volumeOscillator must be any of the following numbers: '.concat(Lr.join(", ")));
|
|
3899
3879
|
return this.inputParams.push({
|
|
3900
3880
|
key: "volumeOscillator",
|
|
3901
3881
|
params: [ t, e, {
|
|
@@ -3919,7 +3899,7 @@ var OHLCV_INDICATORS;
|
|
|
3919
3899
|
params: []
|
|
3920
3900
|
}), this;
|
|
3921
3901
|
}
|
|
3922
|
-
} ], e &&
|
|
3902
|
+
} ], e && Br(t.prototype, e), r && Br(t, r), Object.defineProperty(t, "prototype", {
|
|
3923
3903
|
writable: !1
|
|
3924
3904
|
}), t;
|
|
3925
3905
|
var t, e, r;
|