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