An automated trading system for Binance using Python.
swing_trade_automat_2/
├── docs/ # Documentation and development plans
├── logs/ # Trading logs and performance plots
│ └── plots/ # Generated trading performance visualizations
├── model/ # Trained ML models
├── src/ # Source code
├── tools/ # Analysis and utility tools
├── venv/ # Python virtual environment
├── .env # Environment variables (not in git)
└── requirements.txt # Python dependencies
- Clone the repository:
# Clone using HTTPS
git clone https://github.com/padak/swing_trade_automat_2.git
# or clone using SSH
git clone [email protected]:padak/swing_trade_automat_2.git
# Navigate to the project directory
cd swing_trade_automat_2
- Create required directories:
mkdir -p logs/plots model
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Unix/macOS
# or
.\venv\Scripts\activate # On Windows
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file in the root directory with your Binance API credentials:
BINANCE_API_KEY=your_api_key_here
BINANCE_API_SECRET=your_api_secret_here
# Optional trading parameters (defaults will be used if not set)
SYMBOL=TRUMPUSDC
INVEST_USD=500
PROFIT_THRESHOLD_PERCENT=0.002
SLEEP_TIME=300 # 5 minutes in seconds
# Strategy parameters (optional)
FAST_MA_PERIOD=10
SLOW_MA_PERIOD=30
RSI_PERIOD=14
RSI_OVERBOUGHT=70
RSI_OVERSOLD=35
- Start the trading bot:
python src/trend_detector_v2_gemini.py
- Analyze trading performance:
python tools/analyze_trading_log.py
- View trading performance plots:
python tools/plot_log.py
- Inspect the trained model:
python tools/inspect_model.py
logs/
: Contains trading activity logs and performance metricsplots/
: Generated visualizations of trading performance
model/
: Stores trained machine learning modelssrc/
: Main trading bot implementationtools/
: Utility scripts for analysis and visualizationanalyze_trading_log.py
: Analyzes trading performance and suggests improvementsplot_log.py
: Generates visual performance chartsinspect_model.py
: Examines the trained ML model parameters
Follow the incremental development plan outlined in docs/DEVELOPER_PLAN.md
.
- Check the trading log in
logs/trading_log.csv
for detailed trade history - View performance plots in
logs/plots/trading_performance.png
- Monitor model performance using the analysis tools in the
tools/
directory
-
If you see "Model not found" errors:
- Run the trading bot first to generate the initial model
- Check that the
model/
directory exists
-
If you see "Log file not found" errors:
- Ensure the trading bot has been run at least once
- Verify the
logs/
directory exists
-
If plots are not generating:
- Ensure the
logs/plots/
directory exists - Check that matplotlib is properly installed
- Verify there is data in the trading log file
- Ensure the