Advertisement
mmyjh86

[러닝-자동매매] bithumb 시장가 매수 API

Oct 11th, 2019
1,326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import pybithumb
  2.  
  3. bithumb = pybithumb.Bithumb(
  4.         "public_key",
  5.         "private_key"
  6.         )
  7.  
  8. _, _, 현금, _ = bithumb.get_balance("XRP")
  9. print(현금)
  10.  
  11. orderbook = pybithumb.get_orderbook("XRP")
  12. asks = orderbook['asks']
  13. sell_price = asks[0]['price']
  14. unit = 현금/float(sell_price)
  15. print(unit)
  16.  
  17. order = bithumb.buy_market_order("XRP", unit)
  18. print(order)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement