Skip to content

Commit

Permalink
examples/ccxt.pro/py/bitvavo-watch-order-book.py ccxt#6659
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Oct 16, 2020
1 parent 4686267 commit b0f67f8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions examples/ccxt.pro/py/bitvavo-watch-order-book.py
Original file line number Diff line number Diff line change
@@ -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))

0 comments on commit b0f67f8

Please sign in to comment.