update calculation

master
TZGyn 10 months ago
parent f85c231be2
commit 1446ec92ab
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -73,10 +73,10 @@ export const POST = async ({ locals, request }) => {
) )
qty = ( qty = (
Number(form.data.entryPrice) / (Number(form.data.entryPrice) *
((Number(wallet.result.list[0].totalAvailableBalance) *
Number(form.data.qtyPercent)) / Number(form.data.qtyPercent)) /
100) 100 /
Number(wallet.result.list[0].totalAvailableBalance)
).toString() ).toString()
takeProfit = ( takeProfit = (
Number(form.data.entryPrice) * Number(form.data.entryPrice) *
@ -85,7 +85,7 @@ export const POST = async ({ locals, request }) => {
stopLoss = ( stopLoss = (
Number(form.data.entryPrice) * Number(form.data.entryPrice) *
(1 - Number(form.data.stopLossPercent) / 100) (1 - Number(form.data.stopLossPercent) / 100)
).toString(2) ).toString()
} }
console.log({ qty, takeProfit, stopLoss }) console.log({ qty, takeProfit, stopLoss })
@ -99,8 +99,6 @@ export const POST = async ({ locals, request }) => {
takeProfit, takeProfit,
stopLoss, stopLoss,
}) })
console.log(order.result.orderId)
} catch (error) { } catch (error) {
console.log('Error', error) console.log('Error', error)
} finally { } finally {

Loading…
Cancel
Save