First Launch
Why Two Separate Bots?
The ByNinja Trading Bot operates using a highly stable dual-process architecture. The Telegram Bot and the Trading Bot run independently. This ensures that even if one process encounters an unexpected error, the other continues working seamlessly. The run.sh script acts as a process manager, automatically restarting the bots if they crash, guaranteeing 24/7 uninterrupted operation.
For ultimate reliability, the system is split into two isolated processes. If the trading engine faces network latency or an unexpected python exception, your Telegram control remains fully responsive. The run.sh script will instantly restart the crashed process. Both bots communicate with each other seamlessly via a secure local TCP connection.
By default, the bots synchronize their actions through the following local TCP port (configured in your settings):
TCP_SERVER_PORT = 551101. Launch the Telegram Bot
First, open your terminal and navigate to the root directory of the bot repository. Start the Telegram bot process. It acts as your control center and notification system.
cd byninja-trading-bot./run.sh telegramExpected Telegram Bot Logs
TelegramBot - INFO - đ Checking Telegram connection...
TelegramBot - INFO - Telegram connected | Bot: @Bot
TelegramBot - INFO - â
Telegram connected successfully
TelegramBot - INFO - đ Telegram command menu registered successfully.
TelegramTCP - INFO - đ TCP server started on port 55110
TelegramBot - INFO - đ¯ Server ready to work on port 55110
TelegramTCP - INFO - đ Waiting for client connection...
TelegramBot - INFO - đĄ All TCP messages will be forwarded to Telegram
TelegramTCP - INFO - đ Server started on localhost:55110
TelegramBot - INFO - đšī¸ Telegram command handler started...
TelegramTCP - INFO - đ Client connected: ('*.*.*.*', *****)2. Launch the Trading Bot
Open a new terminal window, navigate to the repository root again, and launch the core trading engine. This process handles the actual market analysis and Binance execution.
cd byninja-trading-bot./run.sh tradingExpected Trading Bot Logs
TradingBot - DEBUG - đĨˇ BYNINJA TRADING BOT v0.1.0
TradingBot - DEBUG - ============================================================
TradingBot - INFO - â
Loaded 0 records from active_positions.pkl
TradingBot - DEBUG - đ Background save thread started
TradingBot - INFO - đ File pending_orders.pkl not found, creating new
TradingBot - DEBUG - đ Background save thread started
TradingBot - INFO - đ File symbol_controls.pkl not found, creating new
TradingBot - DEBUG - đ Background save thread started
TradingBot - INFO - â
Loaded 11 records from closed_trades_v0.1.0.pkl
TradingBot - DEBUG - đ Background save thread started
TradingBot - INFO - đ RiskManager initialized for version 0.1.0
TradingBot - INFO - đ Loaded 11 closed trades
TradingBot - INFO - đĨˇ ByNinja Trading Bot initialization with capital: $1000.00
TradingBot - INFO - â
Successfully connected to Binance
TradingBot - DEBUG - đ¯ Available trading pairs: 5
TradingBot - DEBUG - Â Â - AVAXUSDT
TradingBot - DEBUG - Â Â - LINKUSDT
TradingBot - DEBUG - Â Â - DOTUSDT
TradingBot - DEBUG - Â Â - XRPUSDT
TradingBot - DEBUG - Â Â - ATOMUSDT
TradingBot - INFO - đ Starting TCP client
TradingTCP - INFO - đ Connecting to TCP server...
TradingTCP - INFO - â
Connected to server localhost:55110
TradingTCP - INFO - â
TCP client connected successfully
TradingBot - INFO - đĨˇ STARTUP BYNINJA TRADING BOT v0.1.0
TradingBot - DEBUG - đ Intelligent monitoring for AVAXUSDT
TradingBot - DEBUG - đ Intelligent monitoring for LINKUSDT
TradingBot - DEBUG - đ Intelligent monitoring for DOTUSDT
TradingBot - DEBUG - đ Intelligent monitoring for XRPUSDT
TradingBot - INFO - đ Started monitoring for:
  - AVAXUSDT
  - LINKUSDT
  - DOTUSDT
  - XRPUSDT
  - ATOMUSDT
TradingBot - DEBUG - đ Intelligent monitoring for ATOMUSDT
TradingBot - DEBUG - â
All systems started. Bot is active.
TradingBot - DEBUG - đĄ Bot active. Press Ctrl+C to stop.
TradingBot - DEBUG - đ° Balance: USDT=$32024.00, assets: 2303. Active Monitoring & Trading
Once the Trading Bot is active, it continuously monitors your specified pairs for EMA cross signals, analyzes volume spikes, and executes trades with pinpoint accuracy. You will see real-time market analysis logs.
TradingBot - DEBUG - DOTUSDT  | ENTRY | $  1.2370 | S200 -0.004%>-0.008% đĸ | S50 -0.012%>+0.005% đ´ | S20 -0.004%>+0.010% đ´ | D200/50 -0.145%>+0.060% đ´ | D50/20 -0.123%>+0.080% đ´ | Vol  0.1x>1.2x đ´
TradingBot - DEBUG - XRPUSDT Â | EXIT Â | $ Â 1.3913 | PnL: +0.24% đĸ | TS: +0.06% | TP: +2.30% | SL: -1.15% | Time: 05:07:27
TradingBot - DEBUG - ATOMUSDT  | ENTRY | $  1.9630 | S200 -0.015%>-0.008% đ´ | S50 -0.018%>+0.005% đ´ | S20 -0.024%>+0.010% đ´ | D200/50 -0.322%>+0.070% đ´ | D50/20 -0.102%>+0.110% đ´ | Vol  0.3x>1.2x đ´
TradingBot - DEBUG - DOTUSDT  | ENTRY | $  1.2370 | S200 -0.004%>-0.008% đĸ | S50 -0.012%>+0.005% đ´ | S20 -0.004%>+0.010% đ´ | D200/50 -0.145%>+0.060% đ´ | D50/20 -0.123%>+0.080% đ´ | Vol  0.1x>1.2x đ´
TradingBot - DEBUG - LINKUSDT  | ENTRY | $  9.2800 | S200 -0.009%>-0.008% đ´ | S50 -0.015%>+0.005% đ´ | S20 -0.017%>+0.010% đ´ | D200/50 -0.226%>+0.060% đ´ | D50/20 -0.104%>+0.090% đ´ | Vol  0.0x>1.2x đ´
TradingBot - DEBUG - XRPUSDT Â | EXIT Â | $ Â 1.3913 | PnL: +0.24% đĸ | TS: +0.06% | TP: +2.30% | SL: -1.15% | Time: 05:07:28
TradingBot - DEBUG - AVAXUSDT  | ENTRY | $  9.2700 | S200 +0.001%>-0.008% đĸ | S50 -0.002%>+0.005% đ´ | S20 +0.016%>+0.010% đĸ | D200/50 -0.177%>+0.060% đ´ | D50/20 -0.102%>+0.100% đ´ | Vol  2.6x>1.2x đĸ
TradingBot - DEBUG - LINKUSDT  | ENTRY | $  9.2800 | S200 -0.009%>-0.008% đ´ | S50 -0.015%>+0.005% đ´ | S20 -0.017%>+0.010% đ´ | D200/50 -0.226%>+0.060% đ´ | D50/20 -0.104%>+0.090% đ´ | Vol  0.0x>1.2x đ´
TradingBot - DEBUG - DOTUSDT  | ENTRY | $  1.2370 | S200 -0.004%>-0.008% đĸ | S50 -0.012%>+0.005% đ´ | S20 -0.004%>+0.010% đ´ | D200/50 -0.145%>+0.060% đ´ | D50/20 -0.123%>+0.080% đ´ | Vol  0.1x>1.2x đ´
TradingBot - DEBUG - AVAXUSDT  | ENTRY | $  9.2800 | S200 +0.002%>-0.008% đĸ | S50 +0.002%>+0.005% đ´ | S20 +0.026%>+0.010% đĸ | D200/50 -0.174%>+0.060% đ´ | D50/20 -0.096%>+0.100% đ´ | Vol  2.6x>1.2x đĸ
TradingBot - DEBUG - XRPUSDT Â | EXIT Â | $ Â 1.3914 | PnL: +0.25% đĸ | TS: +0.06% | TP: +2.30% | SL: -1.15% | Time: 05:07:57
TradingBot - DEBUG - ATOMUSDT  | ENTRY | $  1.9630 | S200 -0.015%>-0.008% đ´ | S50 -0.018%>+0.005% đ´ | S20 -0.024%>+0.010% đ´ | D200/50 -0.322%>+0.070% đ´ | D50/20 -0.102%>+0.110% đ´ | Vol  0.3x>1.2x đ´
TradingBot - DEBUG - LINKUSDT  | ENTRY | $  9.2900 | S200 -0.008%>-0.008% đĸ | S50 -0.010%>+0.005% đ´ | S20 -0.005%>+0.010% đ´ | D200/50 -0.229%>+0.060% đ´ | D50/20 -0.098%>+0.090% đ´ | Vol  0.0x>1.2x đ´
TradingBot - DEBUG - XRPUSDT Â | EXIT Â | $ Â 1.3913 | PnL: +0.24% đĸ | TS: +0.06% | TP: +2.30% | SL: -1.15% | Time: 05:08:27
TradingBot - DEBUG - AVAXUSDT  | ENTRY | $  9.2700 | S200 +0.004%>-0.008% đĸ | S50 +0.002%>+0.005% đ´ | S20 +0.024%>+0.010% đĸ | D200/50 -0.175%>+0.060% đ´ | D50/20 -0.088%>+0.100% đ´ | Vol  0.5x>1.2x đ´