lolokraus / DegiroAPI

An unofficial API for the trading platform Degiro, with the ability to get real time data and historical data
MIT License
215 stars 86 forks source link

Close Position function #24

Open Daniel-OM opened 3 years ago

Daniel-OM commented 3 years ago

Hello.

There isn't any function for closing a position. I am trying to improvise a function which gets the position size and direction of the ticker requested to put a marketorder of the oposite direction (if you where long then a short order) with the same size. But in your portfolio function there is no way to get the direction of the position, so I get the long or short bias by the sign of price minus break even price. If the sign is negative it is long, if positive it is short. If you could do a specific function for this it would be really helpfull.

Thank you for all the work.