@guihz/trading-vue-editor-tes 0.1.17 → 0.1.18

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.
@@ -42898,7 +42898,7 @@ ${z}`), z;
42898
42898
  _closeOrders(e, t, r, i, s, o, a, c) {
42899
42899
  const p = this._getUnCloseOrders();
42900
42900
  if (this._options.close_entries_rule !== "ANY") {
42901
- const b = this._historyOrder.filter((M) => !M.isPartClose && (M.realQty || 0) < (M.original_qty || 0) && (!c || c !== M.direction));
42901
+ const b = this._notCloseHistoryOrders.filter((M) => !M.isPartClose && !M.isTiggerClose && (!c || c !== M.direction));
42902
42902
  for (const M of b)
42903
42903
  M.realQty = M.original_qty, M.isTiggerClose = !0;
42904
42904
  }
@@ -43027,7 +43027,7 @@ ${z}`), z;
43027
43027
  }
43028
43028
  _ordersHandle(e) {
43029
43029
  let t = this._orders.filter((a) => a.isMarketPriceLimit || a.isMarketPriceStop);
43030
- if (this._options.close_entries_rule !== "ANY" && (t = this._historyOrder.filter((c) => (c.isMarketPriceLimit || c.isMarketPriceStop) && !c.isPartClose).concat(t)), !t.length)
43030
+ if (this._options.close_entries_rule !== "ANY" && (t = this._notCloseHistoryOrders.filter((c) => (c.isMarketPriceLimit || c.isMarketPriceStop) && !c.isPartClose).concat(t)), !t.length)
43031
43031
  return;
43032
43032
  const { open: r, close: i } = this.calcOnOrderFillsData.data || this._variables, s = e || this._variables._isRealTimeBar ? i : r, o = this._getUnCloseOrders();
43033
43033
  for (const a of t) {
@@ -43226,7 +43226,7 @@ ${z}`), z;
43226
43226
  _getHisOrderSurplusQty(e, t) {
43227
43227
  let r = 0;
43228
43228
  if (this._options.close_entries_rule !== "ANY") {
43229
- const i = this._historyOrder.filter((s) => (s.direction !== e || e === "all") && !s.isPartClose && (s.realQty || 0) < (s.original_qty || 0));
43229
+ const i = this._notCloseHistoryOrders.filter((s) => (s.direction !== e || e === "all") && !s.isPartClose && !s.isTiggerClose);
43230
43230
  for (const s of i) {
43231
43231
  const { realQty: o = 0, original_qty: a = 0 } = s, c = a - o;
43232
43232
  if (s.realQty = o + (t >= c ? c : t), s.isTiggerClose = a <= s.realQty, r += c, t -= c, t <= 0)
@@ -43239,7 +43239,7 @@ ${z}`), z;
43239
43239
  const { close_entries_rule: t = "FIFO" } = this._options;
43240
43240
  let r = [];
43241
43241
  if (t === "FIFO") {
43242
- const i = this._historyOrder.filter((s) => s.id === e && (s.realQty || 0) < (s.original_qty || 0) && !s.isPartClose);
43242
+ const i = this._notCloseHistoryOrders.filter((s) => s.id === e && !s.isTiggerClose && !s.isPartClose);
43243
43243
  r = this._orders.filter((s) => s.id === e && (s.realQty || 0) < (s.original_qty || 0)), r = i.concat(r);
43244
43244
  } else
43245
43245
  r = this._orders.filter((i) => i.id === e && !i.close_qty);
@@ -43294,8 +43294,8 @@ ${z}`), z;
43294
43294
  return e;
43295
43295
  }
43296
43296
  _getUnCloseOrders() {
43297
- const e = this._notCloseHistoryOrders.filter((r) => !r.isTiggerClose), t = this._historyOrder.filter((r) => !r.isPartClose && !r.isTiggerClose);
43298
- return this._notCloseHistoryOrders = e, e.push(...t), e.push(...this._orders.filter((r) => !r.isTiggerClose)), e;
43297
+ const e = this._notCloseHistoryOrders.filter((t) => !t.isTiggerClose);
43298
+ return this._notCloseHistoryOrders = [...e], e.push(...this._orders.filter((t) => !t.isTiggerClose)), e;
43299
43299
  }
43300
43300
  _exit(e, t) {
43301
43301
  if (!e.hasOwnProperty("profit") && !e.hasOwnProperty("loss") && !e.hasOwnProperty("stop") && !e.hasOwnProperty("limit") && (!e.hasOwnProperty("trail_offset") || !e.hasOwnProperty("trail_price") && !e.hasOwnProperty("trail_points"))) {
@@ -43516,7 +43516,7 @@ ${z}`), z;
43516
43516
  profit_percent: O / A * 100,
43517
43517
  max_profit_percent: d / A * 100,
43518
43518
  trading_loss_percent: _ / A * 100
43519
- }), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), this._historyOrderLen += 1, this._historyOrder.length >= 1e3 && (this._historyOrdersShard.push(this._historyOrder), this._notCloseHistoryOrders.push(...this._historyOrder.filter((v) => !v.isTiggerClose && !v.isPartClose)), this._historyOrder = []), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, z);
43519
+ }), this._maxDrawdownVerifyIndex = this._variables.bar_index + (o ? 1 : 0), this._risk.intradayOrders += 1, this._historyOrder.push(e), this._historyOrderLen += 1, !e.isPartClose && (!e.isTiggerClose || e.isMarketPriceLimit || e.isMarketPriceStop) && this._notCloseHistoryOrders.push(e), this._historyOrder.length >= 1e3 && (this._historyOrdersShard.push(this._historyOrder), this._historyOrder = []), this._variables.strategy.updateHistoryOrder(e), !t && this._calcOrderFillsHandle(p, M, z);
43520
43520
  }
43521
43521
  _getCommission(e, t) {
43522
43522
  const { commission_value: r = 0, commission_type: i } = this._options, s = e * t;
@@ -43709,7 +43709,7 @@ ${z}`), z;
43709
43709
  });
43710
43710
  }
43711
43711
  const s = this._hlines.size ? [...this._hlines.values()] : void 0, o = this._fills.size ? this._getDataFromBarindex(e, [...this._fills.values()]) : void 0, a = this.log.logs.length ? this.log.logs : void 0;
43712
- this.log.clearLogs(), this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders });
43712
+ this.log.clearLogs(), this._options.scriptType === "strategy" && Object.assign(this._options, { orders: this.strategy.orders, historyOrders: this.strategy.historyOrders, strategySummary: this._variables.strategy.summaryData });
43713
43713
  const c = this._getDataFromBarindex(e, [...this._plots.values()]), p = this._plotbars.size > 0 ? this._getDataFromBarindex(e, [...this._plotbars.values()]) : void 0, b = this._plotarrows.size > 0 ? this._getDataFromBarindex(e, [...this._plotarrows.values()]) : void 0, M = this._plotcandles.size > 0 ? this._getDataFromBarindex(e, [...this._plotcandles.values()]) : void 0, l = this._plotchars.size > 0 ? this._getDataFromBarindex(e, [...this._plotchars.values()]) : void 0, z = this._plotshapes.size > 0 ? this._getDataFromBarindex(e, [...this._plotshapes.values()]) : void 0, O = this._getDrawDeletes(e), d = this._getDrawsFromBarindex(e), _ = this._variables.chart.isUseBgColor;
43714
43714
  return Object.assign({}, this._options, { plots: c, plotarrows: b, plotcandles: M, plotchars: l, plotbars: p, draws: d, drawDeletes: O, alerts: t, colors: i, hlines: s, fills: o, logs: a, plotshapes: z, isUseBgColor: _ });
43715
43715
  }
@@ -9160,7 +9160,7 @@ function mr(i, n, r) {
9160
9160
  function E1() {
9161
9161
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
9162
9162
  }
9163
- const kf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-CWAx2DV5.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9163
+ const kf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-BQFRfD9L.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9164
9164
  kf.onerror = (i) => {
9165
9165
  console.error(i);
9166
9166
  };