You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: