-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
I would like to sell a long position at a set limit, instead of buying a short position with sell. Can anyone help?
Sample code:
def next(self):
if not self.position:
self.buy() # buys the long order
return
if self.position.is_long:
self.sell(size=self.position.size, limit=limit)
return
after the self.sell() and when reaching the next next() the self.position.is_short changes to True, which is not what I want. I would just like to buy and sell long positions.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment