Open
Description
I would like to place an order to close a long position in futures dual position mode.
The API manual says "In dual position mode, to close one side position, you need to set auto_size side, reduce_only to true and size to 0",
so I coded and ran it as follows.
const params = { contract: symbol, size: 0, price: 0, auto_size:"close_long", reduce_only: true, tif: "ioc" };
createFuturesOrder("usdt", params);
If I run it, I see an 'invalid size with close-order' error message.
If I change that code to size: 1
and run it, a long position is created,
If I change size: -1
, a short position is created.
How can I close my positions?
Metadata
Metadata
Assignees
Labels
No labels