![]() Also, Binance extremely easy to use and learn. The most used and at the same time the most reliable crypto exchange platform is Binance. close_connection () if _name_ = "_main_" : loop = asyncio. get_asks ()) print ( "Top 5 bids:" ) print ( depth_cache. start () def handle_socket_message ( msg ): print ( f "message type: " ) print ( "Top 5 asks:" ) print ( depth_cache. start () # depth cache manager using threads dcm = ThreadedDepthCacheManager () dcm. ![]() KLINE_INTERVAL_1WEEK, "1 Jan, 2017" ) # socket manager using threads twm = ThreadedWebsocketManager () twm. get_historical_klines ( "NEOBTC", Client. KLINE_INTERVAL_30MINUTE, "1 Dec, 2017", "1 Jan, 2018" ) # fetch weekly klines since it listed klines = client. get_historical_klines ( "ETHBTC", Client. KLINE_INTERVAL_1MINUTE, "1 day ago UTC" ) # fetch 30 minute klines for the last month of 2017 klines = client. get_historical_klines ( "BNBBTC", Client. get_deposit_address ( coin = 'BTC' ) # get historical kline data from any date range # fetch 1 minute klines for the last day up until now klines = client. get_withdraw_history ( coin = 'ETH' ) # get a deposit address for BTC address = client. get_withdraw_history () # fetch list of ETH withdrawals eth_withdraws = client. withdraw ( asset = 'ETH', address = '', amount = 100 ) except BinanceAPIException as e : print ( e ) else : print ( "Success" ) # fetch list of withdrawals withdraws = client. get_all_tickers () # withdraw 100 ETH # check docs for assumptions around withdrawals from binance.exceptions import BinanceAPIException try : result = client. ORDER_TYPE_MARKET, quantity = 100 ) # get all symbol prices prices = client. ![]() ![]() create_test_order ( symbol = 'BNBBTC', side = Client. get_order_book ( symbol = 'BNBBTC' ) # place a test market buy order, to place an actual order use the create_order function order = client. From binance import Client, ThreadedWebsocketManager, ThreadedDepthCacheManager client = Client ( api_key, api_secret ) # get market depth depth = client. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |