-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
How I can place a new buy order with multiple take profits and different size?
example
sizes = [0.50, 0.25, 0.25] order = self.buy(sl=stopLoss) order.setTP1(size=sizes[0], limit=tp1) order.setTP2(size=sizes[1], limit=tp2) order.setTP3(size=sizes[2], limit=tp3)
Thanks
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
djwatt3
Jul 20, 2023
Yes,
trade = self.trades[0]
trade.close(portion = 0.50)
in this way you'll close 50% of your last order.
btw I switched to another framework better documented with a community and that allow you to do automatic live trading.
Replies: 2 comments 1 reply
-
Can this be done?
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
-
Yes,
trade = self.trades[0]
trade.close(portion = 0.50)
in this way you'll close 50% of your last order.
btw I switched to another framework better documented with a community and that allow you to do automatic live trading.
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
Thanks mate!
Beta Was this translation helpful? Give feedback.
All reactions
Answer selected by
djwatt3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment