Exemplo n.º 1
0
Arquivo: utils.py Projeto: patok/jesse
 def async_save() -> None:
     Orderbook.insert(**d).on_conflict_ignore().execute()
     print(
         jh.color(
             f'orderbook: {jh.timestamp_to_time(d["timestamp"])}-{exchange}-{symbol}: [{orderbook[0][0][0]}, {orderbook[0][0][1]}], [{orderbook[1][0][0]}, {orderbook[1][0][1]}]',
             'magenta'
         )
     )
Exemplo n.º 2
0
 def async_save():
     Orderbook.insert(**d).on_conflict_ignore().execute()
     print(
         jh.color(
             'orderbook: {}-{}-{}: [{}, {}], [{}, {}]'.format(
                 jh.timestamp_to_time(d['timestamp']), exchange, symbol,
                 # best ask
                 orderbook[0][0][0], orderbook[0][0][1],
                 # best bid
                 orderbook[1][0][0], orderbook[1][0][1]
             ),
             'magenta'
         )
     )