mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 16:28:06 +00:00
26 lines
656 B
Python
26 lines
656 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import asyncio
|
|
import ccxt.pro
|
|
|
|
from datetime import datetime
|
|
|
|
async def loop(exchange, symbol):
|
|
since = datetime.utcnow()
|
|
timestamp = int(since.timestamp() * 1000)
|
|
while True:
|
|
trades = await exchange.watch_trades(symbol, since=timestamp)
|
|
print('--------------------------------------------------------------')
|
|
print('Received', len(trades), 'after', exchange.iso8601 (timestamp))
|
|
print('waiting for next update...')
|
|
|
|
|
|
async def main():
|
|
exchange = ccxt.pro.gateio()
|
|
await loop(exchange, 'BTC/USDT')
|
|
await exchange.close()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
asyncio.run(main())
|