Skip to content

Close method in futures dual postion mode #16

Open
@peacmake

Description

@peacmake

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions