An automated trading system for swing trading on Binance, focusing on managing SELL orders for existing BUY positions.
- Real-time price monitoring via WebSocket with REST API fallback
- Automated SELL order placement with configurable profit targets
- Independent handling of partial fills
- Position duration tracking and alerts
- Comprehensive order validation and state management
- Persistent state storage with SQLite
- Robust error handling and recovery
- Python 3.8+
- Binance API credentials
- SQLite3
- Clone the repository:
git clone https://github.com/yourusername/swing_trading_automat.git
cd swing_trading_automat
- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -e .
- Configure environment:
cp .env.example .env
# Edit .env with your Binance API credentials and preferences
- Run the application:
python main.py
- User Guide - Detailed usage instructions
- API Documentation - Internal API reference
- Deployment Guide - Production deployment instructions
- Design Documentation - System architecture and design
binance_swing_trading/
├── src/ # Source code
│ ├── config/ # Configuration management
│ ├── core/ # Core trading logic
│ ├── db/ # Database operations
│ └── utils/ # Utility functions
├── tools/ # CLI utilities
├── tests/ # Test suite
├── docs/ # Documentation
│ ├── user_guide/ # User documentation
│ ├── api/ # API documentation
│ └── deployment/ # Deployment guides
└── data/ # Data directory
├── trading.db # SQLite database
└── logs/ # Log files
Key configuration parameters in .env
:
BINANCE_API_KEY
- Your Binance API keyBINANCE_API_SECRET
- Your Binance API secretTRADING_SYMBOL
- Trading pair (e.g., TRUMPUSDC)MIN_PROFIT_PERCENTAGE
- Minimum profit target (default: 0.3%)MAX_SELL_VALUE_USDC
- Maximum order size in USDC
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Binance API documentation
- Python-Binance library
- SQLAlchemy ORM