Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Orders with multiple take profit price and size? #991

Answered by djwatt3
djwatt3 asked this question in Q&A
Discussion options

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

You must be logged in to vote

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.

https://github.com/freqtrade/freqtrade

Replies: 2 comments 1 reply

Comment options

Can this be done?

You must be logged in to vote
0 replies
Comment options

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.

https://github.com/freqtrade/freqtrade

You must be logged in to vote
1 reply
Comment options

Thanks mate!

Answer selected by djwatt3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /