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)
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')}" )
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)
async def balance_callback(exchange, balance): if get_should_display_callbacks_logs(): logging.info(f"BALANCE : EXCHANGE = {exchange} || BALANCE = {balance}")
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}" )
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}" )
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}" )
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}" )
async def ticker_callback(exchange, symbol, ticker): if get_should_display_callbacks_logs(): logging.info( f"TICKER : EXCHANGE = {exchange} || SYMBOL = {symbol} || TICKER = {ticker}" )
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}")
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}")
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}")
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}")
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}")
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}")
async def time_callback(timestamp): if get_should_display_callbacks_logs(): logging.info(f"TIME : TIMESTAMP = {timestamp}")
async def trades_callback(exchange, symbol, trade): if get_should_display_callbacks_logs(): logging.info( f"TRADES : EXCHANGE = {exchange} || SYMBOL = {symbol} || TRADE = {trade}" )
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}")