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

Close Position function #24

Open
Daniel-OM opened this issue Nov 5, 2020 · 0 comments
Open

Close Position function #24

Daniel-OM opened this issue Nov 5, 2020 · 0 comments

Comments

@Daniel-OM
Copy link

Daniel-OM commented Nov 5, 2020

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.

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

1 participant