adshao / go-binance

A Go SDK for Binance API
MIT License
1.48k stars 662 forks source link

how to close a market position #580

Open vadinabronin opened 1 week ago

vadinabronin commented 1 week ago

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 commented 1 week ago

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.