From b0f67f8ed9dd56ffdbf9f7bc499d0ba89d257244 Mon Sep 17 00:00:00 2001 From: Igor Kroitor Date: Fri, 16 Oct 2020 22:51:09 +0300 Subject: [PATCH] examples/ccxt.pro/py/bitvavo-watch-order-book.py #6659 --- .../ccxt.pro/py/bitvavo-watch-order-book.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 examples/ccxt.pro/py/bitvavo-watch-order-book.py diff --git a/examples/ccxt.pro/py/bitvavo-watch-order-book.py b/examples/ccxt.pro/py/bitvavo-watch-order-book.py new file mode 100644 index 0000000000000..c27c8940626de --- /dev/null +++ b/examples/ccxt.pro/py/bitvavo-watch-order-book.py @@ -0,0 +1,27 @@ +import ccxtpro +from asyncio import get_event_loop + + +print('CCXT Pro version', ccxtpro.__version__) + + +async def main(loop): + exchange = ccxtpro.bitvavo({ + 'enableRateLimit': True, + 'asyncio_loop': loop, + }) + await exchange.load_markets() + exchange.verbose = True + symbol = 'BTC/EUR' + while True: + try: + orderbook = await exchange.watch_order_book(symbol) + print(orderbook['nonce'], symbol, orderbook['asks'][0], orderbook['bids'][0]) + except Exception as e: + print(type(e).__name__, str(e)) + break + await exchange.close() + + +loop = get_event_loop() +loop.run_until_complete(main(loop)) \ No newline at end of file