@guihz/trading-vue-editor-tes 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/{parserTccWorker-B6TDhYXx.js → parserTccWorker-DOV8B1dj.js} +19 -9
- package/lib/assets/{scriptsRunWorker-Dpg-1H14.js → scriptsRunWorker-BGGO_qbx.js} +76 -53
- package/lib/components/editor/v3/parseScript/buildInVarNamespace/ta.d.ts +3 -0
- package/lib/{index-B2LF-839.js → index-D22ipYhi.js} +210 -209
- package/lib/{monarchTokens-Dzsc5GLx.js → monarchTokens-BkGYzRcP.js} +1 -1
- package/lib/trading-vue-editor.es.packages.js +4 -4
- package/lib/trading-vue-editor.umd.packages.mjs +31 -31
- package/package.json +1 -1
@@ -78978,7 +78978,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
78978
78978
|
Fe.includes(E) && (E = `$${E}`);
|
78979
78979
|
const T = `var ${b} = Date.now()`, _ = this._parserSingleExpression(s);
|
78980
78980
|
if (n.length === 1)
|
78981
|
-
m = `for (let ${E} of ${_}
|
78981
|
+
m = `for (let ${E} of (${_}?._value || [])) {
|
78982
78982
|
if ((${_}).isMatrix) {
|
78983
78983
|
${E} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${E}, (${_}).typeName)
|
78984
78984
|
}
|
@@ -78991,7 +78991,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
78991
78991
|
else {
|
78992
78992
|
Fe.includes(x) && (x = `$${x}`);
|
78993
78993
|
const z = `$$value${this._count}`;
|
78994
|
-
m = `const ${z} = (${_})
|
78994
|
+
m = `const ${z} = (${_})?.isMap ? Object.entries((${_})._value) : ((${_})?._value || []).entries()
|
78995
78995
|
for (let [${E},${x}] of ${z}) {
|
78996
78996
|
if ((${_}).isMatrix) {
|
78997
78997
|
${x} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${x}, (${_}).typeName)
|
@@ -95251,9 +95251,8 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
95251
95251
|
case "series <type>":
|
95252
95252
|
o = this._getArrayType(s), o || (o = this._removePrefix(s)), n = [this._typeAddSeries(o)];
|
95253
95253
|
break;
|
95254
|
-
case "array<type>":
|
95255
95254
|
case "matrix<type>":
|
95256
|
-
case "type
|
95255
|
+
case "array<type>":
|
95257
95256
|
if (this._isMapType(s)) {
|
95258
95257
|
const p = this._getMapType(s) || [];
|
95259
95258
|
i.includes("keys") ? o = p[0] : o = p[1];
|
@@ -97757,7 +97756,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
97757
97756
|
typeR: R[0]
|
97758
97757
|
}),
|
97759
97758
|
ctx: n
|
97760
|
-
}), x === 0 ? (p = L, b = C,
|
97759
|
+
}), x === 0 ? (p = L, b = C, L.length || (z[0] === `${P.ARRAY}<>` ? o = `array<${S.type}>` : o = z[0])) : L.length ? (p[0]?.isLenErr && !L[0]?.isLenErr || p.length > L.length) && (p = L, b = C, f = x) : this._priorityComparison(o, z[0]) || (z[0] === `${P.ARRAY}<>` ? o = `array<${S.type}>` : o = z[0], p = L, b = C, f = x);
|
97761
97760
|
}
|
97762
97761
|
for (const x of p)
|
97763
97762
|
this._errorHandle(x.msg, x.ctx);
|
@@ -98005,6 +98004,16 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
98005
98004
|
typeR: this._typeAddSeries(_)
|
98006
98005
|
});
|
98007
98006
|
break;
|
98007
|
+
case "series int/float/color/string/label/line/box/table/linefill/polyline/array<>/matrix<>/map<>":
|
98008
|
+
if (this._isMatrixType(m) || this._isArrayType(m) || this._isMapType(m))
|
98009
|
+
return;
|
98010
|
+
g0(d0.typeMismatch, {
|
98011
|
+
operator: n,
|
98012
|
+
index: T,
|
98013
|
+
typeE: m,
|
98014
|
+
typeR: x
|
98015
|
+
});
|
98016
|
+
break;
|
98008
98017
|
case "any matrix type":
|
98009
98018
|
if (this._isMatrixType(m)) {
|
98010
98019
|
if (T === "id2") {
|
@@ -98151,14 +98160,15 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
98151
98160
|
typeR: i?.type
|
98152
98161
|
});
|
98153
98162
|
break;
|
98154
|
-
case "
|
98163
|
+
case "const enum":
|
98164
|
+
case "series enum":
|
98155
98165
|
const L = this._removePrefix(m);
|
98156
98166
|
if (!this._enums.has(L))
|
98157
98167
|
return g0(d0.typeMismatch, {
|
98158
98168
|
operator: n,
|
98159
98169
|
index: T,
|
98160
98170
|
typeE: m,
|
98161
|
-
typeR:
|
98171
|
+
typeR: x
|
98162
98172
|
});
|
98163
98173
|
break;
|
98164
98174
|
case "tuple of enum fields: [enumName.field1, enumName.field2, ...]":
|
@@ -98557,7 +98567,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
98557
98567
|
ln.includes(E) && (E = `$${E}`);
|
98558
98568
|
const T = `var ${b} = Date.now()`, _ = this._parserSingleExpression(s);
|
98559
98569
|
if (n.length === 1)
|
98560
|
-
m = `for (let ${E} of ${_}
|
98570
|
+
m = `for (let ${E} of (${_}?._value || [])) {
|
98561
98571
|
if ((${_}).isMatrix) {
|
98562
98572
|
${E} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${E}, (${_}).typeName)
|
98563
98573
|
}
|
@@ -98570,7 +98580,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
|
|
98570
98580
|
else {
|
98571
98581
|
ln.includes(x) && (x = `$${x}`);
|
98572
98582
|
const z = `$$value${this._count}`;
|
98573
|
-
m = `const ${z} = (${_})
|
98583
|
+
m = `const ${z} = (${_})?.isMap ? Object.entries((${_})._value) : ((${_})?._value || []).entries()
|
98574
98584
|
for (let [${E},${x}] of ${z}) {
|
98575
98585
|
if ((${_}).isMatrix) {
|
98576
98586
|
${x} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${x}, (${_}).typeName)
|
@@ -8478,9 +8478,13 @@ function print() { __p += __j.call(arguments, '') }
|
|
8478
8478
|
_currentData;
|
8479
8479
|
_preData;
|
8480
8480
|
_id;
|
8481
|
+
timeframeFunc;
|
8481
8482
|
constructor(e) {
|
8482
8483
|
this._preAccdist = 0, this._preVwap = {}, this._preValue = {}, this._currentData = {}, this._preData = {}, this._id = e;
|
8483
8484
|
}
|
8485
|
+
set buildInTimeframeFunc(e) {
|
8486
|
+
this.timeframeFunc = e;
|
8487
|
+
}
|
8484
8488
|
get _varTaCacheData() {
|
8485
8489
|
return {
|
8486
8490
|
preAccdist: this._preAccdist,
|
@@ -8522,7 +8526,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
8522
8526
|
return this._preValue.vwap;
|
8523
8527
|
const { hlc3: e, volume: t } = this._currentData;
|
8524
8528
|
let { sum: r = 0, sumV: i = 0, isReset: s } = this._preVwap;
|
8525
|
-
if (
|
8529
|
+
if (this.timeframeFunc?.change({ timeframe: "1D" }, "vwap_buildin") && (s = !0, r = i = 0), !s)
|
8526
8530
|
return;
|
8527
8531
|
const a = e * t + r, c = t + i;
|
8528
8532
|
!this.isRealTime && (this._preVwap = { sum: a, sumV: c, isReset: s });
|
@@ -18131,8 +18135,10 @@ Example:
|
|
18131
18135
|
if (i === void 0 || i <= 0)
|
18132
18136
|
return;
|
18133
18137
|
const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
|
18134
|
-
if (a?.length)
|
18135
|
-
return
|
18138
|
+
if (!a?.length)
|
18139
|
+
return;
|
18140
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
18141
|
+
return Math.max(...c);
|
18136
18142
|
}
|
18137
18143
|
highestbars(e, t) {
|
18138
18144
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -18172,8 +18178,10 @@ Example:
|
|
18172
18178
|
if (i === void 0 || i <= 0)
|
18173
18179
|
return;
|
18174
18180
|
const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
|
18175
|
-
if (a?.length)
|
18176
|
-
return
|
18181
|
+
if (!a?.length)
|
18182
|
+
return;
|
18183
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
18184
|
+
return Math.min(...c);
|
18177
18185
|
}
|
18178
18186
|
lowestbars(e, t) {
|
18179
18187
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -18364,12 +18372,12 @@ Example:
|
|
18364
18372
|
const r = `vwap_${t}`, i = this._verifyCacheData(r);
|
18365
18373
|
if (i)
|
18366
18374
|
return i?.value;
|
18367
|
-
const s = this._timeframe.change({ timeframe: "1D" }, t), { volume:
|
18368
|
-
let { sum:
|
18369
|
-
if (
|
18375
|
+
const s = /\$[\d]+_\$/.test(t), o = this._timeframe.change({ timeframe: "1D" }, t), { volume: a } = this._variables;
|
18376
|
+
let { sum: c = 0, sumV: p = 0, count: b = 0, isReset: M } = this._getCacheData(r);
|
18377
|
+
if (o ? (c = p = b = 0, M = !0) : s && (M = !1), !M)
|
18370
18378
|
return;
|
18371
|
-
const l = e *
|
18372
|
-
return
|
18379
|
+
const l = e * a + c, u = a + p, O = l / u;
|
18380
|
+
return b++, this._cacheDataHandle(r, { sum: l, sumV: u, count: b, isReset: M, value: O }), O;
|
18373
18381
|
}
|
18374
18382
|
vwma({ source: e, length: t, isSeriesLen: r }, i) {
|
18375
18383
|
if (e === void 0 || isNaN(e) || t === void 0 || t <= 0)
|
@@ -18396,7 +18404,7 @@ Example:
|
|
18396
18404
|
}, { bar_index: c } = this._variables;
|
18397
18405
|
if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
|
18398
18406
|
const p = a.list.length;
|
18399
|
-
a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
|
18407
|
+
o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
|
18400
18408
|
}
|
18401
18409
|
if (!(a.list.length < t && s))
|
18402
18410
|
return a.list;
|
@@ -20169,7 +20177,7 @@ ${u}`), u;
|
|
20169
20177
|
strategy;
|
20170
20178
|
_count = 0;
|
20171
20179
|
constructor(e, t, r) {
|
20172
|
-
super(t, r), 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);
|
20180
|
+
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);
|
20173
20181
|
}
|
20174
20182
|
getFuncCacheData() {
|
20175
20183
|
return {
|
@@ -23130,7 +23138,7 @@ ${u}`), u;
|
|
23130
23138
|
}
|
23131
23139
|
avg({ id: e }, t) {
|
23132
23140
|
if (e)
|
23133
|
-
return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value);
|
23141
|
+
return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value.filter((r) => !isNaN(r)));
|
23134
23142
|
}
|
23135
23143
|
clear({ id: e }) {
|
23136
23144
|
e && (e._value = []);
|
@@ -23848,8 +23856,10 @@ ${u}`), u;
|
|
23848
23856
|
if (i === void 0 || i <= 0)
|
23849
23857
|
return;
|
23850
23858
|
const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
|
23851
|
-
if (a?.length)
|
23852
|
-
return
|
23859
|
+
if (!a?.length)
|
23860
|
+
return;
|
23861
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
23862
|
+
return Math.max(...c);
|
23853
23863
|
}
|
23854
23864
|
highestbars(e, t) {
|
23855
23865
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -23907,8 +23917,10 @@ ${u}`), u;
|
|
23907
23917
|
if (i === void 0 || i <= 0)
|
23908
23918
|
return;
|
23909
23919
|
const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
|
23910
|
-
if (a?.length)
|
23911
|
-
return
|
23920
|
+
if (!a?.length)
|
23921
|
+
return;
|
23922
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
23923
|
+
return Math.min(...c);
|
23912
23924
|
}
|
23913
23925
|
lowestbars(e, t) {
|
23914
23926
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -24145,13 +24157,14 @@ ${u}`), u;
|
|
24145
24157
|
const i = `vwap_${r}`, s = this._verifyCacheData(i);
|
24146
24158
|
if (s)
|
24147
24159
|
return s?.value;
|
24160
|
+
const o = /\$[\d]+_\$/.test(r);
|
24148
24161
|
t = t === void 0 ? this._timeframe.change({ timeframe: "1D" }, r) : t;
|
24149
|
-
const { volume:
|
24150
|
-
let { sum:
|
24151
|
-
if (t
|
24162
|
+
const { volume: a } = this._variables;
|
24163
|
+
let { sum: c = 0, sumV: p = 0, count: b = 0, isReset: M } = this._getCacheData(i);
|
24164
|
+
if (t ? (c = p = b = 0, M = !0) : o && (M = !1), !M)
|
24152
24165
|
return;
|
24153
|
-
const
|
24154
|
-
return
|
24166
|
+
const l = e * a + c, u = a + p, O = l / u;
|
24167
|
+
return b++, this._cacheDataHandle(i, { sum: l, sumV: u, count: b, isReset: M, value: O }), O;
|
24155
24168
|
}
|
24156
24169
|
vwma({ source: e, length: t, isSeriesLen: r }, i) {
|
24157
24170
|
if (e === void 0 || isNaN(e) || t === void 0 || t <= 0)
|
@@ -24185,7 +24198,7 @@ ${u}`), u;
|
|
24185
24198
|
}, { bar_index: c } = this._variables;
|
24186
24199
|
if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
|
24187
24200
|
const p = a.list.length;
|
24188
|
-
a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
|
24201
|
+
o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._taCacheDataLoc[r] = a;
|
24189
24202
|
}
|
24190
24203
|
if (!(a.list.length < t && s))
|
24191
24204
|
return a.list;
|
@@ -28059,7 +28072,7 @@ ${u}`), u;
|
|
28059
28072
|
}
|
28060
28073
|
avg({ id: e }, t) {
|
28061
28074
|
if (e)
|
28062
|
-
return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value);
|
28075
|
+
return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value.filter((r) => !isNaN(r)));
|
28063
28076
|
}
|
28064
28077
|
binary_search({ id: e, val: t }, r) {
|
28065
28078
|
if (e)
|
@@ -28785,8 +28798,10 @@ ${u}`), u;
|
|
28785
28798
|
if (i === void 0 || i <= 0)
|
28786
28799
|
return;
|
28787
28800
|
const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
|
28788
|
-
if (a?.length)
|
28789
|
-
return
|
28801
|
+
if (!a?.length)
|
28802
|
+
return;
|
28803
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
28804
|
+
return Math.max(...c);
|
28790
28805
|
}
|
28791
28806
|
highestbars(e, t) {
|
28792
28807
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -28844,8 +28859,10 @@ ${u}`), u;
|
|
28844
28859
|
if (i === void 0 || i <= 0)
|
28845
28860
|
return;
|
28846
28861
|
const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
|
28847
|
-
if (a?.length)
|
28848
|
-
return
|
28862
|
+
if (!a?.length)
|
28863
|
+
return;
|
28864
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
28865
|
+
return Math.min(...c);
|
28849
28866
|
}
|
28850
28867
|
lowestbars(e, t) {
|
28851
28868
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -29154,18 +29171,19 @@ ${u}`), u;
|
|
29154
29171
|
const s = `vwap_${i}`, o = this._verifyCacheData(s);
|
29155
29172
|
if (o)
|
29156
29173
|
return o?.value;
|
29174
|
+
const a = /\$[\d]+_\$/.test(i);
|
29157
29175
|
t = t === void 0 ? this._timeframe.change({ timeframe: "1D" }, i) : t;
|
29158
|
-
const { volume:
|
29159
|
-
let { sum:
|
29160
|
-
if (t
|
29176
|
+
const { volume: c } = this._variables;
|
29177
|
+
let { sum: p = 0, sumV: b = 0, count: M = 0, isReset: l, sumS: u = 0 } = this._getCacheData(s);
|
29178
|
+
if (t ? (p = b = M = u = 0, l = !0) : a && (l = !1), !l)
|
29161
29179
|
return r !== void 0 ? [] : void 0;
|
29162
|
-
const
|
29163
|
-
if (
|
29164
|
-
|
29165
|
-
const
|
29166
|
-
return this._cacheDataHandle(s, { sum:
|
29180
|
+
const O = e * c + p, d = c + b, _ = O / d;
|
29181
|
+
if (M++, r !== void 0) {
|
29182
|
+
u = c * Math.pow(e, 2) + u;
|
29183
|
+
const f = this._computeBands(u, d, r, _);
|
29184
|
+
return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, sumS: u, value: f }), f;
|
29167
29185
|
}
|
29168
|
-
return this._cacheDataHandle(s, { sum:
|
29186
|
+
return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, value: _ }), _;
|
29169
29187
|
}
|
29170
29188
|
_computeBands(e, t, r, i) {
|
29171
29189
|
let s = e / t - Math.pow(i, 2);
|
@@ -29205,7 +29223,7 @@ ${u}`), u;
|
|
29205
29223
|
}, { bar_index: c } = this._variables;
|
29206
29224
|
if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
|
29207
29225
|
const p = a.list.length;
|
29208
|
-
a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
|
29226
|
+
o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
|
29209
29227
|
}
|
29210
29228
|
if (!(a.list.length < t && s))
|
29211
29229
|
return a.list;
|
@@ -39419,7 +39437,7 @@ ${u}`), u;
|
|
39419
39437
|
}
|
39420
39438
|
avg({ id: e }, t) {
|
39421
39439
|
if (e)
|
39422
|
-
return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value);
|
39440
|
+
return this._verifySimpleType("number", "avg", "int/float", t, e._value), C0.mean(e._value.filter((r) => !isNaN(r)));
|
39423
39441
|
}
|
39424
39442
|
binary_search({ id: e, val: t }, r) {
|
39425
39443
|
if (e)
|
@@ -40146,8 +40164,10 @@ ${u}`), u;
|
|
40146
40164
|
if (i === void 0 || i <= 0)
|
40147
40165
|
return;
|
40148
40166
|
const { high: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `highest_${t}`, s, !0, !0);
|
40149
|
-
if (a?.length)
|
40150
|
-
return
|
40167
|
+
if (!a?.length)
|
40168
|
+
return;
|
40169
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
40170
|
+
return Math.max(...c);
|
40151
40171
|
}
|
40152
40172
|
highestbars(e, t) {
|
40153
40173
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -40205,8 +40225,10 @@ ${u}`), u;
|
|
40205
40225
|
if (i === void 0 || i <= 0)
|
40206
40226
|
return;
|
40207
40227
|
const { low: o } = this._variables, a = this._cacheDataList(e.hasOwnProperty("source") ? r : o, i, `lowest_${t}`, s, !0, !0);
|
40208
|
-
if (a?.length)
|
40209
|
-
return
|
40228
|
+
if (!a?.length)
|
40229
|
+
return;
|
40230
|
+
const c = a.slice(-i).filter((p) => !isNaN(p));
|
40231
|
+
return Math.min(...c);
|
40210
40232
|
}
|
40211
40233
|
lowestbars(e, t) {
|
40212
40234
|
const { source: r, length: i, isSeriesLen: s } = e;
|
@@ -40515,18 +40537,19 @@ ${u}`), u;
|
|
40515
40537
|
const s = `vwap_${i}`, o = this._verifyCacheData(s);
|
40516
40538
|
if (o)
|
40517
40539
|
return o?.value;
|
40540
|
+
const a = /\(\$\d+_\$\)/.test(i);
|
40518
40541
|
t = t === void 0 ? this._timeframe.change({ timeframe: "1D" }, i) : t;
|
40519
|
-
const { volume:
|
40520
|
-
let { sum:
|
40521
|
-
if (t
|
40542
|
+
const { volume: c } = this._variables;
|
40543
|
+
let { sum: p = 0, sumV: b = 0, count: M = 0, isReset: l, sumS: u = 0 } = this._getCacheData(s);
|
40544
|
+
if (t ? (p = b = M = u = 0, l = !0) : a && (l = !1), !l)
|
40522
40545
|
return r !== void 0 ? [] : void 0;
|
40523
|
-
const
|
40524
|
-
if (
|
40525
|
-
|
40526
|
-
const
|
40527
|
-
return this._cacheDataHandle(s, { sum:
|
40546
|
+
const O = e * c + p, d = c + b, _ = O / d;
|
40547
|
+
if (M++, r !== void 0) {
|
40548
|
+
u = c * Math.pow(e, 2) + u;
|
40549
|
+
const f = this._computeBands(u, d, r, _);
|
40550
|
+
return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, sumS: u, value: f }), f;
|
40528
40551
|
}
|
40529
|
-
return this._cacheDataHandle(s, { sum:
|
40552
|
+
return this._cacheDataHandle(s, { sum: O, sumV: d, count: M, isReset: l, value: _ }), _;
|
40530
40553
|
}
|
40531
40554
|
_computeBands(e, t, r, i) {
|
40532
40555
|
let s = e / t - Math.pow(i, 2);
|
@@ -40566,7 +40589,7 @@ ${u}`), u;
|
|
40566
40589
|
}, { bar_index: c } = this._variables;
|
40567
40590
|
if (a.length < t && (a.length = t), a.barIndex <= c && !(isNaN(e) && o)) {
|
40568
40591
|
const p = a.list.length;
|
40569
|
-
a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
|
40592
|
+
o ? a.list[c] = e : a.barIndex === c ? a.list[p - 1] = e : a.list.push(e), a.barIndex = c, a.list.length > a.length + 5 && !i && a.list.shift(), this._cacheData[r] = a;
|
40570
40593
|
}
|
40571
40594
|
if (!(a.list.length < t && s))
|
40572
40595
|
return a.list;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { IKeyObjectValue } from "../../../type";
|
2
|
+
import { BuildInTimeframe } from "../buildInFuncNamespace";
|
2
3
|
export declare class Ta {
|
3
4
|
private _preAccdist;
|
4
5
|
private _preVwap;
|
@@ -6,7 +7,9 @@ export declare class Ta {
|
|
6
7
|
private _currentData;
|
7
8
|
private _preData;
|
8
9
|
private _id;
|
10
|
+
protected timeframeFunc?: BuildInTimeframe;
|
9
11
|
constructor(id: string);
|
12
|
+
set buildInTimeframeFunc(timeframeFunc: BuildInTimeframe);
|
10
13
|
get _varTaCacheData(): IKeyObjectValue;
|
11
14
|
set _varTaCacheData(data: IKeyObjectValue);
|
12
15
|
update(currentData: IKeyObjectValue): void;
|