An advanced algorithmic trading bot that implements multiple technical analysis strategies to make automated trading decisions for stocks listed on major exchanges.
-
Multiple Trading Strategies
- RSI (Relative Strength Index)
- MACD (Moving Average Convergence Divergence)
- Bollinger Bands
- Combined signal analysis with confidence scoring
-
Portfolio Management
- Real-time position tracking
- Transaction fee consideration (0.25%)
- Automated trade execution
- Position sizing and risk management
-
Data Management
- Real-time market data from Yahoo Finance
- Efficient caching system for API calls
- Historical trade tracking
- Performance analytics
-
Reporting and Analytics
- Real-time portfolio valuation
- Performance reporting with colored output
- Excel export functionality
- Detailed trade history
- Clone the repository:
git clone [email protected]:LcsH0s/TradingBot-ESIEA.git
cd TradingBot-ESIEA
- Install dependencies:
pip install -r requirements.txt
- Create a wallet file (optional - will use default if not provided):
cp wallet.default.json wallet.json
-
Edit
config.json
to customize:- Trading pairs/tickers
- Minimum confidence threshold
- Check interval
- Technical indicator parameters
-
Environment variables (optional):
- Create a
.env
file for any API keys or sensitive configuration
- Create a
The bot can be run in different modes:
python main.py run
python main.py report
python main.py export
-f, --file
: Specify custom wallet file-v, --verbosity
: Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
Build and run using Docker:
docker-compose up --build
Or build manually:
docker build -t trading-bot .
docker run -v $(pwd)/logs:/app/logs trading-bot
main.py
: Entry point and CLI interfacetrader_bot.py
: Core trading logic and strategy implementationwallet.py
: Portfolio and position managementutils/
: Helper utilities and API clientsconfig.json
: Bot configurationwallet.json
: Current portfolio statelogs/
: Trading and debug logs
- Period: 14 days
- Overbought level: 70
- Oversold level: 30
- Fast period: 12
- Slow period: 26
- Signal period: 9
- Period: 20
- Standard deviation: 2.0
- Graceful shutdown handling
- Thread-safe operations
- Cached API calls to prevent rate limiting
- Comprehensive error handling and logging
- Automatic trade execution delay
- Position size limits
- yfinance >= 0.2.31
- pandas >= 2.1.0
- numpy >= 1.24.0
- tabulate >= 0.9.0
- requests >= 2.31.0
- certifi >= 2023.11.17
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This trading bot is for educational purposes only. Always perform your own research and risk assessment before trading. The authors are not responsible for any financial losses incurred while using this software.