update calculation

master
TZGyn 1 year ago
parent 8cb3d95f3f
commit f85c231be2
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -73,18 +73,19 @@ export const POST = async ({ locals, request }) => {
)
qty = (
(Number(wallet.result.list[0].totalAvailableBalance) *
Number(form.data.entryPrice) /
((Number(wallet.result.list[0].totalAvailableBalance) *
Number(form.data.qtyPercent)) /
100
).toFixed(2)
100)
).toString()
takeProfit = (
Number(form.data.entryPrice) *
(1 + Number(form.data.takeProfitPercent) / 100)
).toFixed(2)
).toString()
stopLoss = (
Number(form.data.entryPrice) *
(1 - Number(form.data.stopLossPercent) / 100)
).toFixed(2)
).toString(2)
}
console.log({ qty, takeProfit, stopLoss })

Loading…
Cancel
Save