trading stop prevent creating order if position exist

master
TZGyn 6 months ago
parent cde506401b
commit f5833aa9fb
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -51,6 +51,15 @@ export const POST = async ({ locals, request }) => {
mode: 3, mode: 3,
}) })
const position = await client.getPositionInfo({
category: 'linear',
symbol: symbol,
})
if (position.result.list.length > 0) {
return new Response()
}
const wallet = await client.getWalletBalance({ const wallet = await client.getWalletBalance({
accountType: 'UNIFIED', accountType: 'UNIFIED',
coin: 'USDT', coin: 'USDT',

Loading…
Cancel
Save