reset_data.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 bot state persistence file
  20. if [ -f "bot_state.json" ]; then
  21. rm bot_state.json
  22. echo "✅ Removed bot_state.json"
  23. fi
  24. # Remove alarm data
  25. if [ -f "price_alarms.json" ]; then
  26. rm price_alarms.json
  27. echo "✅ Removed price_alarms.json"
  28. fi
  29. rm -f alarms.json alarms.db
  30. echo "✅ Removed legacy alarm data"
  31. # Remove log files
  32. rm -f *.log trading_bot.log*
  33. rm -rf logs/
  34. echo "✅ Removed log files"
  35. # Remove any temporary files
  36. rm -f *.tmp *.temp
  37. echo "✅ Removed temporary files"
  38. # Remove any Python cache
  39. rm -rf __pycache__/
  40. rm -rf src/__pycache__/
  41. rm -rf tests/__pycache__/
  42. echo "✅ Removed Python cache"
  43. echo ""
  44. echo "🎉 Data reset complete!"
  45. echo ""
  46. echo "📝 What was cleared:"
  47. echo " • Trading statistics and P&L history"
  48. echo " • All completed trade records"
  49. echo " • Daily/weekly/monthly performance data"
  50. echo " • Bot state persistence (pending stop losses, order tracking)"
  51. echo " • Price alarms and notifications"
  52. echo " • Log files and debugging data"
  53. echo " • Enhanced position tracking data"
  54. echo ""
  55. echo "🚀 Your bot is now ready for a fresh start!"
  56. echo " • Initial balance will be reset"
  57. echo " • All stats will start from zero"
  58. echo " • Position tracking will reinitialize"
  59. echo " • Bot state persistence will restart fresh"
  60. echo " • Pending stop losses will be cleared"
  61. echo ""
  62. echo "💡 Next steps:"
  63. echo " 1. Run your bot: python src/telegram_bot.py"
  64. echo " 2. Check /balance to set initial balance"
  65. echo " 3. Start trading to build new statistics"