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.
package/dist/scope360-core.js
CHANGED
|
@@ -29891,10 +29891,10 @@ function O_(t) {
|
|
|
29891
29891
|
} else
|
|
29892
29892
|
return t;
|
|
29893
29893
|
}
|
|
29894
|
-
function q4(t, e
|
|
29895
|
-
const
|
|
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
|
|
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;
|