- Python 3.8 or higher
- pip package manager
- Git
- SQLite3
- Binance account with API access
- Clone the repository:
git clone https://github.com/yourusername/swing_trading_automat.git
cd swing_trading_automat
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the package in development mode:
pip install -e .
- Create your environment file:
cp .env.example .env
- Edit
.env
with your settings:
# API Configuration
BINANCE_API_KEY=your_api_key_here
BINANCE_API_SECRET=your_api_secret_here
TRADING_SYMBOL=TRUMPUSDC
# Trading Parameters
MIN_PROFIT_PERCENTAGE=0.3
MAX_SELL_VALUE_USDC=100
POSITION_AGE_ALERT_HOURS=10
TRADING_SYMBOL
: The trading pair to monitor (e.g., TRUMPUSDC)MIN_PROFIT_PERCENTAGE
: Minimum profit target for SELL orders (default: 0.3%)MAX_SELL_VALUE_USDC
: Maximum order size in USDC (default: 100)POSITION_AGE_ALERT_HOURS
: Alert threshold for position age (default: 10)
- Ensure your virtual environment is activated:
source venv/bin/activate # On Windows: venv\Scripts\activate
- Run the application:
python main.py
Use the CLI utility for manual position management:
python -m tools.manage_positions list # List all positions
python -m tools.manage_positions view <order_id> # View specific position
python -m tools.manage_positions cancel <order_id> # Cancel an order
- Main log:
data/logs/trading.log
- Error log:
data/logs/error.log
Monitor the application status through:
- Log files in
data/logs/
- SQLite database at
data/trading.db
- CLI utility status command:
python -m tools.manage_positions status
-
WebSocket Connection Issues
- Check your internet connection
- Verify API credentials
- Check Binance API server status
-
Database Errors
- Ensure SQLite is installed
- Check file permissions for data directory
- Verify database file is not corrupted
-
Order Placement Failures
- Verify sufficient balance
- Check order size limits
- Validate trading pair availability
-
Application Crashes
- Check error logs at
data/logs/error.log
- Restart the application
- State will be recovered automatically
- Check error logs at
-
Invalid Configuration
- Verify .env file settings
- Check log files for configuration errors
- Ensure API credentials are valid
- Check the error logs
- Review the documentation
- Submit an issue on GitHub with:
- Error message
- Log snippets
- Steps to reproduce