π§ 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