websocket: add new events and use t/f to define ticker

This commit is contained in:
JacobPlaster
2020-04-16 10:42:40 +01:00
committed by Jacob Plaster
parent 554c8c6112
commit 1f300dd326
3 changed files with 22 additions and 13 deletions

View File

@@ -12,12 +12,12 @@ bfx = Client(
def log_error(err):
print ("Error: {}".format(err))
@bfx.ws.on('new_ticker')
def log_candle(ticker):
@bfx.ws.on('new_funding_ticker')
def log_ticker(ticker):
print ("New ticker: {}".format(ticker))
async def start():
await bfx.ws.subscribe('ticker', 'tBTCUSD')
await bfx.ws.subscribe('ticker', 'fUSD')
bfx.ws.on('connected', start)
bfx.ws.run()