Implementing stop loss and take profit orders #66
-
Hi there - love the library! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hey I'm glad you like the package! Currently we don't offer stop orders (besides a super secret stop limit in Coinbase Pro) although we really want to implement those! Binance gave us a lot of issues when we tried to implement it last time. I will add this to our backlog for our round 2 - we are just trying to develop features by demand right now. You can implement a very accurate stop limit engine if you're interested by using a websocket feed or and placing the limit at the activate price: import blankly
def new_price(price):
print(price)
# could check to see if any limits should be placed at this activate price
if __name__ == "__main__":
manager = blankly.TickerManager('coinbase_pro', 'BTC-USD')
manager.create_ticker(new_price) You can also just rapidly query the price, or even use the |
Beta Was this translation helpful? Give feedback.
-
Sounds good. I'm excited for this feature to land in the future! In the meantime, I've decided to give this a bit of a go myself, aka a poor-man's version of it. Trades
Book
Stop losses
Hope this might help you and others! |
Beta Was this translation helpful? Give feedback.
-
This feature has been implemented: https://docs.blankly.finance/orders/take_profit_order |
Beta Was this translation helpful? Give feedback.
Sounds good. I'm excited for this feature to land in the future! In the meantime, I've decided to give this a bit of a go myself, aka a poor-man's version of it.
The basic premise of my approach is to assemble a
book
of open positions from most recenttrade
's, and pass those around invariables
. Below, you can find some pseudo-code:Trades
Book