Initial commit — Trading AI Secure project complet
Architecture Docker (8 services), FastAPI, TimescaleDB, Redis, Streamlit. Stratégies : scalping, intraday, swing. MLEngine + RegimeDetector (HMM). BacktestEngine + WalkForwardAnalyzer + Optuna optimizer. Routes API complètes dont /optimize async. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
202
README.md
Normal file
202
README.md
Normal file
@@ -0,0 +1,202 @@
|
||||
# 🤖 Trading AI Secure - Application de Trading Multi-Stratégie avec IA Adaptative
|
||||
|
||||
[](https://www.python.org/downloads/)
|
||||
[](LICENSE)
|
||||
[](docs/PROJECT_STATUS.md)
|
||||
|
||||
## 📋 Vue d'ensemble
|
||||
|
||||
**Trading AI Secure** est une plateforme de trading algorithmique avancée intégrant :
|
||||
- ✅ **IA Adaptative** avec auto-optimisation continue des paramètres
|
||||
- ✅ **Risk Management** intégré à tous les niveaux
|
||||
- ✅ **Multi-Stratégie** (Scalping, Intraday, Swing)
|
||||
- ✅ **Backtesting Anti-Overfitting** avec validation rigoureuse
|
||||
- ✅ **Intégration IG Markets** pour trading réel
|
||||
- ✅ **Sources de données gratuites** pour développement
|
||||
|
||||
## 🎯 Objectifs du Projet
|
||||
|
||||
### Objectif Principal
|
||||
Créer un système de trading automatisé où l'IA **ajuste continuellement ses paramètres** en fonction :
|
||||
- Des conditions de marché (régime détecté)
|
||||
- De la performance historique récente
|
||||
- Des métriques de risque en temps réel
|
||||
- Des corrélations inter-stratégies
|
||||
|
||||
### Philosophie de l'IA Adaptative
|
||||
L'IA est en **constante remise en question** :
|
||||
- ⚙️ Optimisation bayésienne des hyperparamètres
|
||||
- 🔄 Réévaluation quotidienne des seuils de décision
|
||||
- 📊 A/B testing automatique de variantes de stratégies
|
||||
- 🧠 Apprentissage par renforcement pour le position sizing
|
||||
- 🎲 Monte Carlo pour validation des changements
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
```
|
||||
trading_ai_secure/
|
||||
├── src/ # Code source principal
|
||||
│ ├── core/ # Moteur central (risk, orchestration)
|
||||
│ ├── strategies/ # Stratégies de trading modulaires
|
||||
│ ├── ml/ # Modèles IA adaptatifs
|
||||
│ ├── data/ # Connecteurs de données
|
||||
│ ├── backtesting/ # Framework de validation
|
||||
│ └── ui/ # Interface utilisateur
|
||||
├── config/ # Configurations YAML
|
||||
├── docs/ # Documentation complète
|
||||
├── tests/ # Tests unitaires et d'intégration
|
||||
├── logs/ # Logs système et trading
|
||||
└── data/ # Données historiques et cache
|
||||
```
|
||||
|
||||
## 🚀 Démarrage Rapide
|
||||
|
||||
### Prérequis
|
||||
```bash
|
||||
Python 3.11+
|
||||
pip ou poetry
|
||||
Git
|
||||
```
|
||||
|
||||
### Installation
|
||||
```bash
|
||||
# Cloner le repository
|
||||
git clone https://github.com/votre-username/trading-ai-secure.git
|
||||
cd trading-ai-secure
|
||||
|
||||
# Créer environnement virtuel
|
||||
python -m venv venv
|
||||
source venv/bin/activate # Linux/Mac
|
||||
# ou
|
||||
venv\Scripts\activate # Windows
|
||||
|
||||
# Installer dépendances
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Copier configuration exemple
|
||||
cp config/risk_limits.example.yaml config/risk_limits.yaml
|
||||
cp config/strategy_params.example.yaml config/strategy_params.yaml
|
||||
```
|
||||
|
||||
### Premier Lancement (Mode Démo)
|
||||
```bash
|
||||
# Lancer backtesting sur données historiques
|
||||
python src/main.py --mode backtest --strategy all
|
||||
|
||||
# Lancer paper trading
|
||||
python src/main.py --mode paper --strategy intraday
|
||||
|
||||
# Lancer dashboard
|
||||
streamlit run src/ui/dashboard.py
|
||||
```
|
||||
|
||||
## 📊 Fonctionnalités Clés
|
||||
|
||||
### 1. IA Adaptative Auto-Optimisante
|
||||
- **Optimisation continue** : Ajustement automatique des paramètres toutes les 24h
|
||||
- **Regime Detection** : Détection Bull/Bear/Sideways avec adaptation des stratégies
|
||||
- **Parameter Tuning** : Optimisation bayésienne (Optuna) des hyperparamètres
|
||||
- **Ensemble Learning** : Combinaison dynamique de modèles selon performance
|
||||
|
||||
### 2. Risk Management Multi-Niveaux
|
||||
- **Global Portfolio Risk** : Limite de risque total (2% capital)
|
||||
- **Per-Strategy Risk** : Allocation dynamique selon performance
|
||||
- **Position Sizing** : Kelly Criterion adaptatif
|
||||
- **Circuit Breakers** : Arrêt automatique si seuils dépassés
|
||||
|
||||
### 3. Stratégies Modulaires
|
||||
| Stratégie | Timeframe | Risk/Trade | Holding Max | Objectif |
|
||||
|-----------|-----------|------------|-------------|----------|
|
||||
| Scalping | 1-5 min | 0.5-1% | 30 min | Micro-mouvements |
|
||||
| Intraday | 15-60 min | 1-2% | 1 jour | Tendances journalières |
|
||||
| Swing | 4H-1D | 2-3% | 5 jours | Mouvements moyens |
|
||||
|
||||
### 4. Backtesting Rigoureux
|
||||
- **Walk-Forward Analysis** : Validation temporelle
|
||||
- **Out-of-Sample Testing** : 30% données réservées
|
||||
- **Monte Carlo Simulation** : 10,000+ scénarios
|
||||
- **Paper Trading Obligatoire** : 30 jours minimum avant live
|
||||
|
||||
## 📈 Métriques de Performance
|
||||
|
||||
### Seuils Minimaux pour Production
|
||||
```yaml
|
||||
Sharpe Ratio: > 1.5
|
||||
Max Drawdown: < 10%
|
||||
Win Rate: > 55%
|
||||
Profit Factor: > 1.3
|
||||
Calmar Ratio: > 0.5
|
||||
Recovery Factor: > 2.0
|
||||
```
|
||||
|
||||
## 🔐 Sécurité
|
||||
|
||||
- ✅ Validation pré-trade systématique
|
||||
- ✅ Stop-loss obligatoires sur toutes positions
|
||||
- ✅ Limite de corrélation entre positions (< 0.7)
|
||||
- ✅ Vérification margin en temps réel
|
||||
- ✅ Alertes multi-canaux (Telegram, Email, SMS)
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
- [📖 Guide de Démarrage](docs/GETTING_STARTED.md)
|
||||
- [🏗️ Architecture Détaillée](docs/ARCHITECTURE.md)
|
||||
- [🤖 Framework IA Adaptative](docs/AI_FRAMEWORK.md)
|
||||
- [⚠️ Risk Management](docs/RISK_FRAMEWORK.md)
|
||||
- [📊 Guide des Stratégies](docs/STRATEGY_GUIDE.md)
|
||||
- [🧪 Guide Backtesting](docs/BACKTESTING_GUIDE.md)
|
||||
- [🔌 Intégration IG Markets](docs/IG_INTEGRATION.md)
|
||||
- [📈 État d'Avancement](docs/PROJECT_STATUS.md)
|
||||
|
||||
## 🗓️ Roadmap
|
||||
|
||||
### Phase 1 : Architecture (Semaines 1-2) ⏳ En cours
|
||||
- [x] Structure projet
|
||||
- [x] Documentation complète
|
||||
- [ ] Risk Manager core
|
||||
- [ ] Strategy Engine
|
||||
- [ ] Data connectors (sources gratuites)
|
||||
|
||||
### Phase 2 : IA Adaptative (Semaines 3-4) 📅 Planifié
|
||||
- [ ] Modèles ML de base
|
||||
- [ ] Regime detection
|
||||
- [ ] Parameter optimization engine
|
||||
- [ ] Position sizing adaptatif
|
||||
|
||||
### Phase 3 : Stratégies (Semaines 5-6) 📅 Planifié
|
||||
- [ ] Scalping strategy
|
||||
- [ ] Intraday strategy
|
||||
- [ ] Swing strategy
|
||||
- [ ] Backtesting framework
|
||||
|
||||
### Phase 4 : Interface (Semaines 7-8) 📅 Planifié
|
||||
- [ ] Dashboard Streamlit
|
||||
- [ ] Risk monitoring
|
||||
- [ ] Système d'alertes
|
||||
|
||||
### Phase 5 : Production (Semaines 9-10) 📅 Planifié
|
||||
- [ ] Intégration IG Markets
|
||||
- [ ] Paper trading validation
|
||||
- [ ] Déploiement production
|
||||
|
||||
## 🤝 Contribution
|
||||
|
||||
Ce projet est en développement actif. Consultez [CONTRIBUTING.md](docs/CONTRIBUTING.md) pour les guidelines.
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License - voir [LICENSE](LICENSE) pour détails.
|
||||
|
||||
## ⚠️ Disclaimer
|
||||
|
||||
**AVERTISSEMENT IMPORTANT** : Ce logiciel est fourni à des fins éducatives uniquement. Le trading comporte des risques importants de perte en capital. Utilisez ce système à vos propres risques. Les performances passées ne garantissent pas les résultats futurs.
|
||||
|
||||
## 📞 Contact & Support
|
||||
|
||||
- 📧 Email: support@trading-ai-secure.com
|
||||
- 💬 Discord: [Rejoindre la communauté](https://discord.gg/trading-ai)
|
||||
- 📖 Wiki: [Documentation complète](https://github.com/votre-username/trading-ai-secure/wiki)
|
||||
|
||||
---
|
||||
|
||||
**Développé avec ❤️ pour le trading algorithmique sécurisé**
|
||||
Reference in New Issue
Block a user