Example #1
0
async def positions_callback(exchange, symbol, position, is_closed, is_updated,
                             is_from_bot):
    if get_should_display_callbacks_logs():
        logging.info(
            f"POSITIONS : EXCHANGE = {exchange} || SYMBOL = {symbol} || POSITIONS = {position}"
            f"|| CLOSED = {is_closed} || UPDATED = {is_updated} || FROM_BOT = {is_from_bot}"
        )
async def orders_callback(exchange: str, exchange_id: str, symbol: str,
                          order: dict, is_new, is_from_bot):
    if get_should_display_callbacks_logs():
        order_string = f"ORDERS : EXCHANGE = {exchange} || SYMBOL = {symbol} ||"
        order_string += PrettyPrinter.open_order_pretty_printer(
            exchange, order)
        order_string += f"|| CREATED = {is_new} || FROM_BOT = {is_from_bot}"
        logging.info(order_string)
Example #3
0
async def balance_profitability_callback(
        exchange, profitability, profitability_percent,
        market_profitability_percent, initial_portfolio_current_profitability):
    if get_should_display_callbacks_logs():
        logging.info(
            f"BALANCE PROFITABILITY : EXCHANGE = {exchange} || PROFITABILITY = "
            f"{PrettyPrinter.portfolio_profitability_pretty_print(profitability, profitability_percent, 'USDT')}"
        )
Example #4
0
async def orders_callback(exchange: str, exchange_id: str, symbol: str,  order: dict, is_closed, is_updated, is_from_bot):
    if get_should_display_callbacks_logs():
        order_string = f"ORDERS : EXCHANGE = {exchange} || SYMBOL = {symbol} ||"
        if is_closed:
            # order_string += PrettyPrinter.trade_pretty_printer(exchange, order)
            order_string += PrettyPrinter.open_order_pretty_printer(exchange, order)
        else:
            order_string += PrettyPrinter.open_order_pretty_printer(exchange, order)

        order_string += f"|| CLOSED = {is_closed} || UPDATED = {is_updated} || FROM_BOT = {is_from_bot}"
        logging.info(order_string)
Example #5
0
async def balance_callback(exchange, balance):
    if get_should_display_callbacks_logs():
        logging.info(f"BALANCE : EXCHANGE = {exchange} || BALANCE = {balance}")
Example #6
0
async def kline_callback(exchange, symbol, time_frame, kline):
    if get_should_display_callbacks_logs():
        logging.info(
            f"KLINE : EXCHANGE = {exchange} || SYMBOL = {symbol} || TIME FRAME = {time_frame} || KLINE = {kline}"
        )
Example #7
0
async def recent_trades_callback(exchange, symbol, recent_trades):
    if get_should_display_callbacks_logs():
        logging.info(
            f"RECENT TRADE : EXCHANGE = {exchange} || SYMBOL = {symbol} || RECENT TRADE = {recent_trades}"
        )
Example #8
0
async def ohlcv_callback(exchange, symbol, time_frame, candle):
    if get_should_display_callbacks_logs():
        logging.info(
            f"OHLCV : EXCHANGE = {exchange} || SYMBOL = {symbol} || TIME FRAME = {time_frame} || CANDLE = {candle}"
        )
Example #9
0
async def order_book_callback(exchange, symbol, asks, bids):
    if get_should_display_callbacks_logs():
        logging.info(
            f"ORDERBOOK : EXCHANGE = {exchange} || SYMBOL = {symbol} || ASKS = {asks} || BIDS = {bids}"
        )
Example #10
0
async def ticker_callback(exchange, symbol, ticker):
    if get_should_display_callbacks_logs():
        logging.info(
            f"TICKER : EXCHANGE = {exchange} || SYMBOL = {symbol} || TICKER = {ticker}"
        )
Example #11
0
async def order_book_callback(exchange: str, exchange_id: str, cryptocurrency: str, symbol: str,  asks, bids):
    if cli.get_should_display_callbacks_logs():
        logging.info(f"ORDERBOOK : EXCHANGE = {exchange} || SYMBOL = {symbol} || ASKS = {asks} || BIDS = {bids}")
Example #12
0
async def positions_callback(exchange: str, exchange_id: str, cryptocurrency: str, symbol: str,  position, is_closed, is_updated, is_liquidated: bool, is_from_bot):
    if cli.get_should_display_callbacks_logs():
        logging.info(f"POSITIONS : EXCHANGE = {exchange} || SYMBOL = {symbol} || POSITIONS = {position}"
                     f"|| CLOSED = {is_closed} || UPDATED = {is_updated} || FROM_BOT = {is_from_bot}")
Example #13
0
async def trades_callback(exchange: str, exchange_id: str, cryptocurrency: str, symbol: str, trade: dict, old_trade: bool):
    if cli.get_should_display_callbacks_logs():
        logging.info(f"TRADES : EXCHANGE = {exchange} || SYMBOL = {symbol} || TRADE = {trade} "
                     f"|| OLD_TRADE = {old_trade}")
Example #14
0
async def kline_callback(exchange: str, exchange_id: str, cryptocurrency: str, symbol: str, time_frame, kline):
    if cli.get_should_display_callbacks_logs():
        logging.info(
            f"KLINE : EXCHANGE = {exchange} || SYMBOL = {symbol} || TIME FRAME = {time_frame} || KLINE = {kline}")
Example #15
0
async def recent_trades_callback(exchange: str, exchange_id: str, cryptocurrency: str, symbol: str,  recent_trades):
    if cli.get_should_display_callbacks_logs():
        logging.info(f"RECENT TRADE : EXCHANGE = {exchange} || SYMBOL = {symbol} || RECENT TRADE = {recent_trades}")
Example #16
0
async def ohlcv_callback(exchange: str, exchange_id: str, cryptocurrency: str, symbol: str,  time_frame, candle):
    if cli.get_should_display_callbacks_logs():
        logging.info(
            f"OHLCV : EXCHANGE = {exchange} || CRYPTOCURRENCY = {cryptocurrency} || SYMBOL = {symbol} "
            f"|| TIME FRAME = {time_frame} || CANDLE = {candle}")
Example #17
0
async def time_callback(timestamp):
    if get_should_display_callbacks_logs():
        logging.info(f"TIME : TIMESTAMP = {timestamp}")
Example #18
0
async def trades_callback(exchange, symbol, trade):
    if get_should_display_callbacks_logs():
        logging.info(
            f"TRADES : EXCHANGE = {exchange} || SYMBOL = {symbol} || TRADE = {trade}"
        )
Example #19
0
async def ticker_callback(exchange: str, exchange_id: str, cryptocurrency: str, symbol: str,  ticker):
    if cli.get_should_display_callbacks_logs():
        logging.info(f"TICKER : EXCHANGE = {exchange} || SYMBOL = {symbol} || TICKER = {ticker}")