๐ง Source Installation Guide¶
Difficulty: โญโญโญ Advanced
Time: 15 minutes
โ Prerequisites¶
- Python 3.11+ (Get Python)
- Git (Get Git)
- pip (Python package manager)
- API Keys (Twelve Data, Alpha Vantage)
๐ Quick Start¶
1. Clone Repository¶
2. Create Virtual Environment (Recommended)¶
# Create virtual environment
python3 -m venv venv
# Activate (Linux/macOS)
source venv/bin/activate
# Activate (Windows)
venv\Scripts\activate
3. Install Dependencies¶
4. Install in Development Mode¶
5. Verify Installation¶
โ๏ธ Configuration¶
1. Copy Configuration Templates¶
2. Edit Configuration¶
Required API Keys:
TWELVE_DATA_API_KEY=your_key_here
ALPHA_VANTAGE_API_KEY=your_key_here
LANGUAGE=en # or 'zh' for Chinese
๐ฏ Usage¶
Interactive Mode¶
Direct Commands¶
# Trading signals
ta sig
# Support/Resistance
ta sr
# Position calculator
ta pos --symbol NVDA --price 175 --capital 10000
# All analysis
ta all
๐งช Development¶
Run Tests¶
Run Linter¶
Make Changes¶
-
Create feature branch:
-
Make changes and test
-
Commit changes:
-
Push and create PR:
๐ Project Structure¶
trading-assistant/
โโโ cli.py # CLI entry point
โโโ config.py # Configuration management
โโโ i18n.py # Internationalization
โโโ position_calculator.py # Position sizing
โโโ stop_loss_alerts.py # Alert management
โโโ technical_analysis.py # Technical indicators
โโโ pyproject.toml # Project metadata
โโโ requirements.txt # Dependencies
โโโ .env.example # Environment template
โโโ watchlist.txt.example # Watchlist template
โโโ docs/ # Documentation
โ โโโ index.md
โ โโโ CLI.md
โ โโโ guides/
โ โโโ docker-install.md
โ โโโ pip-install.md
โ โโโ npm-install.md
โ โโโ source-install.md
โโโ .github/workflows/ # CI/CD workflows
โโโ docker-publish.yml
โโโ pypi-publish.yml
โโโ publish-npm.yml
โโโ publish-gh.yml
๐ Update from Source¶
# Pull latest changes
git pull origin main
# Update dependencies
pip install -r requirements.txt --upgrade
# Reinstall in development mode
pip install -e .
# Verify version
ta --version
๐๏ธ Uninstall¶
# Uninstall package
pip uninstall openclaw-trading-assistant
# Remove virtual environment (if created)
rm -rf venv
# Remove cloned repository
cd ..
rm -rf trading-assistant
โ Troubleshooting¶
Dependency Conflicts¶
# Upgrade pip
pip install --upgrade pip
# Clear pip cache
pip cache purge
# Reinstall dependencies
pip install -r requirements.txt --force-reinstall
Import Errors¶
# Make sure you're in the project directory
cd trading-assistant
# Make sure virtual environment is activated
source venv/bin/activate # Linux/macOS
# Reinstall in development mode
pip install -e .
Python Version Issues¶
# Check Python version
python3 --version
# If < 3.11, upgrade Python
# macOS: brew install python@3.11
# Ubuntu: sudo apt install python3.11
# Windows: Download from python.org
๐ Next Steps¶
- CLI Documentation - Learn all commands
- Contributing Guide - How to contribute
- API Documentation - Code-level documentation