Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to close a market position #580

Open
vadinabronin opened this issue Jun 23, 2024 · 3 comments
Open

how to close a market position #580

vadinabronin opened this issue Jun 23, 2024 · 3 comments

Comments

@vadinabronin
Copy link

very poor list of examples, terrible. without examples, the practical meaning of this library simply tends to zero, so write how I can close the entire position that I have open,

err := client.ClosePosition().Symbol("DOGEUSDT").Do(context.Background() - it doesn’t work at all

@xyq-c-cpp
Copy link
Collaborator

It is implemented by users of this package in my opinion. You can use the basic interface provided here to implement this tool interface.
How to implement this? you can get a target position by account interface, and then create an order with target quantities and target price which is needed in LIMIT order type.

@vadinabronin
Copy link
Author

        if err != nil {
            return err
        }
        pos := res.Positions``` - it doesn't work at all, it gives zeros everywhere in the positions, it doesn't display anything

@xyq-c-cpp
Copy link
Collaborator

what's your code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants