@guihz/trading-vue-editor-tes 0.1.27 → 0.1.28
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.
@@ -3182,7 +3182,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
3182
3182
|
for (typeof $ == "string" && ($ = [$]), K = 0; K < $.length; K++)
|
3183
3183
|
Z = $[K].split("|"), i0 = S(Z[0]), w0 = S(Z[1]), i[i0] = w0, o[i0] = Z[0], i[w0] = i0, o[w0] = Z[1];
|
3184
3184
|
}
|
3185
|
-
function
|
3185
|
+
function o0($) {
|
3186
3186
|
var K, Z, i0, w0;
|
3187
3187
|
if (!(!$ || !$.length))
|
3188
3188
|
for (K = 0; K < $.length; K++)
|
@@ -3207,7 +3207,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
3207
3207
|
}) : Z;
|
3208
3208
|
}
|
3209
3209
|
function r0($) {
|
3210
|
-
k($.zones), G($.links),
|
3210
|
+
k($.zones), G($.links), o0($.countries), f0.dataVersion = $.version;
|
3211
3211
|
}
|
3212
3212
|
function k0($) {
|
3213
3213
|
return k0.didShowError || (k0.didShowError = !0, B0("moment.tz.zoneExists('" + $ + "') has been deprecated in favor of !moment.tz.zone('" + $ + "')")), !!X($);
|
@@ -4255,7 +4255,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
4255
4255
|
hc.exports;
|
4256
4256
|
(function(n, e) {
|
4257
4257
|
(function() {
|
4258
|
-
var t, r = "4.17.21", i = 200, s = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", o = "Expected a function", a = "Invalid `variable` option passed into `_.template`", c = "__lodash_hash_undefined__", p = 500, b = "__lodash_placeholder__", M = 1, l = 2, u = 4, O = 1, d = 2, _ = 1, f = 2, A = 4, q = 8, g = 16, W = 32, v = 64, y = 128, L = 256, D = 512, N = 30, w = "...", x = 800, T = 16, S = 1, k = 2, X = 3, Y = 1 / 0, V = 9007199254740991, G = 17976931348623157e292,
|
4258
|
+
var t, r = "4.17.21", i = 200, s = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", o = "Expected a function", a = "Invalid `variable` option passed into `_.template`", c = "__lodash_hash_undefined__", p = 500, b = "__lodash_placeholder__", M = 1, l = 2, u = 4, O = 1, d = 2, _ = 1, f = 2, A = 4, q = 8, g = 16, W = 32, v = 64, y = 128, L = 256, D = 512, N = 30, w = "...", x = 800, T = 16, S = 1, k = 2, X = 3, Y = 1 / 0, V = 9007199254740991, G = 17976931348623157e292, o0 = NaN, d0 = 4294967295, p0 = d0 - 1, r0 = d0 >>> 1, k0 = [
|
4259
4259
|
["ary", y],
|
4260
4260
|
["bind", _],
|
4261
4261
|
["bindKey", f],
|
@@ -4265,7 +4265,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
4265
4265
|
["partial", W],
|
4266
4266
|
["partialRight", v],
|
4267
4267
|
["rearg", L]
|
4268
|
-
], F0 = "[object Arguments]", B0 = "[object Array]", f0 = "[object AsyncFunction]", s1 = "[object Boolean]", e1 = "[object Date]", n1 = "[object DOMException]", V0 = "[object Error]", x0 = "[object Function]", $ = "[object GeneratorFunction]", K = "[object Map]", Z = "[object Number]", i0 = "[object Null]", w0 = "[object Object]", a1 = "[object Promise]", P1 = "[object Proxy]", O1 = "[object RegExp]", m1 = "[object Set]", ri = "[object String]", I = "[object Symbol]", j = "[object Undefined]", Q = "[object WeakMap]",
|
4268
|
+
], F0 = "[object Arguments]", B0 = "[object Array]", f0 = "[object AsyncFunction]", s1 = "[object Boolean]", e1 = "[object Date]", n1 = "[object DOMException]", V0 = "[object Error]", x0 = "[object Function]", $ = "[object GeneratorFunction]", K = "[object Map]", Z = "[object Number]", i0 = "[object Null]", w0 = "[object Object]", a1 = "[object Promise]", P1 = "[object Proxy]", O1 = "[object RegExp]", m1 = "[object Set]", ri = "[object String]", I = "[object Symbol]", j = "[object Undefined]", Q = "[object WeakMap]", c0 = "[object WeakSet]", M0 = "[object ArrayBuffer]", a0 = "[object DataView]", A0 = "[object Float32Array]", u0 = "[object Float64Array]", q0 = "[object Int8Array]", z0 = "[object Int16Array]", x1 = "[object Int32Array]", F1 = "[object Uint8Array]", ze = "[object Uint8ClampedArray]", ke = "[object Uint16Array]", xe = "[object Uint32Array]", xt = /\b__p \+= '';/g, Ct = /\b(__p \+=) '' \+/g, Si = /(__e\(.*?\)|\b__t\)) \+\n'';/g, _s = /&(?:amp|lt|gt|quot|#39);/g, Bo = /[&<>"']/g, h2 = RegExp(_s.source), _2 = RegExp(Bo.source), A2 = /<%-([\s\S]+?)%>/g, q2 = /<%([\s\S]+?)%>/g, xo = /<%=([\s\S]+?)%>/g, m2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, g2 = /^\w*$/, W2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, kn = /[\\^$.*+?()[\]{}|]/g, v2 = RegExp(kn.source), Pn = /^\s+/, y2 = /\s/, R2 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, N2 = /\{\n\/\* \[wrapped with (.+)\] \*/, L2 = /,? & /, w2 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, D2 = /[()=,{}\[\]\/\s]/, B2 = /\\(\\)?/g, x2 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Co = /\w*$/, C2 = /^[-+]0x[0-9a-f]+$/i, E2 = /^0b[01]+$/i, T2 = /^\[object .+?Constructor\]$/, X2 = /^0o[0-7]+$/i, I2 = /^(?:0|[1-9]\d*)$/, $2 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ks = /($^)/, As = /['\n\r\u2028\u2029\\]/g, N1 = "\\ud800-\\udfff", Ze = "\\u0300-\\u036f", F2 = "\\ufe20-\\ufe2f", Gs = "\\u20d0-\\u20ff", ki = Ze + F2 + Gs, Eo = "\\u2700-\\u27bf", XM = "a-z\\xdf-\\xf6\\xf8-\\xff", lh = "\\xac\\xb1\\xd7\\xf7", zh = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", uh = "\\u2000-\\u206f", Oh = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", IM = "A-Z\\xc0-\\xd6\\xd8-\\xde", $M = "\\ufe0e\\ufe0f", FM = lh + zh + uh + Oh, S2 = "['’]", dh = "[" + N1 + "]", SM = "[" + FM + "]", To = "[" + ki + "]", kM = "\\d+", fh = "[" + Eo + "]", PM = "[" + XM + "]", HM = "[^" + N1 + FM + kM + Eo + XM + IM + "]", k2 = "\\ud83c[\\udffb-\\udfff]", hh = "(?:" + To + "|" + k2 + ")", UM = "[^" + N1 + "]", P2 = "(?:\\ud83c[\\udde6-\\uddff]){2}", H2 = "[\\ud800-\\udbff][\\udc00-\\udfff]", Qs = "[" + IM + "]", jM = "\\u200d", VM = "(?:" + PM + "|" + HM + ")", _h = "(?:" + Qs + "|" + HM + ")", YM = "(?:" + S2 + "(?:d|ll|m|re|s|t|ve))?", KM = "(?:" + S2 + "(?:D|LL|M|RE|S|T|VE))?", GM = hh + "?", QM = "[" + $M + "]?", Ah = "(?:" + jM + "(?:" + [UM, P2, H2].join("|") + ")" + QM + GM + ")*", qh = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", mh = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", JM = QM + GM + Ah, gh = "(?:" + [fh, P2, H2].join("|") + ")" + JM, Wh = "(?:" + [UM + To + "?", To, P2, H2, dh].join("|") + ")", vh = RegExp(S2, "g"), yh = RegExp(To, "g"), U2 = RegExp(k2 + "(?=" + k2 + ")|" + Wh + JM, "g"), Rh = RegExp([
|
4269
4269
|
Qs + "?" + PM + "+" + YM + "(?=" + [SM, Qs, "$"].join("|") + ")",
|
4270
4270
|
_h + "+" + KM + "(?=" + [SM, Qs + VM, "$"].join("|") + ")",
|
4271
4271
|
Qs + "?" + VM + "+" + YM,
|
@@ -4306,9 +4306,9 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
4306
4306
|
"parseInt",
|
4307
4307
|
"setTimeout"
|
4308
4308
|
], Dh = -1, se = {};
|
4309
|
-
se[A0] = se[u0] = se[q0] = se[z0] = se[x1] = se[F1] = se[ze] = se[ke] = se[xe] = !0, se[F0] = se[B0] = se[M0] = se[s1] = se[
|
4309
|
+
se[A0] = se[u0] = se[q0] = se[z0] = se[x1] = se[F1] = se[ze] = se[ke] = se[xe] = !0, se[F0] = se[B0] = se[M0] = se[s1] = se[a0] = se[e1] = se[V0] = se[x0] = se[K] = se[Z] = se[w0] = se[O1] = se[m1] = se[ri] = se[Q] = !1;
|
4310
4310
|
var Z1 = {};
|
4311
|
-
Z1[F0] = Z1[B0] = Z1[M0] = Z1[
|
4311
|
+
Z1[F0] = Z1[B0] = Z1[M0] = Z1[a0] = Z1[s1] = Z1[e1] = Z1[A0] = Z1[u0] = Z1[q0] = Z1[z0] = Z1[x1] = Z1[K] = Z1[Z] = Z1[w0] = Z1[O1] = Z1[m1] = Z1[ri] = Z1[I] = Z1[F1] = Z1[ze] = Z1[ke] = Z1[xe] = !0, Z1[V0] = Z1[x0] = Z1[Q] = !1;
|
4312
4312
|
var Bh = {
|
4313
4313
|
// Latin-1 Supplement block.
|
4314
4314
|
À: "A",
|
@@ -4643,7 +4643,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
4643
4643
|
}
|
4644
4644
|
function bl(H, t0) {
|
4645
4645
|
var J = H == null ? 0 : H.length;
|
4646
|
-
return J ? Z2(H, t0) / J :
|
4646
|
+
return J ? Z2(H, t0) / J : o0;
|
4647
4647
|
}
|
4648
4648
|
function Q2(H) {
|
4649
4649
|
return function(t0) {
|
@@ -5593,7 +5593,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
5593
5593
|
return E;
|
5594
5594
|
}
|
5595
5595
|
function jl(z) {
|
5596
|
-
return typeof z == "number" ? z : It(z) ?
|
5596
|
+
return typeof z == "number" ? z : It(z) ? o0 : +z;
|
5597
5597
|
}
|
5598
5598
|
function Xt(z) {
|
5599
5599
|
if (typeof z == "string")
|
@@ -6101,7 +6101,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
6101
6101
|
}
|
6102
6102
|
function FA(z, h, m, R, B, E, F) {
|
6103
6103
|
switch (m) {
|
6104
|
-
case
|
6104
|
+
case a0:
|
6105
6105
|
if (z.byteLength != h.byteLength || z.byteOffset != h.byteOffset)
|
6106
6106
|
return !1;
|
6107
6107
|
z = z.buffer, h = h.buffer;
|
@@ -6227,12 +6227,12 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
6227
6227
|
Hi(h, Dp(z)), z = jo(z);
|
6228
6228
|
return h;
|
6229
6229
|
} : Kp, tt = at;
|
6230
|
-
(np && tt(new np(new ArrayBuffer(1))) !=
|
6230
|
+
(np && tt(new np(new ArrayBuffer(1))) != a0 || jn && tt(new jn()) != K || op && tt(op.resolve()) != a1 || sn && tt(new sn()) != m1 || Vn && tt(new Vn()) != Q) && (tt = function(z) {
|
6231
6231
|
var h = at(z), m = h == w0 ? z.constructor : t, R = m ? Ns(m) : "";
|
6232
6232
|
if (R)
|
6233
6233
|
switch (R) {
|
6234
6234
|
case W_:
|
6235
|
-
return
|
6235
|
+
return a0;
|
6236
6236
|
case v_:
|
6237
6237
|
return K;
|
6238
6238
|
case y_:
|
@@ -6293,7 +6293,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
6293
6293
|
case s1:
|
6294
6294
|
case e1:
|
6295
6295
|
return new R(+z);
|
6296
|
-
case
|
6296
|
+
case a0:
|
6297
6297
|
return LA(z, m);
|
6298
6298
|
case A0:
|
6299
6299
|
case u0:
|
@@ -7249,7 +7249,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
7249
7249
|
return me(z) && tt(z) == Q;
|
7250
7250
|
}
|
7251
7251
|
function Am(z) {
|
7252
|
-
return me(z) && at(z) ==
|
7252
|
+
return me(z) && at(z) == c0;
|
7253
7253
|
}
|
7254
7254
|
var qm = ba(Op), mm = ba(function(z, h) {
|
7255
7255
|
return z <= h;
|
@@ -7284,7 +7284,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
7284
7284
|
if (typeof z == "number")
|
7285
7285
|
return z;
|
7286
7286
|
if (It(z))
|
7287
|
-
return
|
7287
|
+
return o0;
|
7288
7288
|
if (fe(z)) {
|
7289
7289
|
var h = typeof z.valueOf == "function" ? z.valueOf() : z;
|
7290
7290
|
z = fe(h) ? h + "" : h;
|
@@ -7293,7 +7293,7 @@ Arguments: ` + Array.prototype.slice.call(r).join("") + `
|
|
7293
7293
|
return z === 0 ? z : +z;
|
7294
7294
|
z = ll(z);
|
7295
7295
|
var m = E2.test(z);
|
7296
|
-
return m || X2.test(z) ? Xh(z.slice(2), m ? 2 : 8) : C2.test(z) ?
|
7296
|
+
return m || X2.test(z) ? Xh(z.slice(2), m ? 2 : 8) : C2.test(z) ? o0 : +z;
|
7297
7297
|
}
|
7298
7298
|
function Yz(z) {
|
7299
7299
|
return Sr(z, qt(z));
|
@@ -8191,13 +8191,13 @@ function print() { __p += __j.call(arguments, '') }
|
|
8191
8191
|
hold_profit_short_k_count: Y = 0,
|
8192
8192
|
hold_loss_long_k_count: V = 0,
|
8193
8193
|
hold_loss_short_k_count: G = 0,
|
8194
|
-
balanceByInterval:
|
8194
|
+
balanceByInterval: o0,
|
8195
8195
|
shapeRatioType: d0 = "NONE"
|
8196
8196
|
} = this._preHistoryOrderCalcResult;
|
8197
8197
|
const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
|
8198
|
-
if (f0 === Y0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !
|
8198
|
+
if (f0 === Y0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
|
8199
8199
|
const i0 = this._createBalanceByInterval(s1, Date.now());
|
8200
|
-
|
8200
|
+
o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
|
8201
8201
|
}
|
8202
8202
|
const x0 = i + s;
|
8203
8203
|
this._closedtrades = x0;
|
@@ -8242,11 +8242,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
8242
8242
|
hold_profit_short_k_count: Y,
|
8243
8243
|
hold_loss_long_k_count: V,
|
8244
8244
|
hold_loss_short_k_count: G,
|
8245
|
-
balanceByInterval:
|
8245
|
+
balanceByInterval: o0,
|
8246
8246
|
shapeRatioType: d0
|
8247
8247
|
}, d0 !== "NONE") {
|
8248
8248
|
const i0 = d0 === "D" ? p3 : Gc;
|
8249
|
-
|
8249
|
+
o0[i0(e1)] = $ + n1;
|
8250
8250
|
}
|
8251
8251
|
} else if (this._options?.commission_value) {
|
8252
8252
|
const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
|
@@ -9752,10 +9752,10 @@ Example:
|
|
9752
9752
|
if (j)
|
9753
9753
|
return j;
|
9754
9754
|
let Q = 'Unknown type "' + I + '"';
|
9755
|
-
const
|
9755
|
+
const c0 = I.toLowerCase();
|
9756
9756
|
let M0;
|
9757
9757
|
for (M0 of i)
|
9758
|
-
if (M0.toLowerCase() ===
|
9758
|
+
if (M0.toLowerCase() === c0) {
|
9759
9759
|
Q += '. Did you mean "' + M0 + '" ?';
|
9760
9760
|
break;
|
9761
9761
|
}
|
@@ -9763,26 +9763,26 @@ Example:
|
|
9763
9763
|
}
|
9764
9764
|
function c(I) {
|
9765
9765
|
let j = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "any";
|
9766
|
-
const Q = j ? a(j).index : i.length,
|
9767
|
-
for (let
|
9768
|
-
if (!I[
|
9766
|
+
const Q = j ? a(j).index : i.length, c0 = [];
|
9767
|
+
for (let a0 = 0; a0 < I.length; ++a0) {
|
9768
|
+
if (!I[a0] || typeof I[a0].name != "string" || typeof I[a0].test != "function")
|
9769
9769
|
throw new TypeError("Object with properties {name: string, test: function} expected");
|
9770
|
-
const A0 = I[
|
9770
|
+
const A0 = I[a0].name;
|
9771
9771
|
if (r.has(A0))
|
9772
9772
|
throw new TypeError('Duplicate type name "' + A0 + '"');
|
9773
|
-
|
9773
|
+
c0.push(A0), r.set(A0, {
|
9774
9774
|
name: A0,
|
9775
|
-
test: I[
|
9776
|
-
isAny: I[
|
9777
|
-
index: Q +
|
9775
|
+
test: I[a0].test,
|
9776
|
+
isAny: I[a0].isAny,
|
9777
|
+
index: Q + a0,
|
9778
9778
|
conversionsTo: []
|
9779
9779
|
// Newly added type can't have any conversions to it
|
9780
9780
|
});
|
9781
9781
|
}
|
9782
9782
|
const M0 = i.slice(Q);
|
9783
|
-
i = i.slice(0, Q).concat(
|
9784
|
-
for (let
|
9785
|
-
r.get(i[
|
9783
|
+
i = i.slice(0, Q).concat(c0).concat(M0);
|
9784
|
+
for (let a0 = Q + c0.length; a0 < i.length; ++a0)
|
9785
|
+
r.get(i[a0]).index = a0;
|
9786
9786
|
}
|
9787
9787
|
function p() {
|
9788
9788
|
r = /* @__PURE__ */ new Map(), i = [], s = 0, c([t], !1);
|
@@ -9796,8 +9796,8 @@ Example:
|
|
9796
9796
|
}
|
9797
9797
|
function M(I) {
|
9798
9798
|
const j = i.filter((Q) => {
|
9799
|
-
const
|
9800
|
-
return !
|
9799
|
+
const c0 = r.get(Q);
|
9800
|
+
return !c0.isAny && c0.test(I);
|
9801
9801
|
});
|
9802
9802
|
return j.length ? j : ["any"];
|
9803
9803
|
}
|
@@ -9807,15 +9807,15 @@ Example:
|
|
9807
9807
|
function u(I, j, Q) {
|
9808
9808
|
if (!l(I))
|
9809
9809
|
throw new TypeError(qu);
|
9810
|
-
const
|
9811
|
-
if (!
|
9810
|
+
const c0 = Q && Q.exact, M0 = Array.isArray(j) ? j.join(",") : j, a0 = g(M0), A0 = _(a0);
|
9811
|
+
if (!c0 || A0 in I.signatures) {
|
9812
9812
|
const x1 = I._typedFunctionData.signatureMap.get(A0);
|
9813
9813
|
if (x1)
|
9814
9814
|
return x1;
|
9815
9815
|
}
|
9816
|
-
const u0 =
|
9816
|
+
const u0 = a0.length;
|
9817
9817
|
let q0;
|
9818
|
-
if (
|
9818
|
+
if (c0) {
|
9819
9819
|
q0 = [];
|
9820
9820
|
let x1;
|
9821
9821
|
for (x1 in I.signatures)
|
@@ -9823,7 +9823,7 @@ Example:
|
|
9823
9823
|
} else
|
9824
9824
|
q0 = I._typedFunctionData.signatures;
|
9825
9825
|
for (let x1 = 0; x1 < u0; ++x1) {
|
9826
|
-
const F1 =
|
9826
|
+
const F1 = a0[x1], ze = [];
|
9827
9827
|
let ke;
|
9828
9828
|
for (ke of q0) {
|
9829
9829
|
const xe = L(ke.params, x1);
|
@@ -9843,7 +9843,7 @@ Example:
|
|
9843
9843
|
for (z0 of q0)
|
9844
9844
|
if (z0.params.length <= u0)
|
9845
9845
|
return z0;
|
9846
|
-
throw new TypeError("Signature not found (signature: " + (I.name || "unnamed") + "(" + _(
|
9846
|
+
throw new TypeError("Signature not found (signature: " + (I.name || "unnamed") + "(" + _(a0, ", ") + "))");
|
9847
9847
|
}
|
9848
9848
|
function O(I, j, Q) {
|
9849
9849
|
return u(I, j, Q).implementation;
|
@@ -9852,12 +9852,12 @@ Example:
|
|
9852
9852
|
const Q = a(j);
|
9853
9853
|
if (Q.test(I))
|
9854
9854
|
return I;
|
9855
|
-
const
|
9856
|
-
if (
|
9855
|
+
const c0 = Q.conversionsTo;
|
9856
|
+
if (c0.length === 0)
|
9857
9857
|
throw new Error("There are no conversions to " + j + " defined.");
|
9858
|
-
for (let M0 = 0; M0 <
|
9859
|
-
if (a(
|
9860
|
-
return
|
9858
|
+
for (let M0 = 0; M0 < c0.length; M0++)
|
9859
|
+
if (a(c0[M0].from).test(I))
|
9860
|
+
return c0[M0].convert(I);
|
9861
9861
|
throw new Error("Cannot convert " + I + " to " + j);
|
9862
9862
|
}
|
9863
9863
|
function _(I) {
|
@@ -9865,11 +9865,11 @@ Example:
|
|
9865
9865
|
return I.map((Q) => Q.name).join(j);
|
9866
9866
|
}
|
9867
9867
|
function f(I) {
|
9868
|
-
const j = I.indexOf("...") === 0,
|
9869
|
-
let M0 = !1,
|
9868
|
+
const j = I.indexOf("...") === 0, c0 = (j ? I.length > 3 ? I.slice(3) : "any" : I).split("|").map((u0) => a(u0.trim()));
|
9869
|
+
let M0 = !1, a0 = j ? "..." : "";
|
9870
9870
|
return {
|
9871
|
-
types:
|
9872
|
-
return M0 = u0.isAny || M0,
|
9871
|
+
types: c0.map(function(u0) {
|
9872
|
+
return M0 = u0.isAny || M0, a0 += u0.name + "|", {
|
9873
9873
|
name: u0.name,
|
9874
9874
|
typeIndex: u0.index,
|
9875
9875
|
test: u0.test,
|
@@ -9878,7 +9878,7 @@ Example:
|
|
9878
9878
|
conversionIndex: -1
|
9879
9879
|
};
|
9880
9880
|
}),
|
9881
|
-
name:
|
9881
|
+
name: a0.slice(0, -1),
|
9882
9882
|
// remove trailing '|' from above
|
9883
9883
|
hasAny: M0,
|
9884
9884
|
hasConversion: !1,
|
@@ -9887,10 +9887,10 @@ Example:
|
|
9887
9887
|
}
|
9888
9888
|
function A(I) {
|
9889
9889
|
const j = I.types.map((A0) => A0.name), Q = Y(j);
|
9890
|
-
let
|
9891
|
-
const
|
9890
|
+
let c0 = I.hasAny, M0 = I.name;
|
9891
|
+
const a0 = Q.map(function(A0) {
|
9892
9892
|
const u0 = a(A0.from);
|
9893
|
-
return
|
9893
|
+
return c0 = u0.isAny || c0, M0 += "|" + A0.from, {
|
9894
9894
|
name: A0.from,
|
9895
9895
|
typeIndex: u0.index,
|
9896
9896
|
test: u0.test,
|
@@ -9900,10 +9900,10 @@ Example:
|
|
9900
9900
|
};
|
9901
9901
|
});
|
9902
9902
|
return {
|
9903
|
-
types: I.types.concat(
|
9903
|
+
types: I.types.concat(a0),
|
9904
9904
|
name: M0,
|
9905
|
-
hasAny:
|
9906
|
-
hasConversion:
|
9905
|
+
hasAny: c0,
|
9906
|
+
hasConversion: a0.length > 0,
|
9907
9907
|
restParam: I.restParam
|
9908
9908
|
};
|
9909
9909
|
}
|
@@ -9917,14 +9917,14 @@ Example:
|
|
9917
9917
|
const Q = I.trim();
|
9918
9918
|
if (Q === "")
|
9919
9919
|
return j;
|
9920
|
-
const
|
9921
|
-
for (let M0 = 0; M0 <
|
9922
|
-
const
|
9923
|
-
if (
|
9924
|
-
throw new SyntaxError('Unexpected rest parameter "' +
|
9925
|
-
if (
|
9920
|
+
const c0 = Q.split(",");
|
9921
|
+
for (let M0 = 0; M0 < c0.length; ++M0) {
|
9922
|
+
const a0 = f(c0[M0].trim());
|
9923
|
+
if (a0.restParam && M0 !== c0.length - 1)
|
9924
|
+
throw new SyntaxError('Unexpected rest parameter "' + c0[M0] + '": only allowed for the last parameter');
|
9925
|
+
if (a0.types.length === 0)
|
9926
9926
|
return null;
|
9927
|
-
j.push(
|
9927
|
+
j.push(a0);
|
9928
9928
|
}
|
9929
9929
|
return j;
|
9930
9930
|
}
|
@@ -9946,21 +9946,21 @@ Example:
|
|
9946
9946
|
const j = I.types.map(function(Q) {
|
9947
9947
|
return a(Q.name).test;
|
9948
9948
|
});
|
9949
|
-
return function(
|
9949
|
+
return function(c0) {
|
9950
9950
|
for (let M0 = 0; M0 < j.length; M0++)
|
9951
|
-
if (j[M0](
|
9951
|
+
if (j[M0](c0))
|
9952
9952
|
return !0;
|
9953
9953
|
return !1;
|
9954
9954
|
};
|
9955
9955
|
}
|
9956
9956
|
}
|
9957
9957
|
function y(I) {
|
9958
|
-
let j, Q,
|
9958
|
+
let j, Q, c0;
|
9959
9959
|
if (W(I)) {
|
9960
9960
|
j = s1(I).map(v);
|
9961
|
-
const M0 = j.length,
|
9961
|
+
const M0 = j.length, a0 = v(e1(I)), A0 = function(u0) {
|
9962
9962
|
for (let q0 = M0; q0 < u0.length; q0++)
|
9963
|
-
if (!
|
9963
|
+
if (!a0(u0[q0]))
|
9964
9964
|
return !1;
|
9965
9965
|
return !0;
|
9966
9966
|
};
|
@@ -9971,17 +9971,17 @@ Example:
|
|
9971
9971
|
return A0(q0) && q0.length >= M0 + 1;
|
9972
9972
|
};
|
9973
9973
|
} else
|
9974
|
-
return I.length === 0 ? function(
|
9975
|
-
return
|
9976
|
-
} : I.length === 1 ? (Q = v(I[0]), function(
|
9977
|
-
return Q(
|
9978
|
-
}) : I.length === 2 ? (Q = v(I[0]),
|
9979
|
-
return Q(
|
9980
|
-
}) : (j = I.map(v), function(
|
9974
|
+
return I.length === 0 ? function(a0) {
|
9975
|
+
return a0.length === 0;
|
9976
|
+
} : I.length === 1 ? (Q = v(I[0]), function(a0) {
|
9977
|
+
return Q(a0[0]) && a0.length === 1;
|
9978
|
+
}) : I.length === 2 ? (Q = v(I[0]), c0 = v(I[1]), function(a0) {
|
9979
|
+
return Q(a0[0]) && c0(a0[1]) && a0.length === 2;
|
9980
|
+
}) : (j = I.map(v), function(a0) {
|
9981
9981
|
for (let A0 = 0; A0 < j.length; A0++)
|
9982
|
-
if (!j[A0](
|
9982
|
+
if (!j[A0](a0[A0]))
|
9983
9983
|
return !1;
|
9984
|
-
return
|
9984
|
+
return a0.length === j.length;
|
9985
9985
|
});
|
9986
9986
|
}
|
9987
9987
|
function L(I, j) {
|
@@ -9996,16 +9996,16 @@ Example:
|
|
9996
9996
|
}
|
9997
9997
|
function w(I, j) {
|
9998
9998
|
const Q = /* @__PURE__ */ new Set();
|
9999
|
-
return I.forEach((
|
10000
|
-
const M0 = D(
|
10001
|
-
let
|
10002
|
-
for (
|
10003
|
-
Q.add(
|
9999
|
+
return I.forEach((c0) => {
|
10000
|
+
const M0 = D(c0.params, j);
|
10001
|
+
let a0;
|
10002
|
+
for (a0 of M0)
|
10003
|
+
Q.add(a0);
|
10004
10004
|
}), Q.has("any") ? ["any"] : Array.from(Q);
|
10005
10005
|
}
|
10006
10006
|
function x(I, j, Q) {
|
10007
|
-
let
|
10008
|
-
const
|
10007
|
+
let c0, M0;
|
10008
|
+
const a0 = I || "unnamed";
|
10009
10009
|
let A0 = Q, u0;
|
10010
10010
|
for (u0 = 0; u0 < j.length; u0++) {
|
10011
10011
|
const F1 = [];
|
@@ -10015,13 +10015,13 @@ Example:
|
|
10015
10015
|
}), F1.length === 0) {
|
10016
10016
|
if (M0 = w(A0, u0), M0.length > 0) {
|
10017
10017
|
const ze = M(j[u0]);
|
10018
|
-
return
|
10018
|
+
return c0 = new TypeError("Unexpected type of argument in function " + a0 + " (expected: " + M0.join(" or ") + ", actual: " + ze.join(" | ") + ", index: " + u0 + ")"), c0.data = {
|
10019
10019
|
category: "wrongType",
|
10020
|
-
fn:
|
10020
|
+
fn: a0,
|
10021
10021
|
index: u0,
|
10022
10022
|
actual: ze,
|
10023
10023
|
expected: M0
|
10024
|
-
},
|
10024
|
+
}, c0;
|
10025
10025
|
}
|
10026
10026
|
} else
|
10027
10027
|
A0 = F1;
|
@@ -10030,27 +10030,27 @@ Example:
|
|
10030
10030
|
return W(F1.params) ? 1 / 0 : F1.params.length;
|
10031
10031
|
});
|
10032
10032
|
if (j.length < Math.min.apply(null, q0))
|
10033
|
-
return M0 = w(A0, u0),
|
10033
|
+
return M0 = w(A0, u0), c0 = new TypeError("Too few arguments in function " + a0 + " (expected: " + M0.join(" or ") + ", index: " + j.length + ")"), c0.data = {
|
10034
10034
|
category: "tooFewArgs",
|
10035
|
-
fn:
|
10035
|
+
fn: a0,
|
10036
10036
|
index: j.length,
|
10037
10037
|
expected: M0
|
10038
|
-
},
|
10038
|
+
}, c0;
|
10039
10039
|
const z0 = Math.max.apply(null, q0);
|
10040
10040
|
if (j.length > z0)
|
10041
|
-
return
|
10041
|
+
return c0 = new TypeError("Too many arguments in function " + a0 + " (expected: " + z0 + ", actual: " + j.length + ")"), c0.data = {
|
10042
10042
|
category: "tooManyArgs",
|
10043
|
-
fn:
|
10043
|
+
fn: a0,
|
10044
10044
|
index: j.length,
|
10045
10045
|
expectedLength: z0
|
10046
|
-
},
|
10046
|
+
}, c0;
|
10047
10047
|
const x1 = [];
|
10048
10048
|
for (let F1 = 0; F1 < j.length; ++F1)
|
10049
10049
|
x1.push(M(j[F1]).join("|"));
|
10050
|
-
return
|
10050
|
+
return c0 = new TypeError('Arguments of type "' + x1.join(", ") + '" do not match any of the defined signatures of function ' + a0 + "."), c0.data = {
|
10051
10051
|
category: "mismatch",
|
10052
10052
|
actual: x1
|
10053
|
-
},
|
10053
|
+
}, c0;
|
10054
10054
|
}
|
10055
10055
|
function T(I) {
|
10056
10056
|
let j = i.length + 1;
|
@@ -10085,28 +10085,28 @@ Example:
|
|
10085
10085
|
return -1;
|
10086
10086
|
if (Q > 0)
|
10087
10087
|
return 1;
|
10088
|
-
const
|
10089
|
-
return
|
10088
|
+
const c0 = S(I) - S(j);
|
10089
|
+
return c0 < 0 ? -1 : c0 > 0 ? 1 : 0;
|
10090
10090
|
}
|
10091
10091
|
function X(I, j) {
|
10092
|
-
const Q = I.params,
|
10092
|
+
const Q = I.params, c0 = j.params, M0 = e1(Q), a0 = e1(c0), A0 = W(Q), u0 = W(c0);
|
10093
10093
|
if (A0 && M0.hasAny) {
|
10094
|
-
if (!u0 || !
|
10094
|
+
if (!u0 || !a0.hasAny)
|
10095
10095
|
return 1;
|
10096
|
-
} else if (u0 &&
|
10096
|
+
} else if (u0 && a0.hasAny)
|
10097
10097
|
return -1;
|
10098
10098
|
let q0 = 0, z0 = 0, x1;
|
10099
10099
|
for (x1 of Q)
|
10100
10100
|
x1.hasAny && ++q0, x1.hasConversion && ++z0;
|
10101
10101
|
let F1 = 0, ze = 0;
|
10102
|
-
for (x1 of
|
10102
|
+
for (x1 of c0)
|
10103
10103
|
x1.hasAny && ++F1, x1.hasConversion && ++ze;
|
10104
10104
|
if (q0 !== F1)
|
10105
10105
|
return q0 - F1;
|
10106
10106
|
if (A0 && M0.hasConversion) {
|
10107
|
-
if (!u0 || !
|
10107
|
+
if (!u0 || !a0.hasConversion)
|
10108
10108
|
return 1;
|
10109
|
-
} else if (u0 &&
|
10109
|
+
} else if (u0 && a0.hasConversion)
|
10110
10110
|
return -1;
|
10111
10111
|
if (z0 !== ze)
|
10112
10112
|
return z0 - ze;
|
@@ -10115,13 +10115,13 @@ Example:
|
|
10115
10115
|
return 1;
|
10116
10116
|
} else if (u0)
|
10117
10117
|
return -1;
|
10118
|
-
const ke = (Q.length -
|
10118
|
+
const ke = (Q.length - c0.length) * (A0 ? -1 : 1);
|
10119
10119
|
if (ke !== 0)
|
10120
10120
|
return ke;
|
10121
10121
|
const xe = [];
|
10122
10122
|
let xt = 0;
|
10123
10123
|
for (let Si = 0; Si < Q.length; ++Si) {
|
10124
|
-
const _s = k(Q[Si],
|
10124
|
+
const _s = k(Q[Si], c0[Si]);
|
10125
10125
|
xe.push(_s), xt += _s;
|
10126
10126
|
}
|
10127
10127
|
if (xt !== 0)
|
@@ -10136,82 +10136,82 @@ Example:
|
|
10136
10136
|
if (I.length === 0)
|
10137
10137
|
return [];
|
10138
10138
|
const j = I.map(a);
|
10139
|
-
I.length > 1 && j.sort((M0,
|
10139
|
+
I.length > 1 && j.sort((M0, a0) => M0.index - a0.index);
|
10140
10140
|
let Q = j[0].conversionsTo;
|
10141
10141
|
if (I.length === 1)
|
10142
10142
|
return Q;
|
10143
10143
|
Q = Q.concat([]);
|
10144
|
-
const
|
10144
|
+
const c0 = new Set(I);
|
10145
10145
|
for (let M0 = 1; M0 < j.length; ++M0) {
|
10146
|
-
let
|
10147
|
-
for (
|
10148
|
-
|
10146
|
+
let a0;
|
10147
|
+
for (a0 of j[M0].conversionsTo)
|
10148
|
+
c0.has(a0.from) || (Q.push(a0), c0.add(a0.from));
|
10149
10149
|
}
|
10150
10150
|
return Q;
|
10151
10151
|
}
|
10152
10152
|
function V(I, j) {
|
10153
10153
|
let Q = j;
|
10154
10154
|
if (I.some((M0) => M0.hasConversion)) {
|
10155
|
-
const M0 = W(I),
|
10155
|
+
const M0 = W(I), a0 = I.map(G);
|
10156
10156
|
Q = function() {
|
10157
10157
|
const u0 = [], q0 = M0 ? arguments.length - 1 : arguments.length;
|
10158
10158
|
for (let z0 = 0; z0 < q0; z0++)
|
10159
|
-
u0[z0] =
|
10160
|
-
return M0 && (u0[q0] = arguments[q0].map(
|
10159
|
+
u0[z0] = a0[z0](arguments[z0]);
|
10160
|
+
return M0 && (u0[q0] = arguments[q0].map(a0[q0])), j.apply(this, u0);
|
10161
10161
|
};
|
10162
10162
|
}
|
10163
|
-
let
|
10163
|
+
let c0 = Q;
|
10164
10164
|
if (W(I)) {
|
10165
10165
|
const M0 = I.length - 1;
|
10166
|
-
|
10166
|
+
c0 = function() {
|
10167
10167
|
return Q.apply(this, n1(arguments, 0, M0).concat([n1(arguments, M0)]));
|
10168
10168
|
};
|
10169
10169
|
}
|
10170
|
-
return
|
10170
|
+
return c0;
|
10171
10171
|
}
|
10172
10172
|
function G(I) {
|
10173
|
-
let j, Q,
|
10174
|
-
const
|
10173
|
+
let j, Q, c0, M0;
|
10174
|
+
const a0 = [], A0 = [];
|
10175
10175
|
switch (I.types.forEach(function(u0) {
|
10176
|
-
u0.conversion && (
|
10176
|
+
u0.conversion && (a0.push(a(u0.conversion.from).test), A0.push(u0.conversion.convert));
|
10177
10177
|
}), A0.length) {
|
10178
10178
|
case 0:
|
10179
10179
|
return function(q0) {
|
10180
10180
|
return q0;
|
10181
10181
|
};
|
10182
10182
|
case 1:
|
10183
|
-
return j =
|
10184
|
-
return j(q0) ?
|
10183
|
+
return j = a0[0], c0 = A0[0], function(q0) {
|
10184
|
+
return j(q0) ? c0(q0) : q0;
|
10185
10185
|
};
|
10186
10186
|
case 2:
|
10187
|
-
return j =
|
10188
|
-
return j(q0) ?
|
10187
|
+
return j = a0[0], Q = a0[1], c0 = A0[0], M0 = A0[1], function(q0) {
|
10188
|
+
return j(q0) ? c0(q0) : Q(q0) ? M0(q0) : q0;
|
10189
10189
|
};
|
10190
10190
|
default:
|
10191
10191
|
return function(q0) {
|
10192
10192
|
for (let z0 = 0; z0 < A0.length; z0++)
|
10193
|
-
if (
|
10193
|
+
if (a0[z0](q0))
|
10194
10194
|
return A0[z0](q0);
|
10195
10195
|
return q0;
|
10196
10196
|
};
|
10197
10197
|
}
|
10198
10198
|
}
|
10199
|
-
function
|
10200
|
-
function j(Q,
|
10201
|
-
if (
|
10202
|
-
const
|
10199
|
+
function o0(I) {
|
10200
|
+
function j(Q, c0, M0) {
|
10201
|
+
if (c0 < Q.length) {
|
10202
|
+
const a0 = Q[c0];
|
10203
10203
|
let A0 = [];
|
10204
|
-
if (
|
10205
|
-
const u0 =
|
10206
|
-
u0.length <
|
10204
|
+
if (a0.restParam) {
|
10205
|
+
const u0 = a0.types.filter(N);
|
10206
|
+
u0.length < a0.types.length && A0.push({
|
10207
10207
|
types: u0,
|
10208
10208
|
name: "..." + u0.map((q0) => q0.name).join("|"),
|
10209
10209
|
hasAny: u0.some((q0) => q0.isAny),
|
10210
10210
|
hasConversion: !1,
|
10211
10211
|
restParam: !0
|
10212
|
-
}), A0.push(
|
10212
|
+
}), A0.push(a0);
|
10213
10213
|
} else
|
10214
|
-
A0 =
|
10214
|
+
A0 = a0.types.map(function(u0) {
|
10215
10215
|
return {
|
10216
10216
|
types: [u0],
|
10217
10217
|
name: u0.name,
|
@@ -10221,7 +10221,7 @@ Example:
|
|
10221
10221
|
};
|
10222
10222
|
});
|
10223
10223
|
return x0(A0, function(u0) {
|
10224
|
-
return j(Q,
|
10224
|
+
return j(Q, c0 + 1, M0.concat([u0]));
|
10225
10225
|
});
|
10226
10226
|
} else
|
10227
10227
|
return [M0];
|
@@ -10241,52 +10241,52 @@ Example:
|
|
10241
10241
|
if (!x1)
|
10242
10242
|
return !1;
|
10243
10243
|
}
|
10244
|
-
const
|
10245
|
-
return
|
10244
|
+
const c0 = I.length, M0 = j.length, a0 = W(I), A0 = W(j);
|
10245
|
+
return a0 ? A0 ? c0 === M0 : M0 >= c0 : A0 ? c0 >= M0 : c0 === M0;
|
10246
10246
|
}
|
10247
10247
|
function p0(I) {
|
10248
10248
|
return I.map((j) => w0(j) ? Z(j.referToSelf.callback) : i0(j) ? K(j.referTo.references, j.referTo.callback) : j);
|
10249
10249
|
}
|
10250
10250
|
function r0(I, j, Q) {
|
10251
|
-
const
|
10251
|
+
const c0 = [];
|
10252
10252
|
let M0;
|
10253
10253
|
for (M0 of I) {
|
10254
|
-
let
|
10255
|
-
if (typeof
|
10254
|
+
let a0 = Q[M0];
|
10255
|
+
if (typeof a0 != "number")
|
10256
10256
|
throw new TypeError('No definition for referenced signature "' + M0 + '"');
|
10257
|
-
if (
|
10257
|
+
if (a0 = j[a0], typeof a0 != "function")
|
10258
10258
|
return !1;
|
10259
|
-
|
10259
|
+
c0.push(a0);
|
10260
10260
|
}
|
10261
|
-
return
|
10261
|
+
return c0;
|
10262
10262
|
}
|
10263
10263
|
function k0(I, j, Q) {
|
10264
|
-
const
|
10265
|
-
let
|
10266
|
-
for (;
|
10267
|
-
|
10264
|
+
const c0 = p0(I), M0 = new Array(c0.length).fill(!1);
|
10265
|
+
let a0 = !0;
|
10266
|
+
for (; a0; ) {
|
10267
|
+
a0 = !1;
|
10268
10268
|
let A0 = !0;
|
10269
|
-
for (let u0 = 0; u0 <
|
10269
|
+
for (let u0 = 0; u0 < c0.length; ++u0) {
|
10270
10270
|
if (M0[u0])
|
10271
10271
|
continue;
|
10272
|
-
const q0 =
|
10272
|
+
const q0 = c0[u0];
|
10273
10273
|
if (w0(q0))
|
10274
|
-
|
10274
|
+
c0[u0] = q0.referToSelf.callback(Q), c0[u0].referToSelf = q0.referToSelf, M0[u0] = !0, A0 = !1;
|
10275
10275
|
else if (i0(q0)) {
|
10276
|
-
const z0 = r0(q0.referTo.references,
|
10277
|
-
z0 ? (
|
10276
|
+
const z0 = r0(q0.referTo.references, c0, j);
|
10277
|
+
z0 ? (c0[u0] = q0.referTo.callback.apply(this, z0), c0[u0].referTo = q0.referTo, M0[u0] = !0, A0 = !1) : a0 = !0;
|
10278
10278
|
}
|
10279
10279
|
}
|
10280
|
-
if (A0 &&
|
10280
|
+
if (A0 && a0)
|
10281
10281
|
throw new SyntaxError("Circular reference detected in resolving typed.referTo");
|
10282
10282
|
}
|
10283
|
-
return
|
10283
|
+
return c0;
|
10284
10284
|
}
|
10285
10285
|
function F0(I) {
|
10286
10286
|
const j = /\bthis(\(|\.signatures\b)/;
|
10287
10287
|
Object.keys(I).forEach((Q) => {
|
10288
|
-
const
|
10289
|
-
if (j.test(
|
10288
|
+
const c0 = I[Q];
|
10289
|
+
if (j.test(c0.toString()))
|
10290
10290
|
throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.");
|
10291
10291
|
});
|
10292
10292
|
}
|
@@ -10294,7 +10294,7 @@ Example:
|
|
10294
10294
|
if (o.createCount++, Object.keys(j).length === 0)
|
10295
10295
|
throw new SyntaxError("No signatures provided");
|
10296
10296
|
o.warnAgainstDeprecatedThis && F0(j);
|
10297
|
-
const Q = [],
|
10297
|
+
const Q = [], c0 = [], M0 = {}, a0 = [];
|
10298
10298
|
let A0;
|
10299
10299
|
for (A0 in j) {
|
10300
10300
|
if (!Object.prototype.hasOwnProperty.call(j, A0))
|
@@ -10306,26 +10306,26 @@ Example:
|
|
10306
10306
|
if (d0(ki, N1))
|
10307
10307
|
throw new TypeError('Conflicting signatures "' + _(ki) + '" and "' + _(N1) + '".');
|
10308
10308
|
}), Q.push(N1);
|
10309
|
-
const Ze =
|
10310
|
-
|
10309
|
+
const Ze = c0.length;
|
10310
|
+
c0.push(j[A0]);
|
10311
10311
|
const F2 = N1.map(A);
|
10312
10312
|
let Gs;
|
10313
|
-
for (Gs of
|
10313
|
+
for (Gs of o0(F2)) {
|
10314
10314
|
const ki = _(Gs);
|
10315
|
-
|
10315
|
+
a0.push({
|
10316
10316
|
params: Gs,
|
10317
10317
|
name: ki,
|
10318
10318
|
fn: Ze
|
10319
10319
|
}), Gs.every((Eo) => !Eo.hasConversion) && (M0[ki] = Ze);
|
10320
10320
|
}
|
10321
10321
|
}
|
10322
|
-
|
10323
|
-
const u0 = k0(
|
10322
|
+
a0.sort(X);
|
10323
|
+
const u0 = k0(c0, M0, As);
|
10324
10324
|
let q0;
|
10325
10325
|
for (q0 in M0)
|
10326
10326
|
Object.prototype.hasOwnProperty.call(M0, q0) && (M0[q0] = u0[M0[q0]]);
|
10327
10327
|
const z0 = [], x1 = /* @__PURE__ */ new Map();
|
10328
|
-
for (q0 of
|
10328
|
+
for (q0 of a0)
|
10329
10329
|
x1.has(q0.name) || (q0.fn = u0[q0.fn], z0.push(q0), x1.set(q0.name, q0));
|
10330
10330
|
const F1 = z0[0] && z0[0].params.length <= 2 && !W(z0[0].params), ze = z0[1] && z0[1].params.length <= 2 && !W(z0[1].params), ke = z0[2] && z0[2].params.length <= 2 && !W(z0[2].params), xe = z0[3] && z0[3].params.length <= 2 && !W(z0[3].params), xt = z0[4] && z0[4].params.length <= 2 && !W(z0[4].params), Ct = z0[5] && z0[5].params.length <= 2 && !W(z0[5].params), Si = F1 && ze && ke && xe && xt && Ct;
|
10331
10331
|
for (let N1 = 0; N1 < z0.length; ++N1)
|
@@ -10425,12 +10425,12 @@ Example:
|
|
10425
10425
|
for (Q in j)
|
10426
10426
|
if (Object.prototype.hasOwnProperty.call(j, Q)) {
|
10427
10427
|
if (Q in I && j[Q] !== I[Q]) {
|
10428
|
-
const
|
10429
|
-
throw
|
10428
|
+
const c0 = new Error('Signature "' + Q + '" is defined twice');
|
10429
|
+
throw c0.data = {
|
10430
10430
|
signature: Q,
|
10431
10431
|
sourceFunction: j[Q],
|
10432
10432
|
destFunction: I[Q]
|
10433
|
-
},
|
10433
|
+
}, c0;
|
10434
10434
|
}
|
10435
10435
|
I[Q] = j[Q];
|
10436
10436
|
}
|
@@ -10438,21 +10438,21 @@ Example:
|
|
10438
10438
|
const m1 = o;
|
10439
10439
|
o = function(I) {
|
10440
10440
|
const j = typeof I == "string", Q = j ? 1 : 0;
|
10441
|
-
let
|
10441
|
+
let c0 = j ? I : "";
|
10442
10442
|
const M0 = {};
|
10443
|
-
for (let
|
10444
|
-
const A0 = arguments[
|
10443
|
+
for (let a0 = Q; a0 < arguments.length; ++a0) {
|
10444
|
+
const A0 = arguments[a0];
|
10445
10445
|
let u0 = {}, q0;
|
10446
10446
|
if (typeof A0 == "function" ? (q0 = A0.name, typeof A0.signature == "string" ? u0[A0.signature] = A0 : l(A0) && (u0 = A0.signatures)) : n(A0) && (u0 = A0, j || (q0 = P1(A0))), Object.keys(u0).length === 0) {
|
10447
|
-
const z0 = new TypeError("Argument to 'typed' at index " +
|
10447
|
+
const z0 = new TypeError("Argument to 'typed' at index " + a0 + " is not a (typed) function, nor an object with signatures as keys and functions as values.");
|
10448
10448
|
throw z0.data = {
|
10449
|
-
index:
|
10449
|
+
index: a0,
|
10450
10450
|
argument: A0
|
10451
10451
|
}, z0;
|
10452
10452
|
}
|
10453
|
-
j || (
|
10453
|
+
j || (c0 = a1(c0, q0)), O1(M0, u0);
|
10454
10454
|
}
|
10455
|
-
return B0(
|
10455
|
+
return B0(c0 || "", M0);
|
10456
10456
|
}, o.create = h3, o.createCount = m1.createCount, o.onMismatch = f0, o.throwMismatchError = f0, o.createError = x, o.clear = p, o.clearConversions = b, o.addTypes = c, o._findType = a, o.referTo = $, o.referToSelf = Z, o.convert = d, o.findSignature = u, o.find = O, o.isTypedFunction = l, o.warnAgainstDeprecatedThis = !0, o.addType = function(I, j) {
|
10457
10457
|
let Q = "any";
|
10458
10458
|
j !== !1 && r.has("Object") && (Q = "Object"), o.addTypes([I], Q);
|
@@ -10485,15 +10485,15 @@ Example:
|
|
10485
10485
|
throw new Error("Attempt to remove nonexistent conversion from " + I.from + " to " + I.to);
|
10486
10486
|
if (Q.convert !== I.convert)
|
10487
10487
|
throw new Error("Conversion to remove does not match existing conversion");
|
10488
|
-
const
|
10489
|
-
j.conversionsTo.splice(
|
10488
|
+
const c0 = j.conversionsTo.indexOf(Q);
|
10489
|
+
j.conversionsTo.splice(c0, 1);
|
10490
10490
|
}, o.resolve = function(I, j) {
|
10491
10491
|
if (!l(I))
|
10492
10492
|
throw new TypeError(qu);
|
10493
10493
|
const Q = I._typedFunctionData.signatures;
|
10494
|
-
for (let
|
10495
|
-
if (Q[
|
10496
|
-
return Q[
|
10494
|
+
for (let c0 = 0; c0 < Q.length; ++c0)
|
10495
|
+
if (Q[c0].test(j))
|
10496
|
+
return Q[c0];
|
10497
10497
|
return null;
|
10498
10498
|
}, o;
|
10499
10499
|
}
|
@@ -14472,8 +14472,8 @@ Example:
|
|
14472
14472
|
for (q = 0, g = d._size.length; q < g; q++)
|
14473
14473
|
_e(y[q], d._size[q]), _e(L[q], d._size[q]);
|
14474
14474
|
var D = d._values, N = d._index, w = d._ptr, x = _.dimension(0), T = _.dimension(1), S = [], k = [];
|
14475
|
-
x.forEach(function(G,
|
14476
|
-
k[G] =
|
14475
|
+
x.forEach(function(G, o0) {
|
14476
|
+
k[G] = o0[0], S[G] = !0;
|
14477
14477
|
});
|
14478
14478
|
var X = D ? [] : void 0, Y = [], V = [];
|
14479
14479
|
return T.forEach(function(G) {
|
@@ -14681,9 +14681,9 @@ Example:
|
|
14681
14681
|
var G = d._index[V];
|
14682
14682
|
Y[G] = d._values[V];
|
14683
14683
|
}
|
14684
|
-
for (var
|
14685
|
-
var d0 =
|
14686
|
-
w(d0,
|
14684
|
+
for (var o0 = _; o0 <= f; o0++) {
|
14685
|
+
var d0 = o0 in Y ? Y[o0] : 0;
|
14686
|
+
w(d0, o0 - _, x - A);
|
14687
14687
|
}
|
14688
14688
|
}
|
14689
14689
|
}
|
@@ -14805,15 +14805,15 @@ Example:
|
|
14805
14805
|
if (he(_)) {
|
14806
14806
|
if (_.length !== N)
|
14807
14807
|
throw new Error("Invalid value array length");
|
14808
|
-
w = function(
|
14809
|
-
return _[
|
14808
|
+
w = function(o0) {
|
14809
|
+
return _[o0];
|
14810
14810
|
};
|
14811
14811
|
} else if (be(_)) {
|
14812
14812
|
var x = _.size();
|
14813
14813
|
if (x.length !== 1 || x[0] !== N)
|
14814
14814
|
throw new Error("Invalid matrix length");
|
14815
|
-
w = function(
|
14816
|
-
return _.get([
|
14815
|
+
w = function(o0) {
|
14816
|
+
return _.get([o0]);
|
14817
14817
|
};
|
14818
14818
|
} else
|
14819
14819
|
w = function() {
|
@@ -15284,9 +15284,9 @@ Example:
|
|
15284
15284
|
if (y)
|
15285
15285
|
for (X = D[k]; X < L.length; ) {
|
15286
15286
|
S = L[X];
|
15287
|
-
var G = x[S],
|
15288
|
-
if (G === V ||
|
15289
|
-
var d0 = G === V ? N[S] : W, p0 =
|
15287
|
+
var G = x[S], o0 = T[S];
|
15288
|
+
if (G === V || o0 === V) {
|
15289
|
+
var d0 = G === V ? N[S] : W, p0 = o0 === V ? w[S] : W, r0 = v(d0, p0);
|
15290
15290
|
g(r0, W) ? L.splice(X, 1) : (y.push(r0), X++);
|
15291
15291
|
}
|
15292
15292
|
}
|
@@ -15434,8 +15434,8 @@ Example:
|
|
15434
15434
|
for (Y = O[k], V = O[k + 1], X = Y; X < V; X++)
|
15435
15435
|
if (S = u[X], x[S] === G) {
|
15436
15436
|
if (N) {
|
15437
|
-
var
|
15438
|
-
g(
|
15437
|
+
var o0 = v(N[S], l[X]);
|
15438
|
+
g(o0, W) ? x[S] = null : N[S] = o0;
|
15439
15439
|
}
|
15440
15440
|
} else
|
15441
15441
|
L.push(S), T[S] = G, w && (w[S] = l[X]);
|
@@ -15556,9 +15556,9 @@ Example:
|
|
15556
15556
|
var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._data, w = v._size, x = v._datatype || v.getDataType(), T = L[0], S = w[1], k, X = r, Y = i;
|
15557
15557
|
D && x && D === x && typeof D == "string" && D !== "mixed" && (k = D, X = e.find(r, [k, k]), Y = e.find(i, [k, k]));
|
15558
15558
|
for (var V = [], G = 0; G < S; G++) {
|
15559
|
-
for (var
|
15560
|
-
|
15561
|
-
V[G] =
|
15559
|
+
for (var o0 = Y(y[0], N[0][G]), d0 = 1; d0 < T; d0++)
|
15560
|
+
o0 = X(o0, Y(y[d0], N[d0][G]));
|
15561
|
+
V[G] = o0;
|
15562
15562
|
}
|
15563
15563
|
return W.createDenseMatrix({
|
15564
15564
|
data: V,
|
@@ -15579,9 +15579,9 @@ Example:
|
|
15579
15579
|
var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._data, w = v._datatype || v.getDataType(), x = L[0], T = L[1], S, k = r, X = i;
|
15580
15580
|
D && w && D === w && typeof D == "string" && D !== "mixed" && (S = D, k = e.find(r, [S, S]), X = e.find(i, [S, S]));
|
15581
15581
|
for (var Y = [], V = 0; V < x; V++) {
|
15582
|
-
for (var G = y[V],
|
15583
|
-
|
15584
|
-
Y[V] =
|
15582
|
+
for (var G = y[V], o0 = X(G[0], N[0]), d0 = 1; d0 < T; d0++)
|
15583
|
+
o0 = k(o0, X(G[d0], N[d0]));
|
15584
|
+
Y[V] = o0;
|
15585
15585
|
}
|
15586
15586
|
return W.createDenseMatrix({
|
15587
15587
|
data: Y,
|
@@ -15592,13 +15592,13 @@ Example:
|
|
15592
15592
|
function _(W, v) {
|
15593
15593
|
var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._data, w = v._size, x = v._datatype || v.getDataType(), T = L[0], S = L[1], k = w[1], X, Y = r, V = i;
|
15594
15594
|
D && x && D === x && typeof D == "string" && D !== "mixed" && D !== "mixed" && (X = D, Y = e.find(r, [X, X]), V = e.find(i, [X, X]));
|
15595
|
-
for (var G = [],
|
15596
|
-
var d0 = y[
|
15597
|
-
G[
|
15595
|
+
for (var G = [], o0 = 0; o0 < T; o0++) {
|
15596
|
+
var d0 = y[o0];
|
15597
|
+
G[o0] = [];
|
15598
15598
|
for (var p0 = 0; p0 < k; p0++) {
|
15599
15599
|
for (var r0 = V(d0[0], N[0][p0]), k0 = 1; k0 < S; k0++)
|
15600
15600
|
r0 = Y(r0, V(d0[k0], N[k0][p0]));
|
15601
|
-
G[
|
15601
|
+
G[o0][p0] = r0;
|
15602
15602
|
}
|
15603
15603
|
}
|
15604
15604
|
return W.createDenseMatrix({
|
@@ -15611,8 +15611,8 @@ Example:
|
|
15611
15611
|
var y = W._data, L = W._size, D = W._datatype || W.getDataType(), N = v._values, w = v._index, x = v._ptr, T = v._size, S = v._datatype || v._data === void 0 ? v._datatype : v.getDataType();
|
15612
15612
|
if (!N)
|
15613
15613
|
throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");
|
15614
|
-
var k = L[0], X = T[1], Y, V = r, G = i,
|
15615
|
-
D && S && D === S && typeof D == "string" && D !== "mixed" && (Y = D, V = e.find(r, [Y, Y]), G = e.find(i, [Y, Y]),
|
15614
|
+
var k = L[0], X = T[1], Y, V = r, G = i, o0 = s, d0 = 0;
|
15615
|
+
D && S && D === S && typeof D == "string" && D !== "mixed" && (Y = D, V = e.find(r, [Y, Y]), G = e.find(i, [Y, Y]), o0 = e.find(s, [Y, Y]), d0 = e.convert(0, Y));
|
15616
15616
|
for (var p0 = [], r0 = [], k0 = [], F0 = v.createSparseMatrix({
|
15617
15617
|
values: p0,
|
15618
15618
|
index: r0,
|
@@ -15628,7 +15628,7 @@ Example:
|
|
15628
15628
|
var K = w[$];
|
15629
15629
|
e1 !== V0 ? (x0 = G(y[n1][K], N[$]), e1 = V0) : x0 = V(x0, G(y[n1][K], N[$]));
|
15630
15630
|
}
|
15631
|
-
e1 === V0 && !
|
15631
|
+
e1 === V0 && !o0(x0, d0) && (r0.push(n1), p0.push(x0));
|
15632
15632
|
}
|
15633
15633
|
}
|
15634
15634
|
return k0[X] = r0.length, F0;
|
@@ -15637,8 +15637,8 @@ Example:
|
|
15637
15637
|
var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType();
|
15638
15638
|
if (!y)
|
15639
15639
|
throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");
|
15640
|
-
var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = [], X = [], Y = [], V, G = r,
|
15641
|
-
N && x && N === x && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]),
|
15640
|
+
var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = [], X = [], Y = [], V, G = r, o0 = i, d0 = s, p0 = 0;
|
15641
|
+
N && x && N === x && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]), o0 = e.find(i, [V, V]), d0 = e.find(s, [V, V]), p0 = e.convert(0, V));
|
15642
15642
|
var r0 = [], k0 = [];
|
15643
15643
|
Y[0] = 0;
|
15644
15644
|
for (var F0 = 0; F0 < S; F0++) {
|
@@ -15646,7 +15646,7 @@ Example:
|
|
15646
15646
|
if (!d0(B0, p0))
|
15647
15647
|
for (var f0 = D[F0], s1 = D[F0 + 1], e1 = f0; e1 < s1; e1++) {
|
15648
15648
|
var n1 = L[e1];
|
15649
|
-
k0[n1] ? r0[n1] = G(r0[n1],
|
15649
|
+
k0[n1] ? r0[n1] = G(r0[n1], o0(B0, y[e1])) : (k0[n1] = !0, X.push(n1), r0[n1] = o0(B0, y[e1]));
|
15650
15650
|
}
|
15651
15651
|
}
|
15652
15652
|
for (var V0 = X.length, x0 = 0; x0 < V0; x0++) {
|
@@ -15665,8 +15665,8 @@ Example:
|
|
15665
15665
|
var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType();
|
15666
15666
|
if (!y)
|
15667
15667
|
throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");
|
15668
|
-
var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = v._size[1], X, Y = r, V = i, G = s,
|
15669
|
-
N && x && N === x && typeof N == "string" && N !== "mixed" && (X = N, Y = e.find(r, [X, X]), V = e.find(i, [X, X]), G = e.find(s, [X, X]),
|
15668
|
+
var w = v._data, x = v._datatype || v.getDataType(), T = W._size[0], S = v._size[0], k = v._size[1], X, Y = r, V = i, G = s, o0 = 0;
|
15669
|
+
N && x && N === x && typeof N == "string" && N !== "mixed" && (X = N, Y = e.find(r, [X, X]), V = e.find(i, [X, X]), G = e.find(s, [X, X]), o0 = e.convert(0, X));
|
15670
15670
|
for (var d0 = [], p0 = [], r0 = [], k0 = W.createSparseMatrix({
|
15671
15671
|
values: d0,
|
15672
15672
|
index: p0,
|
@@ -15677,7 +15677,7 @@ Example:
|
|
15677
15677
|
r0[f0] = p0.length;
|
15678
15678
|
for (var s1 = f0 + 1, e1 = 0; e1 < S; e1++) {
|
15679
15679
|
var n1 = w[e1][f0];
|
15680
|
-
if (!G(n1,
|
15680
|
+
if (!G(n1, o0))
|
15681
15681
|
for (var V0 = D[e1], x0 = D[e1 + 1], $ = V0; $ < x0; $++) {
|
15682
15682
|
var K = L[$];
|
15683
15683
|
B0[K] !== s1 ? (B0[K] = s1, p0.push(K), F0[K] = V(n1, y[$])) : F0[K] = Y(F0[K], V(n1, y[$]));
|
@@ -15691,8 +15691,8 @@ Example:
|
|
15691
15691
|
return r0[k] = p0.length, k0;
|
15692
15692
|
}
|
15693
15693
|
function g(W, v) {
|
15694
|
-
var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType(), w = v._values, x = v._index, T = v._ptr, S = v._datatype || v._data === void 0 ? v._datatype : v.getDataType(), k = W._size[0], X = v._size[1], Y = y && w, V, G = r,
|
15695
|
-
N && S && N === S && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]),
|
15694
|
+
var y = W._values, L = W._index, D = W._ptr, N = W._datatype || W._data === void 0 ? W._datatype : W.getDataType(), w = v._values, x = v._index, T = v._ptr, S = v._datatype || v._data === void 0 ? v._datatype : v.getDataType(), k = W._size[0], X = v._size[1], Y = y && w, V, G = r, o0 = i;
|
15695
|
+
N && S && N === S && typeof N == "string" && N !== "mixed" && (V = N, G = e.find(r, [V, V]), o0 = e.find(i, [V, V]));
|
15696
15696
|
for (var d0 = Y ? [] : void 0, p0 = [], r0 = [], k0 = W.createSparseMatrix({
|
15697
15697
|
values: d0,
|
15698
15698
|
index: p0,
|
@@ -15705,7 +15705,7 @@ Example:
|
|
15705
15705
|
for (V0 = T[Z], x0 = T[Z + 1], n1 = V0; n1 < x0; n1++)
|
15706
15706
|
if (K = x[n1], Y)
|
15707
15707
|
for (s1 = D[K], e1 = D[K + 1], f0 = s1; f0 < e1; f0++)
|
15708
|
-
$ = L[f0], B0[$] !== i0 ? (B0[$] = i0, p0.push($), F0[$] =
|
15708
|
+
$ = L[f0], B0[$] !== i0 ? (B0[$] = i0, p0.push($), F0[$] = o0(w[n1], y[f0])) : F0[$] = G(F0[$], o0(w[n1], y[f0]));
|
15709
15709
|
else
|
15710
15710
|
for (s1 = D[K], e1 = D[K + 1], f0 = s1; f0 < e1; f0++)
|
15711
15711
|
$ = L[f0], B0[$] !== i0 && (B0[$] = i0, p0.push($));
|
@@ -20176,6 +20176,7 @@ ${u}`), u;
|
|
20176
20176
|
_fills;
|
20177
20177
|
strategy;
|
20178
20178
|
_count = 0;
|
20179
|
+
_alertSelects = [];
|
20179
20180
|
constructor(e, t, r) {
|
20180
20181
|
super(t, r), t.buildInTimeframeFunc = this._timeframe, this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.strategy = new eB(this._variables, this._options, e, this._errorListener, r);
|
20181
20182
|
}
|
@@ -20220,7 +20221,7 @@ ${u}`), u;
|
|
20220
20221
|
const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0;
|
20221
20222
|
this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
|
20222
20223
|
const p = this._plots.size > 0 ? [...this._plots.values()] : void 0, b = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, M = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, l = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, u = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, O = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0;
|
20223
|
-
return Object.assign({}, this._options, { inputs: r, plots: p, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b });
|
20224
|
+
return Object.assign({}, this._options, { inputs: r, plots: p, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b, alertSelects: this._alertSelects });
|
20224
20225
|
}
|
20225
20226
|
_getDataOfBarindex(e) {
|
20226
20227
|
const t = this._alerts.size ? [...this._alerts.values()] : void 0;
|
@@ -20395,13 +20396,18 @@ ${u}`), u;
|
|
20395
20396
|
}
|
20396
20397
|
}
|
20397
20398
|
alertcondition({ condition: e, message: t, title: r }, i) {
|
20398
|
-
const {
|
20399
|
-
|
20399
|
+
const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
|
20400
|
+
this._variables.bar_index === 0 && !o && this._alertSelects.push({
|
20401
|
+
id: a,
|
20402
|
+
message: t || "警报已发出!",
|
20403
|
+
title: r || "警报",
|
20404
|
+
type: "alertcondition"
|
20405
|
+
}), !s && e ? this._alerts.set(a, {
|
20400
20406
|
message: t,
|
20401
20407
|
title: r,
|
20402
|
-
id:
|
20408
|
+
id: a,
|
20403
20409
|
type: "alertcondition"
|
20404
|
-
}) : this._alerts.delete(
|
20410
|
+
}) : this._alerts.delete(a);
|
20405
20411
|
}
|
20406
20412
|
barcolor(e, t) {
|
20407
20413
|
this._setColors(e, "barcolor", t);
|
@@ -21095,11 +21101,11 @@ ${u}`), u;
|
|
21095
21101
|
if (G)
|
21096
21102
|
return G;
|
21097
21103
|
S = Object.assign(Y, { barIndex: V || X, lastBarIndex: r[D].barindex || D, lastBarTime: r[D].time, nextBarTime: r[X + 1]?.time }), Lf(f, q, A, g, M, S, N);
|
21098
|
-
const
|
21099
|
-
if (
|
21104
|
+
const o0 = q.errors;
|
21105
|
+
if (o0.length && o0.some((d0) => d0.type === ge.Error))
|
21100
21106
|
return {
|
21101
21107
|
status: 1,
|
21102
|
-
errors: C0.uniqBy(
|
21108
|
+
errors: C0.uniqBy(o0, "startLineNumber")
|
21103
21109
|
};
|
21104
21110
|
}
|
21105
21111
|
if (N?.size) {
|
@@ -21802,13 +21808,13 @@ ${u}`), u;
|
|
21802
21808
|
hold_profit_short_k_count: Y = 0,
|
21803
21809
|
hold_loss_long_k_count: V = 0,
|
21804
21810
|
hold_loss_short_k_count: G = 0,
|
21805
|
-
balanceByInterval:
|
21811
|
+
balanceByInterval: o0,
|
21806
21812
|
shapeRatioType: d0 = "NONE"
|
21807
21813
|
} = this._preHistoryOrderCalcResult;
|
21808
21814
|
const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
|
21809
|
-
if (f0 === f1.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !
|
21815
|
+
if (f0 === f1.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
|
21810
21816
|
const i0 = this._createBalanceByInterval(s1, Date.now());
|
21811
|
-
|
21817
|
+
o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
|
21812
21818
|
}
|
21813
21819
|
const x0 = i + s;
|
21814
21820
|
this._closedtrades = x0;
|
@@ -21853,11 +21859,11 @@ ${u}`), u;
|
|
21853
21859
|
hold_profit_short_k_count: Y,
|
21854
21860
|
hold_loss_long_k_count: V,
|
21855
21861
|
hold_loss_short_k_count: G,
|
21856
|
-
balanceByInterval:
|
21862
|
+
balanceByInterval: o0,
|
21857
21863
|
shapeRatioType: d0
|
21858
21864
|
}, d0 !== "NONE") {
|
21859
21865
|
const i0 = d0 === "D" ? p3 : Gc;
|
21860
|
-
|
21866
|
+
o0[i0(e1)] = $ + n1;
|
21861
21867
|
}
|
21862
21868
|
} else if (this._options?.commission_value) {
|
21863
21869
|
const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
|
@@ -26708,11 +26714,11 @@ ${u}`), u;
|
|
26708
26714
|
return;
|
26709
26715
|
}
|
26710
26716
|
if (X <= N && V > N) {
|
26711
|
-
const
|
26717
|
+
const o0 = v + S;
|
26712
26718
|
return this._reqCacheDataLoc[t] = {
|
26713
|
-
index:
|
26719
|
+
index: o0,
|
26714
26720
|
periodStamp: y
|
26715
|
-
}, { ...k, barIndex: Y ||
|
26721
|
+
}, { ...k, barIndex: Y || o0, nextBarTime: D[S + 1]?.time, ...T };
|
26716
26722
|
}
|
26717
26723
|
}
|
26718
26724
|
else
|
@@ -26933,6 +26939,7 @@ ${u}`), u;
|
|
26933
26939
|
table;
|
26934
26940
|
strategy;
|
26935
26941
|
_count = 0;
|
26942
|
+
_alertSelects = [];
|
26936
26943
|
constructor(e, t, r) {
|
26937
26944
|
super(t, r);
|
26938
26945
|
const i = e.toString().split(".")[1]?.length || 5;
|
@@ -26988,7 +26995,7 @@ ${u}`), u;
|
|
26988
26995
|
const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0;
|
26989
26996
|
this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
|
26990
26997
|
const p = this._plots.size > 0 ? [...this._plots.values()] : void 0, b = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, M = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, l = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, u = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, O = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0, d = this._getDraws();
|
26991
|
-
return Object.assign({}, this._options, { inputs: r, plots: p, draws: d, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b });
|
26998
|
+
return Object.assign({}, this._options, { inputs: r, plots: p, draws: d, alerts: i, colors: o, hlines: a, fills: c, plotshapes: M, plotarrows: l, plotcandles: u, plotchars: O, plotbars: b, alertSelects: this._alertSelects });
|
26992
26999
|
}
|
26993
27000
|
_getDataOfBarindex(e) {
|
26994
27001
|
const t = this._alerts.size ? [...this._alerts.values()] : void 0;
|
@@ -27175,7 +27182,7 @@ ${u}`), u;
|
|
27175
27182
|
}
|
27176
27183
|
}
|
27177
27184
|
alert({ message: e, freq: t = Rr.freqOncePerBar }, r) {
|
27178
|
-
const { bar_index: i,
|
27185
|
+
const { bar_index: i, __isFirstRun: s, _isRealTimeBar: o } = this._variables, a = `alert_${r}`, c = this._cacheData[a] || {}, p = c.barIndex;
|
27179
27186
|
if (this._paramVerfiy(t, r, "alert", [Rr.freqAll, Rr.freqOncePerBar, Rr.freqOncePerBarClose]), t === Rr.freqOncePerBar && i === p) {
|
27180
27187
|
this._alerts.delete(a);
|
27181
27188
|
return;
|
@@ -27187,24 +27194,29 @@ ${u}`), u;
|
|
27187
27194
|
id: a,
|
27188
27195
|
type: "alert"
|
27189
27196
|
};
|
27190
|
-
if (s) {
|
27197
|
+
if (!s) {
|
27191
27198
|
t !== Rr.freqOncePerBarClose && this._alerts.set(a, b), c.barIndex = i;
|
27192
27199
|
return;
|
27193
27200
|
}
|
27194
|
-
if (!
|
27201
|
+
if (!o && t === Rr.freqOncePerBarClose && !s) {
|
27195
27202
|
this._alerts.set(a, b), c.barIndex = i;
|
27196
27203
|
return;
|
27197
27204
|
}
|
27198
27205
|
this._alerts.delete(a);
|
27199
27206
|
}
|
27200
27207
|
alertcondition({ condition: e, message: t, title: r }, i) {
|
27201
|
-
const {
|
27202
|
-
|
27208
|
+
const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
|
27209
|
+
this._variables.bar_index === 0 && !o && this._alertSelects.push({
|
27210
|
+
id: a,
|
27211
|
+
message: t || "警报已发出!",
|
27212
|
+
title: r || "警报",
|
27213
|
+
type: "alertcondition"
|
27214
|
+
}), !s && e ? this._alerts.set(a, {
|
27203
27215
|
message: t,
|
27204
27216
|
title: r,
|
27205
|
-
id:
|
27217
|
+
id: a,
|
27206
27218
|
type: "alertcondition"
|
27207
|
-
}) : this._alerts.delete(
|
27219
|
+
}) : this._alerts.delete(a);
|
27208
27220
|
}
|
27209
27221
|
barcolor(e, t) {
|
27210
27222
|
this._setColors(e, "barcolor", t);
|
@@ -27465,11 +27477,11 @@ ${u}`), u;
|
|
27465
27477
|
if (G)
|
27466
27478
|
return G;
|
27467
27479
|
S = Object.assign(Y, { barIndex: V || X, lastBarIndex: r[D].barindex || D, lastBarTime: r[D].time, nextBarTime: r[X + 1]?.time }), Xf(f, q, A, g, M, S, N);
|
27468
|
-
const
|
27469
|
-
if (
|
27480
|
+
const o0 = q.errors;
|
27481
|
+
if (o0.length && o0.some((d0) => d0.type === k1.Error))
|
27470
27482
|
return {
|
27471
27483
|
status: 1,
|
27472
|
-
errors: C0.uniqBy(
|
27484
|
+
errors: C0.uniqBy(o0, "startLineNumber")
|
27473
27485
|
};
|
27474
27486
|
}
|
27475
27487
|
if (N?.size) {
|
@@ -30675,7 +30687,7 @@ ${Uf}`);
|
|
30675
30687
|
strassen3x3(e) {
|
30676
30688
|
e = m0.checkMatrix(e);
|
30677
30689
|
let t = new m0(3, 3);
|
30678
|
-
const r = this.get(0, 0), i = this.get(0, 1), s = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), c = this.get(1, 2), p = this.get(2, 0), b = this.get(2, 1), M = this.get(2, 2), l = e.get(0, 0), u = e.get(0, 1), O = e.get(0, 2), d = e.get(1, 0), _ = e.get(1, 1), f = e.get(1, 2), A = e.get(2, 0), q = e.get(2, 1), g = e.get(2, 2), W = (r + i + s - o - a - b - M) * _, v = (r - o) * (-u + _), y = a * (-l + u + d - _ - f - A + g), L = (-r + o + a) * (l - u + _), D = (o + a) * (-l + u), N = r * l, w = (-r + p + b) * (l - O + f), x = (-r + p) * (O - f), T = (p + b) * (-l + O), S = (r + i + s - a - c - p - b) * f, k = b * (-l + O + d - _ - f - A + q), X = (-s + b + M) * (_ + A - q), Y = (s - M) * (_ - q), V = s * A, G = (b + M) * (-A + q),
|
30690
|
+
const r = this.get(0, 0), i = this.get(0, 1), s = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), c = this.get(1, 2), p = this.get(2, 0), b = this.get(2, 1), M = this.get(2, 2), l = e.get(0, 0), u = e.get(0, 1), O = e.get(0, 2), d = e.get(1, 0), _ = e.get(1, 1), f = e.get(1, 2), A = e.get(2, 0), q = e.get(2, 1), g = e.get(2, 2), W = (r + i + s - o - a - b - M) * _, v = (r - o) * (-u + _), y = a * (-l + u + d - _ - f - A + g), L = (-r + o + a) * (l - u + _), D = (o + a) * (-l + u), N = r * l, w = (-r + p + b) * (l - O + f), x = (-r + p) * (O - f), T = (p + b) * (-l + O), S = (r + i + s - a - c - p - b) * f, k = b * (-l + O + d - _ - f - A + q), X = (-s + b + M) * (_ + A - q), Y = (s - M) * (_ - q), V = s * A, G = (b + M) * (-A + q), o0 = (-s + a + c) * (f + A - g), d0 = (s - c) * (f - g), p0 = (a + c) * (-A + g), r0 = i * d, k0 = c * q, F0 = o * O, B0 = p * u, f0 = M * g, s1 = N + V + r0, e1 = W + L + D + N + X + V + G, n1 = N + w + T + S + V + o0 + p0, V0 = v + y + L + N + V + o0 + d0, x0 = v + L + D + N + k0, $ = V + o0 + d0 + p0 + F0, K = N + w + x + k + X + Y + V, Z = X + Y + V + G + B0, i0 = N + w + x + T + f0;
|
30679
30691
|
return t.set(0, 0, s1), t.set(0, 1, e1), t.set(0, 2, n1), t.set(1, 0, V0), t.set(1, 1, x0), t.set(1, 2, $), t.set(2, 0, K), t.set(2, 1, Z), t.set(2, 2, i0), t;
|
30680
30692
|
}
|
30681
30693
|
mmulStrassen(e) {
|
@@ -30718,8 +30730,8 @@ ${Uf}`);
|
|
30718
30730
|
X.sub(T), X.add(k);
|
30719
30731
|
let Y = c1.add(w, T), V = c1.add(N, x), G = c1.sub(D, N);
|
30720
30732
|
G.add(w), G.add(S);
|
30721
|
-
let
|
30722
|
-
return
|
30733
|
+
let o0 = c1.zeros(2 * X.rows, 2 * X.columns);
|
30734
|
+
return o0 = o0.setSubMatrix(X, 0, 0), o0 = o0.setSubMatrix(Y, X.rows, 0), o0 = o0.setSubMatrix(V, 0, X.columns), o0 = o0.setSubMatrix(G, X.rows, X.columns), o0.subMatrix(0, u - 1, 0, O - 1);
|
30723
30735
|
}
|
30724
30736
|
return b(t, e, c, p);
|
30725
30737
|
}
|
@@ -31869,9 +31881,9 @@ ${Uf}`);
|
|
31869
31881
|
Math.abs(O[N]),
|
31870
31882
|
Math.abs(f[N])
|
31871
31883
|
), T = O[y - 1] / x, S = O[y - 2] / x, k = f[y - 2] / x, X = O[N] / x, Y = f[N] / x, V = ((S + T) * (S - T) + k * k) / 2, G = T * k * (T * k);
|
31872
|
-
let
|
31873
|
-
(V !== 0 || G !== 0) && (V < 0 ?
|
31874
|
-
let d0 = (X + T) * (X - T) +
|
31884
|
+
let o0 = 0;
|
31885
|
+
(V !== 0 || G !== 0) && (V < 0 ? o0 = 0 - Math.sqrt(V * V + G) : o0 = Math.sqrt(V * V + G), o0 = G / (V + o0));
|
31886
|
+
let d0 = (X + T) * (X - T) + o0, p0 = X * Y;
|
31875
31887
|
for (let r0 = N; r0 < y - 1; r0++) {
|
31876
31888
|
let k0 = hi(d0, p0);
|
31877
31889
|
k0 === 0 && (k0 = Number.MIN_VALUE);
|
@@ -36154,6 +36166,7 @@ ${Uf}`);
|
|
36154
36166
|
request;
|
36155
36167
|
syminfo;
|
36156
36168
|
_count = 0;
|
36169
|
+
_alertSelects = [];
|
36157
36170
|
constructor(e, t, r) {
|
36158
36171
|
const i = e.toString().split(".")[1]?.length || 5;
|
36159
36172
|
this._variables = t, this._errorListener = new RC(), this.array = new Hf(this._errorListener), this.math = new Bx(i), this.color = new Ex(), this.str = new T7(this._errorListener, i, t), this.map = new X7(), this.timeframe = new E7(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new C7(this._errorListener), this.ta = new xx(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new Cx(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new I7(t) }, this.line = new _i(t, this._errorListener), this.label = new S7(t, this._errorListener), this.polyline = new cC(t, this._errorListener), this.box = new dC(t, this._errorListener), this.table = new fC(t, this._errorListener), this.linefill = new lC(t), this.log = new vC(t, this.str), this.runtime = new yC(this._errorListener), this.strategy = new mC(this._variables, this._options, e, this._errorListener, r), this.request = new gC(this._variables, r, this, this._errorListener), this.syminfo = new WC(), this._proxy = /* @__PURE__ */ new Map();
|
@@ -36203,7 +36216,7 @@ ${Uf}`);
|
|
36203
36216
|
const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0, p = this.log.logs.length ? this.log.logs : void 0;
|
36204
36217
|
this.log.clearLogs(), this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
|
36205
36218
|
const b = this._plots.size > 0 ? [...this._plots.values()] : void 0, M = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, l = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, u = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, O = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, d = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0, _ = this._getDraws(), f = this._variables.chart.isUseBgColor;
|
36206
|
-
return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f });
|
36219
|
+
return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f, alertSelects: this._alertSelects });
|
36207
36220
|
}
|
36208
36221
|
_getDataOfBarindex(e) {
|
36209
36222
|
const t = this._alerts.size ? [...this._alerts.values()] : void 0;
|
@@ -36497,13 +36510,18 @@ ${Uf}`);
|
|
36497
36510
|
this._alerts.delete(a);
|
36498
36511
|
}
|
36499
36512
|
alertcondition({ condition: e, message: t, title: r }, i) {
|
36500
|
-
const {
|
36501
|
-
|
36513
|
+
const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
|
36514
|
+
this._variables.bar_index === 0 && !o && this._alertSelects.push({
|
36515
|
+
id: a,
|
36516
|
+
message: t || "警报已发出!",
|
36517
|
+
title: r || "警报",
|
36518
|
+
type: "alertcondition"
|
36519
|
+
}), !s && e ? this._alerts.set(a, {
|
36502
36520
|
message: t,
|
36503
36521
|
title: r,
|
36504
|
-
id:
|
36522
|
+
id: a,
|
36505
36523
|
type: "alertcondition"
|
36506
|
-
}) : this._alerts.delete(
|
36524
|
+
}) : this._alerts.delete(a);
|
36507
36525
|
}
|
36508
36526
|
barcolor(e, t) {
|
36509
36527
|
this._setColors(e, "barcolor", t);
|
@@ -37522,13 +37540,13 @@ ${u}`), u;
|
|
37522
37540
|
hold_profit_short_k_count: Y = 0,
|
37523
37541
|
hold_loss_long_k_count: V = 0,
|
37524
37542
|
hold_loss_short_k_count: G = 0,
|
37525
|
-
balanceByInterval:
|
37543
|
+
balanceByInterval: o0,
|
37526
37544
|
shapeRatioType: d0 = "NONE"
|
37527
37545
|
} = this._preHistoryOrderCalcResult;
|
37528
37546
|
const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
|
37529
|
-
if (f0 === X0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !
|
37547
|
+
if (f0 === X0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
|
37530
37548
|
const i0 = this._createBalanceByInterval(s1, Date.now());
|
37531
|
-
|
37549
|
+
o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
|
37532
37550
|
}
|
37533
37551
|
const x0 = i + s;
|
37534
37552
|
this._closedtrades = x0;
|
@@ -37573,9 +37591,9 @@ ${u}`), u;
|
|
37573
37591
|
hold_profit_short_k_count: Y,
|
37574
37592
|
hold_loss_long_k_count: V,
|
37575
37593
|
hold_loss_short_k_count: G,
|
37576
|
-
balanceByInterval:
|
37594
|
+
balanceByInterval: o0,
|
37577
37595
|
shapeRatioType: d0
|
37578
|
-
}, d0 !== "NONE" && (
|
37596
|
+
}, d0 !== "NONE" && (o0[Gc(e1)] = $ + n1);
|
37579
37597
|
} else if (this._options?.commission_value) {
|
37580
37598
|
const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
|
37581
37599
|
const { commission: M = 0, qty: l = 0, original_qty: u = 0 } = b, O = M * l / u;
|
@@ -38829,9 +38847,9 @@ ${u}`), u;
|
|
38829
38847
|
}]
|
38830
38848
|
};
|
38831
38849
|
!t && (G || G === 0) && u.push(G);
|
38832
|
-
const
|
38833
|
-
if (
|
38834
|
-
return
|
38850
|
+
const o0 = await UO(f, q, A, g, M, k, x, { newCacheData: _, cacheData: O }, N, w, X);
|
38851
|
+
if (o0)
|
38852
|
+
return o0;
|
38835
38853
|
k = Object.assign(V, { barIndex: G || Y, lastBarIndex: S ? G : r[D].barindex || D, lastBarTime: S ? V.time : r[D].time, nextBarTime: r[Y + 1]?.time }), th(f, q, A, g, M, k, N);
|
38836
38854
|
const d0 = q.errors;
|
38837
38855
|
if (d0.length && d0.some((p0) => p0.type === K0.Error))
|
@@ -44560,6 +44578,7 @@ ${u}`), u;
|
|
44560
44578
|
request;
|
44561
44579
|
syminfo;
|
44562
44580
|
_count = 0;
|
44581
|
+
_alertSelects = [];
|
44563
44582
|
constructor(e, t, r) {
|
44564
44583
|
const i = e.toString().split(".")[1]?.length || 5;
|
44565
44584
|
this._variables = t, this._errorListener = new UE(), this.array = new ch(this._errorListener), this.math = new YC(i), this.color = new QC(), this.str = new eE(this._errorListener, i, t), this.map = new tE(), this.timeframe = new ZC(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new JC(this._errorListener), this.ta = new KC(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new GC(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new rE(t) }, this.line = new Ai(t, this._errorListener), this.label = new nE(t, this._errorListener), this.polyline = new yE(t, this._errorListener), this.box = new CE(t, this._errorListener), this.table = new EE(t, this._errorListener), this.linefill = new wE(t), this.log = new PE(t, this.str), this.runtime = new HE(this._errorListener), this.strategy = new FE(this._variables, this._options, e, this._errorListener, r), this.request = new SE(this._variables, r, this, this._errorListener), this.syminfo = new kE(), this._proxy = /* @__PURE__ */ new Map();
|
@@ -44609,7 +44628,7 @@ ${u}`), u;
|
|
44609
44628
|
const a = this._hlines.size ? [...this._hlines.values()] : void 0, c = this._fills.size ? [...this._fills.values()] : void 0, p = this.log.logs.length ? this.log.logs : void 0;
|
44610
44629
|
this.log.clearLogs(), this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
|
44611
44630
|
const b = this._plots.size > 0 ? [...this._plots.values()] : void 0, M = this._plotbars.size > 0 ? [...this._plotbars.values()] : void 0, l = this._plotshapes.size > 0 ? [...this._plotshapes.values()] : void 0, u = this._plotarrows.size > 0 ? [...this._plotarrows.values()] : void 0, O = this._plotcandles.size > 0 ? [...this._plotcandles.values()] : void 0, d = this._plotchars.size > 0 ? [...this._plotchars.values()] : void 0, _ = this._getDraws(), f = this._variables.chart.isUseBgColor;
|
44612
|
-
return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f });
|
44631
|
+
return Object.assign({}, this._options, { inputs: r, plots: b, draws: _, alerts: i, colors: o, hlines: a, fills: c, logs: p, plotshapes: l, plotarrows: u, plotcandles: O, plotchars: d, plotbars: M, isUseBgColor: f, alertSelects: this._alertSelects });
|
44613
44632
|
}
|
44614
44633
|
_getDataOfBarindex(e) {
|
44615
44634
|
const t = this._alerts.size ? [...this._alerts.values()] : void 0;
|
@@ -44880,36 +44899,41 @@ ${u}`), u;
|
|
44880
44899
|
}
|
44881
44900
|
}
|
44882
44901
|
alert({ message: e, freq: t = wr.freqOncePerBar }, r) {
|
44883
|
-
const { bar_index: i,
|
44884
|
-
if (this._paramVerfiy(t, r, "alert", [wr.freqAll, wr.freqOncePerBar, wr.freqOncePerBarClose]), t === wr.freqOncePerBar && i ===
|
44885
|
-
this._alerts.delete(
|
44902
|
+
const { bar_index: i, __isFirstRun: s, _isRealTimeBar: o } = this._variables, a = !s, c = `alert_${r}`, p = this._cacheData[c] || {}, b = p.barIndex;
|
44903
|
+
if (this._paramVerfiy(t, r, "alert", [wr.freqAll, wr.freqOncePerBar, wr.freqOncePerBarClose]), t === wr.freqOncePerBar && i === b) {
|
44904
|
+
this._alerts.delete(c);
|
44886
44905
|
return;
|
44887
44906
|
}
|
44888
|
-
this._cacheData[
|
44889
|
-
const
|
44907
|
+
this._cacheData[c] = p;
|
44908
|
+
const M = {
|
44890
44909
|
message: e,
|
44891
44910
|
freq: t,
|
44892
|
-
id:
|
44911
|
+
id: c,
|
44893
44912
|
type: "alert"
|
44894
44913
|
};
|
44895
|
-
if (
|
44896
|
-
t !== wr.freqOncePerBarClose && this._alerts.set(
|
44914
|
+
if (a) {
|
44915
|
+
t !== wr.freqOncePerBarClose && this._alerts.set(c, M), p.barIndex = i;
|
44897
44916
|
return;
|
44898
44917
|
}
|
44899
|
-
if (!
|
44900
|
-
this._alerts.set(
|
44918
|
+
if (!o && t === wr.freqOncePerBarClose && a) {
|
44919
|
+
this._alerts.set(c, M), p.barIndex = i;
|
44901
44920
|
return;
|
44902
44921
|
}
|
44903
|
-
this._alerts.delete(
|
44922
|
+
this._alerts.delete(c);
|
44904
44923
|
}
|
44905
44924
|
alertcondition({ condition: e, message: t, title: r }, i) {
|
44906
|
-
const {
|
44907
|
-
|
44925
|
+
const { __isFirstRun: s, __isReqRepeated: o } = this._variables, a = `alertcondition_${i}`;
|
44926
|
+
this._variables.bar_index === 0 && !o && this._alertSelects.push({
|
44927
|
+
id: a,
|
44928
|
+
message: t || "警报已发出!",
|
44929
|
+
title: r || "警报",
|
44930
|
+
type: "alertcondition"
|
44931
|
+
}), !s && e ? this._alerts.set(a, {
|
44908
44932
|
message: t,
|
44909
44933
|
title: r,
|
44910
|
-
id:
|
44934
|
+
id: a,
|
44911
44935
|
type: "alertcondition"
|
44912
|
-
}) : this._alerts.delete(
|
44936
|
+
}) : this._alerts.delete(a);
|
44913
44937
|
}
|
44914
44938
|
barcolor(e, t) {
|
44915
44939
|
this._setColors(e, "barcolor", t);
|
@@ -45275,21 +45299,21 @@ ${u}`), u;
|
|
45275
45299
|
let N = M, w = v + N;
|
45276
45300
|
const x = [];
|
45277
45301
|
for (const [T, S] of D.entries()) {
|
45278
|
-
let { time: k } = S;
|
45302
|
+
let { time: k, barIndex: X } = S;
|
45279
45303
|
k = k * 1e3;
|
45280
|
-
let
|
45304
|
+
let Y = X || W + T;
|
45281
45305
|
if (k >= w)
|
45282
45306
|
return !l && (this._cacheData[r] = {
|
45283
|
-
index:
|
45307
|
+
index: Y,
|
45284
45308
|
periodStamp: v
|
45285
45309
|
}), x;
|
45286
45310
|
if (N <= k && k < w) {
|
45287
|
-
const
|
45288
|
-
if (Array.isArray(
|
45289
|
-
for (const [
|
45290
|
-
x[
|
45311
|
+
const V = S?.result?.[r];
|
45312
|
+
if (Array.isArray(V))
|
45313
|
+
for (const [G, o0] of V.entries())
|
45314
|
+
x[G] || (x[G] = []), x[G].push(o0);
|
45291
45315
|
else
|
45292
|
-
i || x.push(
|
45316
|
+
i || x.push(V);
|
45293
45317
|
}
|
45294
45318
|
}
|
45295
45319
|
return !l && (this._cacheData[r] = {
|
@@ -45342,7 +45366,7 @@ ${u}`), u;
|
|
45342
45366
|
let { time: k, barindex: X } = S;
|
45343
45367
|
k = k * 1e3;
|
45344
45368
|
const Y = L[T + 1]?.time * 1e3 || k + q;
|
45345
|
-
let V = W + T;
|
45369
|
+
let V = X || W + T;
|
45346
45370
|
if (k >= N) {
|
45347
45371
|
this._cacheData[t] = {
|
45348
45372
|
index: V,
|
@@ -45361,7 +45385,7 @@ ${u}`), u;
|
|
45361
45385
|
let { time: k, barindex: X } = S;
|
45362
45386
|
k = k * 1e3;
|
45363
45387
|
const Y = k + q, V = L[T + 1]?.time * 1e3 || Y;
|
45364
|
-
let G = W + T;
|
45388
|
+
let G = X || W + T;
|
45365
45389
|
if (k > N) {
|
45366
45390
|
this._cacheData[t] = {
|
45367
45391
|
index: G,
|
@@ -45392,7 +45416,7 @@ ${u}`), u;
|
|
45392
45416
|
let { time: u, barindex: O } = l;
|
45393
45417
|
u = u * 1e3, t.includes("M") && (i = ht(t, u) * 1e3 - (e0(u).date() - 1) * 864e5);
|
45394
45418
|
const d = u, _ = i + d;
|
45395
|
-
let f = o + M;
|
45419
|
+
let f = O || o + M;
|
45396
45420
|
if (r <= d)
|
45397
45421
|
return this._cacheData[c] = {
|
45398
45422
|
index: f,
|
@@ -45420,7 +45444,7 @@ ${u}`), u;
|
|
45420
45444
|
for (const [l, u] of e.entries()) {
|
45421
45445
|
let { time: O, barindex: d } = u;
|
45422
45446
|
O = O * 1e3, t.includes("M") && (i = ht(t, O) * 1e3 - (e0(O).date() - 1) * 864e5);
|
45423
|
-
const _ = O, f = i + _, A = o + l;
|
45447
|
+
const _ = O, f = i + _, A = d || o + l;
|
45424
45448
|
if (r < _)
|
45425
45449
|
return this._cacheData[c] = {
|
45426
45450
|
index: A,
|
@@ -45522,7 +45546,7 @@ ${u}`), u;
|
|
45522
45546
|
const u = i.length - 1, { interval: O, symbol: d = "", mintick: _ } = s;
|
45523
45547
|
let { syminfo: f } = this._variables;
|
45524
45548
|
const [A, q] = d.split(":");
|
45525
|
-
p.updateOptions({ interval: O, mintick: _, syminfo: { ...f.__syminfo, main_tickerid: f.main_tickerid, main_period: f.main_period, mintick: _, tickerid: d || f.tickerid, ticker: q || A || f.ticker } });
|
45549
|
+
p.__isFirstRun = r, p.updateOptions({ interval: O, mintick: _, syminfo: { ...f.__syminfo, main_tickerid: f.main_tickerid, main_period: f.main_period, mintick: _, tickerid: d || f.tickerid, ticker: q || A || f.ticker } });
|
45526
45550
|
for (const [v, y] of i.entries()) {
|
45527
45551
|
const { barindex: L } = y, D = Object.assign(y, { barIndex: L || v, lastBarIndex: i[u].barindex || u, lastBarTime: i[u].time, nextBarTime: i[v + 1]?.time });
|
45528
45552
|
if (p.updateData(D), M.update({ barIndex: D?.barIndex || 0 }), y.result = Object.assign(y.result || {}, { [t]: l(p, b, M, o || [], t) }), M.endExecution(), M.errors.length && M.errors.some((N) => N.type === G0.Error))
|
@@ -45536,20 +45560,13 @@ ${u}`), u;
|
|
45536
45560
|
}
|
45537
45561
|
}
|
45538
45562
|
_runScripts(e, t, r, i, s, o) {
|
45539
|
-
const a = `${this._scriptId}_${t}
|
45540
|
-
|
45541
|
-
const
|
45542
|
-
|
45543
|
-
|
45544
|
-
|
45545
|
-
|
45546
|
-
}
|
45547
|
-
c.updateData(u), b.update({ barIndex: u?.barindex || 0 });
|
45548
|
-
const O = M(c, p, b, i || [], t), d = b.log.logs, _ = b.errors;
|
45549
|
-
return b.log.clearLogs(), b.clearErrors(), b.endExecution(), {
|
45550
|
-
result: O,
|
45551
|
-
logs: d,
|
45552
|
-
errors: _
|
45563
|
+
const a = `${this._scriptId}_${t}`, { interval: c, ...p } = s || {}, b = new Fb(a), M = new Ib(), l = new $b(this._variables.mintick || 1e-5, b, this._scriptId), u = new Function("_$_var", "_$_const", "_$_func", "$paramsExpr", "$posStr", e), { mintick: O, syminfo: d } = this._variables;
|
45564
|
+
b.updateOptions({ interval: c, mintick: O || 1e-5, syminfo: { ...d.__syminfo } }), b.__requestName = o || "", b.updateData(p), l.update({ barIndex: p?.barindex || 0 });
|
45565
|
+
const _ = u(b, M, l, i || [], t), f = l.log.logs, A = l.errors;
|
45566
|
+
return l.log.clearLogs(), l.clearErrors(), l.endExecution(), {
|
45567
|
+
result: _,
|
45568
|
+
logs: f,
|
45569
|
+
errors: A
|
45553
45570
|
};
|
45554
45571
|
}
|
45555
45572
|
}, kE = class {
|
@@ -45937,13 +45954,13 @@ ${u}`), u;
|
|
45937
45954
|
hold_profit_short_k_count: Y = 0,
|
45938
45955
|
hold_loss_long_k_count: V = 0,
|
45939
45956
|
hold_loss_short_k_count: G = 0,
|
45940
|
-
balanceByInterval:
|
45957
|
+
balanceByInterval: o0,
|
45941
45958
|
shapeRatioType: d0 = "NONE"
|
45942
45959
|
} = this._preHistoryOrderCalcResult;
|
45943
45960
|
const { profit: p0 = 0, profit_percent: r0 = 0, in_index: k0 = 0, out_index: F0 = 0, commission: B0 = 0, direction: f0, in_time: s1 = 0, out_time: e1 = 0, total_profit: n1 = 0 } = e, V0 = F0 - k0 + 1;
|
45944
|
-
if (f0 === I0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !
|
45961
|
+
if (f0 === I0.long ? (t += p0, i += 1, o += r0, g += B0, S += V0, p0 > 0 ? (b += r0, A += 1, O += p0, X += V0, v = Math.max(v, p0), N = Math.max(N, r0)) : p0 < 0 && (c += r0, _ += 1, l += p0, V += V0, L = Math.min(L, p0), x = Math.min(x, r0))) : (r += p0, s += 1, a += r0, W += B0, k += V0, p0 > 0 ? (M += r0, q += 1, d += p0, Y += V0, y = Math.max(y, p0), w = Math.max(w, r0)) : p0 < 0 && (p += r0, f += 1, u += p0, G += V0, D = Math.min(D, p0), T = Math.min(T, r0))), !o0) {
|
45945
45962
|
const i0 = this._createBalanceByInterval(s1, Date.now());
|
45946
|
-
|
45963
|
+
o0 = i0.balanceByInterval, d0 = i0.shapeRatioType;
|
45947
45964
|
}
|
45948
45965
|
const x0 = i + s;
|
45949
45966
|
this._closedtrades = x0;
|
@@ -45988,9 +46005,9 @@ ${u}`), u;
|
|
45988
46005
|
hold_profit_short_k_count: Y,
|
45989
46006
|
hold_loss_long_k_count: V,
|
45990
46007
|
hold_loss_short_k_count: G,
|
45991
|
-
balanceByInterval:
|
46008
|
+
balanceByInterval: o0,
|
45992
46009
|
shapeRatioType: d0
|
45993
|
-
}, d0 !== "NONE" && (
|
46010
|
+
}, d0 !== "NONE" && (o0[Gc(e1)] = $ + n1);
|
45994
46011
|
} else if (this._options?.commission_value) {
|
45995
46012
|
const { grossloss_long: t = 0, grossloss_short: r = 0, netprofit_long: i = 0, netprofit_short: s = 0 } = this._preHistoryOrderCalcResult, o = this._orders.reduce((p, b) => {
|
45996
46013
|
const { commission: M = 0, qty: l = 0, original_qty: u = 0 } = b, O = M * l / u;
|
@@ -47275,9 +47292,9 @@ ${u}`), u;
|
|
47275
47292
|
}]
|
47276
47293
|
};
|
47277
47294
|
!t && (G || G === 0) && u.push(G);
|
47278
|
-
const
|
47279
|
-
if (
|
47280
|
-
return
|
47295
|
+
const o0 = await id(f, q, A, g, M, k, x, { newCacheData: _, cacheData: O }, N, w, X);
|
47296
|
+
if (o0)
|
47297
|
+
return o0;
|
47281
47298
|
k = Object.assign(V, { barIndex: G || Y, lastBarIndex: S ? G : r[D].barindex || D, lastBarTime: S ? V.time : r[D].time, nextBarTime: r[Y + 1]?.time }), Mh(f, q, A, g, M, k, N);
|
47282
47299
|
const d0 = q.errors;
|
47283
47300
|
if (d0.length && d0.some((p0) => p0.type === G0.Error))
|