SETUP_GUIDE.md 5.3 KB

📱 Quick Setup Guide - Manual Trading Bot

🎯 What You're Getting

Complete manual control of your Hyperliquid account from your phone with professional trading statistics.

Phone Trading: Buy/sell from anywhere via Telegram
Full Statistics: Win rate, Sharpe ratio, Sortino, P&L, drawdown, etc.
Balance Tracking: Starting balance vs current with % returns
Trade History: Every trade logged with automatic P&L calculation
Risk Metrics: Professional-grade performance analytics
Safe Default: Starts in testnet mode

🚀 5-Minute Setup

Step 1: Create Telegram Bot (2 minutes)

  1. Open Telegram → Search @BotFather
  2. Send: /newbot
  3. Name your bot: "My Trading Bot"
  4. Username: something like mytradingbot_123_bot
  5. Save the token (looks like: 123456789:ABCdefGHIjklMNOPqrs)

Step 2: Get Your Chat ID (1 minute)

# In your terminal
python get_telegram_chat_id.py
  • Message your bot anything in Telegram
  • Copy the Chat ID from terminal output

Step 3: Configure Bot (2 minutes)

# Copy example config
cp env.example .env

# Edit with your info (use any text editor)
nano .env

Set these 4 things in .env:

HYPERLIQUID_PRIVATE_KEY=your_private_key_here
TELEGRAM_BOT_TOKEN=your_token_from_botfather
TELEGRAM_CHAT_ID=your_chat_id_from_script
TELEGRAM_ENABLED=true

Step 4: Start Trading!

python manual_trading_bot.py

That's it! 🎉 Open Telegram and send /start to your bot.

📱 What You Can Do

Instant Commands

  • /balance - Check balance + P&L
  • /stats - Complete trading statistics
  • /buy 0.001 50000 - Buy 0.001 BTC at $50,000
  • /sell 0.001 55000 - Sell 0.001 BTC at $55,000
  • /positions - Open positions
  • /orders - Pending orders

Quick Buttons

Send /start to see instant action buttons for one-tap:

  • 💰 Balance, 📊 Stats, 📈 Positions, 📋 Orders, 💵 Price

📊 Statistics You Get

From the moment you first launch, the bot tracks:

📊 Trading Statistics

💰 Balance Overview
 Initial: $1,000.00         Your starting balance
 Current: $1,150.00         Real-time balance  
 Total P&L: $150.00         Profit/Loss
 Total Return: 15.00%       % return

📈 Trading Activity  
 Total Trades: 25           Complete count
 Buy Orders: 13             Trade breakdown
 Sell Orders: 12
 Days Active: 30            Time since first launch

🏆 Performance Metrics
 Win Rate: 68.0%            % profitable trades
 Profit Factor: 2.15        Gains ÷ Losses  
 Avg Win: $45.50            Average profitable trade
 Avg Loss: $28.75           Average losing trade
 Expectancy: $6.25          Expected $ per trade

📊 Risk Metrics
 Sharpe Ratio: 1.85         Risk-adjusted returns
 Sortino Ratio: 2.41        Downside risk metric
 Max Drawdown: 8.5%         Worst decline from peak
 Volatility: 12.3%          Price volatility  
 VaR (95%): 3.2%           Value at Risk

🎯 Best/Worst
 Largest Win: $125.00       Best single trade
 Largest Loss: $75.00       Worst single trade
 Max Consecutive Wins: 5    Winning streaks
 Max Consecutive Losses: 2  Losing streaks

🛡️ Safety Features

✅ Testnet First

  • Starts in testnet by default (fake money)
  • Test everything before real trading
  • Switch to mainnet when ready

✅ Order Confirmations

  • Every trade needs confirmation
  • Clear order details shown
  • Easy cancel button

✅ Complete Logging

  • All trades automatically recorded
  • Statistics saved between restarts
  • Full audit trail with order IDs

🔧 Where Are Your Keys?

Hyperliquid Private Key

Testnet (for learning):

  1. Go to Hyperliquid Testnet
  2. Create/connect wallet → Export private key

Mainnet (real money):

  1. Go to Hyperliquid
  2. Connect wallet → Export private key

⚠️ Keep private keys secure - never share them!

🎮 Try the Demo

See what your statistics will look like:

python demo_stats.py

This creates sample trading data so you can see all the metrics the bot tracks.

🔍 Troubleshooting

"Configuration validation failed"

  • Check your .env file has all 4 required fields
  • Make sure TELEGRAM_ENABLED=true

"Telegram bot not responding"

  • Verify bot token from @BotFather
  • Check Chat ID from get_telegram_chat_id.py
  • Make sure you messaged your bot first

"Private key not set"

  • Get private key from Hyperliquid (see above)
  • Add to .env file

🎯 Quick Commands Reference

# Setup
python get_telegram_chat_id.py    # Get Chat ID
python demo_stats.py              # See sample statistics  
python manual_trading_bot.py      # Start trading bot

# Test configuration  
python -c "from config import Config; Config.validate()"

📈 What Makes This Special

  • No coding required - Just use Telegram commands
  • Professional analytics - Same metrics as trading platforms
  • Phone optimized - Trade from anywhere
  • Comprehensive tracking - Every stat you need
  • Persistent data - Statistics saved between sessions
  • Safe by default - Testnet mode prevents accidents

You get institutional-grade trading analytics with simple phone control! 🚀📱