fix emojies
This commit is contained in:
@@ -36,7 +36,7 @@ class BinanceExample:
|
||||
if isinstance(data, OrderBookSnapshot):
|
||||
self.orderbook_count += 1
|
||||
logger.info(
|
||||
f"📊 Order Book {self.orderbook_count}: {data.symbol} - "
|
||||
f"Order Book {self.orderbook_count}: {data.symbol} - "
|
||||
f"Mid: ${data.mid_price:.2f}, Spread: ${data.spread:.2f}, "
|
||||
f"Bids: {len(data.bids)}, Asks: {len(data.asks)}"
|
||||
)
|
||||
@@ -68,22 +68,22 @@ class BinanceExample:
|
||||
logger.info(" Connected to Binance successfully")
|
||||
|
||||
# Get available symbols
|
||||
logger.info("📋 Getting available symbols...")
|
||||
logger.info("Getting available symbols...")
|
||||
symbols = await self.connector.get_symbols()
|
||||
logger.info(f"📋 Found {len(symbols)} trading symbols")
|
||||
logger.info(f"Found {len(symbols)} trading symbols")
|
||||
|
||||
# Show some popular symbols
|
||||
popular_symbols = ['BTCUSDT', 'ETHUSDT', 'ADAUSDT', 'BNBUSDT']
|
||||
available_popular = [s for s in popular_symbols if s in symbols]
|
||||
logger.info(f"📋 Popular symbols available: {available_popular}")
|
||||
logger.info(f"Popular symbols available: {available_popular}")
|
||||
|
||||
# Get order book snapshot
|
||||
if 'BTCUSDT' in symbols:
|
||||
logger.info("📊 Getting BTC order book snapshot...")
|
||||
logger.info("Getting BTC order book snapshot...")
|
||||
orderbook = await self.connector.get_orderbook_snapshot('BTCUSDT', depth=10)
|
||||
if orderbook:
|
||||
logger.info(
|
||||
f"📊 BTC Order Book: Mid=${orderbook.mid_price:.2f}, "
|
||||
f"BTC Order Book: Mid=${orderbook.mid_price:.2f}, "
|
||||
f"Spread=${orderbook.spread:.2f}"
|
||||
)
|
||||
|
||||
@@ -102,18 +102,18 @@ class BinanceExample:
|
||||
logger.info(" Subscribed to ETHUSDT order book")
|
||||
|
||||
# Let it run for a while
|
||||
logger.info("⏳ Collecting data for 30 seconds...")
|
||||
logger.info("Collecting data for 30 seconds...")
|
||||
await asyncio.sleep(30)
|
||||
|
||||
# Show statistics
|
||||
stats = self.connector.get_binance_stats()
|
||||
logger.info("📈 Final Statistics:")
|
||||
logger.info(f" 📊 Order books received: {self.orderbook_count}")
|
||||
logger.info("Final Statistics:")
|
||||
logger.info(f" Order books received: {self.orderbook_count}")
|
||||
logger.info(f" 💰 Trades received: {self.trade_count}")
|
||||
logger.info(f" 📡 Total messages: {stats['message_count']}")
|
||||
logger.info(f" Errors: {stats['error_count']}")
|
||||
logger.info(f" 🔗 Active streams: {stats['active_streams']}")
|
||||
logger.info(f" 📋 Subscriptions: {list(stats['subscriptions'].keys())}")
|
||||
logger.info(f" Subscriptions: {list(stats['subscriptions'].keys())}")
|
||||
|
||||
# Unsubscribe and disconnect
|
||||
logger.info("🔌 Cleaning up...")
|
||||
@@ -129,7 +129,7 @@ class BinanceExample:
|
||||
logger.info(" Disconnected successfully")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logger.info("⏹️ Interrupted by user")
|
||||
logger.info("Interrupted by user")
|
||||
except Exception as e:
|
||||
logger.error(f" Example failed: {e}")
|
||||
finally:
|
||||
|
||||
@@ -45,7 +45,7 @@ class MultiExchangeManager:
|
||||
try:
|
||||
if isinstance(data, OrderBookSnapshot):
|
||||
self.data_received[exchange]['orderbooks'] += 1
|
||||
logger.info(f"📊 {exchange.upper()}: Order book for {data.symbol} - "
|
||||
logger.info(f"{exchange.upper()}: Order book for {data.symbol} - "
|
||||
f"Bids: {len(data.bids)}, Asks: {len(data.asks)}")
|
||||
|
||||
# Show best bid/ask if available
|
||||
@@ -102,7 +102,7 @@ class MultiExchangeManager:
|
||||
if connector.is_connected:
|
||||
# Subscribe to order book
|
||||
await connector.subscribe_orderbook(symbol)
|
||||
logger.info(f"📈 Subscribed to {symbol} order book on {name}")
|
||||
logger.info(f"Subscribed to {symbol} order book on {name}")
|
||||
|
||||
# Subscribe to trades
|
||||
await connector.subscribe_trades(symbol)
|
||||
@@ -131,7 +131,7 @@ class MultiExchangeManager:
|
||||
|
||||
def _print_statistics(self):
|
||||
"""Print current data statistics."""
|
||||
logger.info("📊 Current Statistics:")
|
||||
logger.info("Current Statistics:")
|
||||
total_orderbooks = 0
|
||||
total_trades = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user