English Readme is under French :
Un programme Python avancé pour scanner automatiquement les cryptomonnaies sur KuCoin et exécuter des trades basés sur les signaux EMA20 avec gestion automatique des Stop Loss et Take Profits via les niveaux de Fibonacci.
- Scan temps réel de tous les coins sur KuCoin
- Détection EMA20 : Identifie les coins qui franchissent leur EMA20 en timeframe 4h
- Filtre volume : Détecte les augmentations de volume >50% par rapport à la bougie précédente
- Filtre futures : Ne sélectionne que les coins avec contrats perpétuels disponibles
- Nouveaux listings : Surveillance continue des nouveaux coins listés
- Ordres intelligents : Placement automatique d'ordres d'achat avec SL/TP
- Fibonacci intégré : Calcul automatique des niveaux TP basés sur les retracements/extensions Fibonacci (timeframe 15min)
- Gestion des risques : Stop Loss configurables et Take Profits multiples (TP1, TP2, TP3)
- Taille de position adaptative : Calcul automatique basé sur le risque défini
- Interface Streamlit moderne et intuitive
- Dashboard en temps réel avec métriques de performance
- Configuration flexible : Paramétrage complet des stratégies
- Logs détaillés : Suivi de toutes les transactions et signaux
- Graphiques de performance : Visualisation des résultats
- Python 3.8 ou supérieur
- Compte KuCoin avec API activée
- TA-Lib installé sur votre système
# Cloner le projet
git clone <repository-url>
cd kucoin-ema-scanner
# Installer les dépendances Python
pip install -r requirements.txt
# Installation de TA-Lib (requis pour l'analyse technique)
# Sur Windows : télécharger le wheel depuis https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
# Sur macOS : brew install ta-lib
# Sur Ubuntu/Debian : sudo apt-get install libta-lib-devCréez un fichier .env à la racine du projet :
# Configuration KuCoin API
KUCOIN_API_KEY=your_api_key_here
KUCOIN_API_SECRET=your_api_secret_here
KUCOIN_PASSPHRASE=your_passphrase_here
KUCOIN_SANDBOX=true # false pour le trading réel
# Configuration optionnelle
LOG_LEVEL=INFO- Connectez-vous à votre compte KuCoin
- Allez dans API Management dans les paramètres
- Créez une nouvelle API avec les permissions :
- General (lecture du compte)
- Trade (placement d'ordres)
- Futures (accès aux contrats à terme)
- Notez bien votre Passphrase lors de la création
- Configurez les restrictions IP si nécessaire
Le fichier config.py contient tous les paramètres configurables :
# Scanner
SCAN_INTERVAL = 60 # Intervalle de scan en secondes
VOLUME_THRESHOLD = 50 # Seuil d'augmentation du volume en %
EMA_PERIOD = 20 # Période EMA
# Trading
DEFAULT_POSITION_SIZE = 100 # Taille de position en USDT
DEFAULT_SL_PERCENT = 2.0 # Stop Loss en %
TP1_PERCENT = 1.5 # Take Profit 1 en %
TP2_PERCENT = 3.0 # Take Profit 2 en %
TP3_PERCENT = 5.0 # Take Profit 3 en %# Lancer l'interface graphique
streamlit run main.py
# Ou directement
python main.py# Vérifier l'installation et la configuration
python main.py --test
# Afficher l'aide
python main.py --help- Configuration : Ajustez les paramètres dans la barre latérale
- Démarrage : Cliquez sur "
▶️ Démarrer" pour lancer le scanner automatique - Surveillance : Consultez l'onglet "🎯 Signaux" pour voir les détections
- Trading : Exécutez les trades manuellement ou configurez l'automatisation
- Suivi : Surveillez vos positions dans "💼 Trades Actifs"
/kucoin-ema-scanner/
├── main.py # Point d'entrée principal
├── scanner.py # Logic de scan et détection des signaux
├── trading.py # Gestion des ordres et du trading
├── gui.py # Interface utilisateur Streamlit
├── config.py # Configuration globale
├── requirements.txt # Dépendances Python
├── README.md # Documentation
├── .env # Variables d'environnement (à créer)
└── trading.log # Fichier de logs (généré automatiquement)
- EMA20 Crossover : Le prix franchit l'EMA20 à la hausse sur timeframe 4h
- Volume Spike : Augmentation du volume >50% par rapport à la bougie précédente
- Contrat Future : Le coin doit avoir un contrat perpétuel disponible sur KuCoin
- Entrée : Ordre au marché lors de la détection du signal
- Stop Loss : Calculé automatiquement (défaut : 2% sous le prix d'entrée)
- Take Profits : 3 niveaux basés sur les extensions de Fibonacci
- TP1 : 1/3 de la position (niveau 1.272 ou 1.5% par défaut)
- TP2 : 1/3 de la position (niveau 1.414 ou 3% par défaut)
- TP3 : 1/3 de la position (niveau 1.618 ou 5% par défaut)
- Timeframe : 15 minutes pour plus de précision
- Swing Points : Détection automatique des hauts/bas récents
- Niveaux utilisés :
- Extensions : 1.272, 1.414, 1.618, 2.0, 2.618
- Retracements : 0.236, 0.382, 0.5, 0.618, 0.786
- Surveillance continue de tous les marchés KuCoin
- Détection automatique des nouveaux listings
- Filtrage intelligent des signaux de qualité
- Métriques en temps réel : Solde, positions, performance
- Graphiques interactifs : Évolution des P&L, historique des trades
- Logs détaillés : Traçabilité complète des opérations
- Configuration dynamique : Modification des paramètres sans redémarrage
- Position Sizing : Calcul automatique basé sur le risque défini
- Stop Loss adaptatif : Ajustement selon la volatilité du marché
- Take Profits échelonnés : Réduction progressive du risque
- Limite de drawdown : Protection contre les pertes importantes
- Pertes financières : Le trading comportes des risques de perte en capital
- Volatilité : Les cryptomonnaies sont extrêmement volatiles
- Bugs logiciels : Aucun programme n'est exempt d'erreurs
- Conditions de marché : Les stratégies peuvent ne pas fonctionner dans tous les environnements
- Testez d'abord en sandbox avant le trading réel
- Commencez avec de petits montants pour valider la stratégie
- Surveillez régulièrement les positions ouvertes
- Sauvegardez vos clés API en sécurité
- Gardez le logiciel à jour pour les correctifs de sécurité
- Utilisez des clés API avec permissions limitées
- Configurez des restrictions IP sur vos clés API
- Ne partagez jamais vos clés API ou passphrase
- Utilisez un VPN si vous tradez depuis des réseaux publics
- Gardez des sauvegardes de votre configuration
Erreur "Exchange non initialisé"
- Vérifiez vos clés API dans le fichier
.env - Assurez-vous que les permissions API sont correctes
- Testez la connexion avec
python main.py --test
Erreur "TA-Lib non trouvé"
- Installez TA-Lib pour votre système d'exploitation
- Redémarrez votre environnement Python après installation
Aucun signal détecté
- Vérifiez que le seuil de volume n'est pas trop élevé
- Assurez-vous que les marchés sont actifs (heures de trading)
- Consultez les logs pour identifier d'éventuelles erreurs
Interface Streamlit ne se charge pas
- Vérifiez que le port 8501 n'est pas utilisé
- Essayez
streamlit run main.py --server.port 8502 - Videz le cache avec
streamlit cache clear
- CCXT : Connexion aux exchanges de cryptomonnaies
- TA-Lib : Analyse technique et calculs d'indicateurs
- Pandas : Manipulation et analyse de données
- Streamlit : Interface utilisateur web
- Plotly : Graphiques interactifs
Les contributions sont les bienvenues ! Pour contribuer :
- Forkez le projet
- Créez une branche pour votre fonctionnalité (
git checkout -b feature/nouvelle-fonctionnalite) - Committez vos changements (
git commit -am 'Ajout nouvelle fonctionnalité') - Poussez vers la branche (
git push origin feature/nouvelle-fonctionnalite) - Ouvrez une Pull Request
- Support d'autres exchanges (Binance, OKX, etc.)
- Stratégies de trading additionnelles
- Backtesting intégré
- Notifications (Discord, Telegram, email)
- Mode paper trading
- API REST pour intégrations externes
Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.
Pour obtenir de l'aide :
- Issues GitHub : Signalez les bugs et demandez des fonctionnalités
- Discussions : Posez vos questions dans les discussions GitHub
- Documentation : Consultez ce README et les commentaires du code
- KuCoin pour leur API robuste et bien documentée
- CCXT pour l'excellente bibliothèque d'accès aux exchanges
- Streamlit pour l'outil de création d'interfaces web en Python
- La communauté open source pour les nombreuses bibliothèques utilisées
An advanced Python program to automatically scan cryptocurrencies on KuCoin and execute trades based on EMA20 signals, with automatic Stop Loss and Take Profit management using Fibonacci levels.
- Real-time scanning of all coins on KuCoin
- EMA20 Detection: Identifies coins crossing their 4h EMA20
- Volume filter: Detects volume increases >50% compared to the previous candle
- Futures filter: Only selects coins with available perpetual contracts
- New listings: Continuous monitoring of newly listed coins
- Smart orders: Automatic placement of buy orders with SL/TP
- Built-in Fibonacci: Automatic calculation of TP levels based on Fibonacci retracements/extensions (15min timeframe)
- Risk management: Configurable Stop Loss and multiple Take Profits (TP1, TP2, TP3)
- Adaptive position sizing: Automatically calculated based on defined risk
- Modern, intuitive Streamlit interface
- Real-time dashboard with performance metrics
- Flexible configuration: Fully customizable strategies
- Detailed logs: Tracks all trades and signals
- Performance charts: Visualization of results
- Python 3.8 or higher
- KuCoin account with API enabled
- TA-Lib installed on your system
# Clone the project
git clone <repository-url>
cd kucoin-ema-scanner
# Install Python dependencies
pip install -r requirements.txt
# TA-Lib installation (required for technical analysis)
# On Windows: download the wheel from https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
# On macOS: brew install ta-lib
# On Ubuntu/Debian: sudo apt-get install libta-lib-devCreate a .env file in the root of the project:
# KuCoin API configuration
KUCOIN_API_KEY=your_api_key_here
KUCOIN_API_SECRET=your_api_secret_here
KUCOIN_PASSPHRASE=your_passphrase_here
KUCOIN_SANDBOX=true # false for live trading
# Optional configuration
LOG_LEVEL=INFO-
Log into your KuCoin account
-
Go to API Management in settings
-
Create a new API with permissions:
- General (account read access)
- Trade (order placement)
- Futures (access to futures contracts)
-
Note your Passphrase during creation
-
Configure IP restrictions if necessary
The config.py file contains all configurable parameters:
# Scanner
SCAN_INTERVAL = 60 # Scan interval in seconds
VOLUME_THRESHOLD = 50 # Volume increase threshold in %
EMA_PERIOD = 20 # EMA period
# Trading
DEFAULT_POSITION_SIZE = 100 # Position size in USDT
DEFAULT_SL_PERCENT = 2.0 # Stop Loss in %
TP1_PERCENT = 1.5 # Take Profit 1 in %
TP2_PERCENT = 3.0 # Take Profit 2 in %
TP3_PERCENT = 5.0 # Take Profit 3 in %# Launch the graphical interface
streamlit run main.py
# Or directly
python main.py# Check installation and configuration
python main.py --test
# Display help
python main.py --help- Configuration: Adjust settings in the sidebar
- Start: Click "
▶️ Start" to launch the auto-scanner - Monitoring: View the "🎯 Signals" tab for detections
- Trading: Execute trades manually or enable automation
- Tracking: Monitor your positions in "💼 Active Trades"
/kucoin-ema-scanner/
├── main.py # Main entry point
├── scanner.py # Scan logic and signal detection
├── trading.py # Order and trading management
├── gui.py # Streamlit user interface
├── config.py # Global configuration
├── requirements.txt # Python dependencies
├── README.md # Documentation
├── .env # Environment variables (to create)
└── trading.log # Log file (auto-generated)
- EMA20 Crossover: Price crosses above EMA20 on 4h timeframe
- Volume Spike: Volume increases >50% compared to the previous candle
- Futures Contract: The coin must have a perpetual contract available on KuCoin
-
Entry: Market order upon signal detection
-
Stop Loss: Automatically calculated (default: 2% below entry price)
-
Take Profits: 3 levels based on Fibonacci extensions
- TP1: 1/3 of position (level 1.272 or 1.5% default)
- TP2: 1/3 of position (level 1.414 or 3% default)
- TP3: 1/3 of position (level 1.618 or 5% default)
-
Timeframe: 15 minutes for precision
-
Swing Points: Automatic detection of recent highs/lows
-
Used Levels:
- Extensions: 1.272, 1.414, 1.618, 2.0, 2.618
- Retracements: 0.236, 0.382, 0.5, 0.618, 0.786
- Continuous monitoring of all KuCoin markets
- Automatic detection of new listings
- Smart filtering of high-quality signals
- Real-time metrics: Balance, positions, performance
- Interactive charts: P&L evolution, trade history
- Detailed logs: Full traceability of operations
- Dynamic configuration: Modify parameters without restarting
- Position sizing: Automatically calculated based on defined risk
- Adaptive Stop Loss: Adjusted according to market volatility
- Staggered Take Profits: Gradual risk reduction
- Drawdown limit: Protection from significant losses
- Financial loss: Trading carries the risk of capital loss
- Volatility: Cryptocurrencies are extremely volatile
- Software bugs: No software is bug-free
- Market conditions: Strategies may not work in all environments
- Test in sandbox first before going live
- Start with small amounts to validate the strategy
- Monitor open positions regularly
- Keep your API keys secure
- Keep the software updated for security patches
- Use API keys with limited permissions
- Configure IP restrictions for your API keys
- Never share your API keys or passphrase
- Use a VPN when trading from public networks
- Keep backups of your configuration
"Exchange not initialized" error
- Check your API keys in the
.envfile - Ensure correct API permissions
- Test the connection with
python main.py --test
"TA-Lib not found" error
- Install TA-Lib for your OS
- Restart your Python environment after installation
No signals detected
- Check if volume threshold is too high
- Make sure markets are active (during trading hours)
- Consult logs to identify potential errors
Streamlit interface not loading
- Check if port 8501 is occupied
- Try
streamlit run main.py --server.port 8502 - Clear cache with
streamlit cache clear
- CCXT: Connection to cryptocurrency exchanges
- TA-Lib: Technical analysis and indicator calculations
- Pandas: Data manipulation and analysis
- Streamlit: Web-based user interface
- Plotly: Interactive charts
Contributions are welcome! To contribute:
- Fork the project
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
- Support for other exchanges (Binance, OKX, etc.)
- Additional trading strategies
- Built-in backtesting
- Notifications (Discord, Telegram, email)
- Paper trading mode
- REST API for external integrations
This project is licensed under the MIT License. See the LICENSE file for more details.
For help:
- GitHub Issues: Report bugs and request features
- Discussions: Ask questions in GitHub Discussions
- Documentation: Refer to this README and code comments
- KuCoin for their robust and well-documented API
- CCXT for the excellent exchange library
- Streamlit for making Python web UIs easy
- The open-source community for countless libraries used