Monitoring and Analysis
This guide covers how to monitor your trading bots, analyze performance, and maintain the system effectively.
Monitoring Overview
Effective monitoring involves:
- Real-time tracking of bot status and trades
- Performance analysis to understand profitability
- System health monitoring for technical issues
- Risk assessment to manage exposure
Web Interface Monitoring
Accessing the Interface
- Single strategy: http://localhost:8101
- Multiple strategies: http://localhost:810X (X = 1,2,3…)
- Login: Use credentials from
.env
file
Key Dashboard Sections
Overview Dashboard
- Current Performance: Profit/loss, open trades
- Bot Status: Running, stopped, errors
- Market Summary: Active trading pairs
- Recent Activity: Latest trades and signals
Trades Tab
- Open Positions: Current active trades
- Trade History: Completed trades with P&L
- Trade Details: Entry/exit prices, duration
- Filtering: By date, profit/loss, trading pair
- Profit Charts: Visual performance over time
- Statistics: Win rate, average profit, drawdown
- Daily/Weekly/Monthly: Performance breakdowns
- Comparison: Strategy performance comparisons
Logs Tab
- Real-time logs: Live bot activity
- Error messages: Issues requiring attention
- Debug information: Detailed operation data
- Log filtering: By severity and category
Command Line Monitoring
Quick Status Check
# Check all running bots
docker ps --filter name=freqtrade
# Monitor specific strategy
docker logs -f freqtrade-NFI
# System status overview
./scripts/monitor-bots.sh
Detailed Bot Monitoring
# Strategy-specific logs
docker logs freqtrade-NFI | tail -100
# Error checking
docker logs freqtrade-NFI 2>&1 | grep -i error
# Trade activity
docker logs freqtrade-NFI | grep -E "(bought|sold|profit)"
# Real-time log following
docker logs -f freqtrade-NFI
Proxy and System Health
# Check binance-proxy status
./scripts/monitor-proxy.sh
# System resource usage
docker stats
# Disk space monitoring
df -h
du -sh /your-data-directory/*
Telegram Monitoring
Available Commands
Send these to your Telegram bot:
Status Commands
/status
- Current open trades and performance
/profit
- Profit/loss summary
/daily
- Today’s performance
/weekly
- Week’s performance
/monthly
- Month’s performance
/balance
- Account balance information
/trades
- Recent trade history
/performance
- Detailed performance metrics
/help
- Available commands list
Automated Notifications
Your bot automatically sends:
- Trade alerts: New positions opened/closed
- Daily summaries: End-of-day performance
- Error notifications: System issues
- Milestone alerts: Significant profit/loss events
Key Metrics to Track
Profitability Metrics
- Total Profit/Loss: Absolute returns in USDT
- ROI Percentage: Return on investment
- Daily/Weekly Returns: Performance trends
- Profit Factor: Gross profit ÷ gross loss
Risk Metrics
- Maximum Drawdown: Largest loss from peak
- Current Drawdown: Present decline from peak
- Volatility: Standard deviation of returns
- Risk-Adjusted Returns: Sharpe ratio
Trade Metrics
- Win Rate: Percentage of profitable trades
- Average Win/Loss: Mean profit vs mean loss
- Trade Frequency: Number of trades per day
- Holding Time: Average trade duration
Daily Review (5 minutes)
- Check bot status - All strategies running?
- Review overnight activity - Any significant trades?
- Check error logs - Any issues to address?
- Verify system health - Proxy working, no resource issues?
Weekly Review (30 minutes)
- Performance analysis - Which strategies performed best?
- Market condition assessment - How did market changes affect bots?
- Risk evaluation - Drawdowns within acceptable limits?
- Strategy comparison - Relative performance analysis
Monthly Review (2 hours)
- Comprehensive P&L analysis - Detailed profit/loss breakdown
- Strategy effectiveness - Which strategies to continue/stop?
- Risk management review - Adjust position sizes or risk parameters?
- Market cycle analysis - How strategies performed in different conditions
System Maintenance
Regular Maintenance Tasks
Daily
# Check system health
./scripts/monitor-bots.sh
# Verify proxy status
./scripts/monitor-proxy.sh
# Review error logs
docker logs freqtrade-YourStrategy 2>&1 | grep -i error
Weekly
# Update market data
docker exec freqtrade-YourStrategy freqtrade download-data
# Backup databases
./scripts/backup.sh
# Check disk space
df -h
Monthly
# Update strategies
./scripts/update-strategies.sh
# Rotate API keys (security best practice)
# Update .env file and restart bots
# Review and clean old logs
find /your-data-directory -name "*.log" -mtime +30 -delete
Health Monitoring Scripts
Monitor All Bots
#!/bin/bash
# scripts/monitor-bots.sh
echo "=== Trading Bot Status ==="
date
for container in $(docker ps --filter name=freqtrade --format ""); do
strategy=$(echo $container | sed 's/freqtrade-//')
status=$(docker inspect -f '' $container)
uptime=$(docker inspect -f '' $container)
echo "Strategy: $strategy"
echo "Status: $status"
echo "Started: $uptime"
echo "---"
done
# Check proxy
if docker ps | grep -q binance-proxy; then
echo "Binance Proxy: RUNNING ✅"
else
echo "Binance Proxy: STOPPED ❌"
fi
Resource Monitoring
# Check resource usage
docker stats --no-stream --format "table \t\t"
# Monitor disk space
df -h | grep -E '(Filesystem|/dev/)'
# Check for memory issues
free -h
Alert Setup
System Alerts
Set up monitoring for critical issues:
Disk Space Alert
# Add to crontab for daily check
# 0 9 * * * /path/to/disk-check.sh
#!/bin/bash
THRESHOLD=90
USAGE=$(df -h | grep '/dev/' | awk '{print $5}' | sed 's/%//')
if [ $USAGE -gt $THRESHOLD ]; then
echo "Disk usage is ${USAGE}% - Clean up required"
# Send alert via Telegram or email
fi
Bot Health Alert
# Check if all bots are running
# */10 * * * * /path/to/health-check.sh
#!/bin/bash
for strategy in NFI ReinforcedQuickie BbandRsi; do
if ! docker ps | grep -q "freqtrade-$strategy"; then
echo "ALERT: $strategy bot is not running!"
# Restart or send notification
fi
done
Bot Not Trading
Symptoms: No new trades for extended period
Checks:
- Market conditions - Is strategy suitable for current market?
- Configuration - Are trading pairs still active?
- Balance - Sufficient funds for new trades?
- API limits - Any rate limiting issues?
Symptoms: Consistent losses or underperformance
Analysis:
- Compare with dry-run results
- Check market conditions vs backtesting period
- Review strategy parameters
- Consider market regime changes
High Drawdown
Symptoms: Losses exceeding comfortable levels
Actions:
- Reduce position sizes
- Implement stricter stop-losses
- Pause strategy during unfavorable conditions
- Review risk management settings
System Overload
Symptoms: Slow response, high CPU/memory usage
Solutions:
- Reduce number of concurrent strategies
- Increase monitoring intervals
- Clean up old data and logs
- Upgrade hardware if needed
Best Practices
Monitoring Discipline
- Set regular schedules - Daily quick checks, weekly reviews
- Document findings - Keep notes on performance and issues
- Stay objective - Don’t let emotions drive decisions
- Plan responses - Know what to do for different scenarios
- Focus on risk-adjusted returns - Not just absolute profits
- Consider market conditions - Strategies perform differently in various markets
- Regular strategy evaluation - Pause underperforming strategies
- Continuous learning - Understand why strategies succeed or fail
Risk Management
- Set clear limits - Maximum drawdown, position sizes
- Regular reviews - Weekly risk assessment
- Emergency procedures - Know how to quickly stop trading
- Diversification - Don’t rely on single strategy or market
Next Steps
Master monitoring with: