scope360-core 0.0.509 → 0.0.510

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.
@@ -29891,10 +29891,10 @@ function O_(t) {
29891
29891
  } else
29892
29892
  return t;
29893
29893
  }
29894
- function q4(t, e, n) {
29895
- const s = parseFloat(t.entry_price), i = t.amount, a = t.pair.toLowerCase(), r = t.side, l = ((d) => d.endsWith("jpy") ? 1e3 : d.startsWith("xau") || d.endsWith("f.t") || d.endsWith(".b") || d.endsWith("sek") || d.endsWith("mxn") || d.endsWith("xpd") || d.endsWith("xag") || d.endsWith("xbr") || d.endsWith("xng") || d.endsWith("xpt") || d.endsWith("xti") ? 100 : d === "cocoa" || d === "coffee" ? 1 : d === "brent" ? 100 : 1e5)(a);
29894
+ function q4(t, e) {
29895
+ const n = parseFloat(t.entry_price), s = t.amount, i = t.pair.toLowerCase(), a = t.side, r = t.leverage, l = ((d) => d.endsWith("jpy") ? 1e3 : d.startsWith("xau") || d.endsWith("f.t") || d.endsWith(".b") || d.endsWith("sek") || d.endsWith("mxn") || d.endsWith("xpd") || d.endsWith("xag") || d.endsWith("xbr") || d.endsWith("xng") || d.endsWith("xpt") || d.endsWith("xti") ? 100 : d === "cocoa" || d === "coffee" ? 1 : d === "brent" ? 100 : 1e5)(i);
29896
29896
  let u = 0, c = 0;
29897
- return r === "LONG" ? (u = (e.bid - s) * i * l, c = u / (i * s * l / n)) : r === "SHORT" && (u = (s - e.ask) * i * l, c = u / (i * s * l / n)), { pnl: u, pnl_roi: c };
29897
+ return a === "LONG" ? (u = (e.bid - n) * s * l, c = u / (s * n * l / r)) : a === "SHORT" && (u = (n - e.ask) * s * l, c = u / (s * n * l / r)), { pnl: u, pnl_roi: c };
29898
29898
  }
29899
29899
  function G4(t, e) {
29900
29900
  const n = parseFloat(t.entry_price), s = t.amount, i = t.multiplier, a = t.side;