diff --git a/src/routes/webhook/tradingview/+server.ts b/src/routes/webhook/tradingview/+server.ts index c67eccc..46259fe 100644 --- a/src/routes/webhook/tradingview/+server.ts +++ b/src/routes/webhook/tradingview/+server.ts @@ -88,10 +88,9 @@ export const POST = async ({ locals, request }) => { ) qty = ( - (Number(form.data.entryPrice) * - Number(form.data.qtyPercent)) / - 100 / - Number(wallet.result.list[0].totalAvailableBalance) + (Number(wallet.result.list[0].totalAvailableBalance) * + (Number(form.data.qtyPercent) / 100)) / + Number(form.data.entryPrice) ).toFixed(getDecimalPoint(symbol.slice(0, -4))) takeProfit = ( Number(form.data.entryPrice) *