reset_data.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. echo "🗑️ Resetting Hyperliquid Trading Bot Data"
  3. echo "========================================="
  4. # Confirm with user
  5. read -p "⚠️ This will delete ALL trading data, stats, and logs. Are you sure? (yes/no): " confirm
  6. if [ "$confirm" != "yes" ]; then
  7. echo "❌ Reset cancelled."
  8. exit 1
  9. fi
  10. echo "🧹 Clearing data files..."
  11. # Remove trading statistics
  12. if [ -f "trading_stats.json" ]; then
  13. rm trading_stats.json
  14. echo "✅ Removed trading_stats.json"
  15. fi
  16. # Remove backup stats
  17. rm -f trading_stats.json.backup*
  18. echo "✅ Removed stats backups"
  19. # Remove alarm data
  20. rm -f alarms.json alarms.db
  21. echo "✅ Removed alarm data"
  22. # Remove log files
  23. rm -f *.log trading_bot.log*
  24. rm -rf logs/
  25. echo "✅ Removed log files"
  26. # Remove any temporary files
  27. rm -f *.tmp *.temp
  28. echo "✅ Removed temporary files"
  29. # Remove any Python cache
  30. rm -rf __pycache__/
  31. rm -rf src/__pycache__/
  32. rm -rf tests/__pycache__/
  33. echo "✅ Removed Python cache"
  34. echo ""
  35. echo "🎉 Data reset complete!"
  36. echo ""
  37. echo "📝 What was cleared:"
  38. echo " • Trading statistics and P&L history"
  39. echo " • All completed trade records"
  40. echo " • Daily/weekly/monthly performance data"
  41. echo " • Price alarms and notifications"
  42. echo " • Log files and debugging data"
  43. echo " • Enhanced position tracking data"
  44. echo ""
  45. echo "🚀 Your bot is now ready for a fresh start!"
  46. echo " • Initial balance will be reset"
  47. echo " • All stats will start from zero"
  48. echo " • Position tracking will reinitialize"
  49. echo ""
  50. echo "💡 Next steps:"
  51. echo " 1. Run your bot: python src/telegram_bot.py"
  52. echo " 2. Check /balance to set initial balance"
  53. echo " 3. Start trading to build new statistics"