A sophisticated stock price prediction and automated trading system that combines machine learning with eToro virtual portfolio integration.
- Real-time stock data fetching from Alpha Vantage API
- Machine learning-based price predictions for the next trading day
- Support for 30 major stocks including AAPL, MSFT, GOOGL, AMZN, etc.
- Automatic fallback to mock data generation when API limits are reached
- Comprehensive technical analysis including:
- Price predictions (open, high, low, close)
- Volume analysis
- Market sentiment indicators
- Trend strength assessment
- Volatility metrics
- eToro virtual portfolio integration
- Manual trading capabilities (buy/sell)
- Automated trading based on ML predictions
- Risk management features:
- Position sizing recommendations
- Stop-loss calculations
- Take-profit targets
- Risk/reward ratio analysis
- Maximum 2% risk per trade
- Modern, responsive web interface
- Real-time data visualization
- Top 20 predicted returns dashboard
- Clear market sentiment indicators
- Trading signals with confidence scores
- Portfolio balance tracking
- Java 11 or higher
- Maven
- eToro virtual trading account
- Alpha Vantage API key
.
├── config.properties # Configuration file
├── data/ # Data directory
│ ├── csv/ # CSV files for stock data
│ └── json/ # JSON files for API responses
├── src/ # Source code
└── target/ # Compiled files
- Create a
config.propertiesfile in the project root:
api.key=YOUR_ALPHA_VANTAGE_API_KEY
etoro.username=YOUR_ETORO_USERNAME
etoro.password=YOUR_ETORO_PASSWORD
- Install dependencies:
mvn clean install- Run the application:
mvn exec:java -Dexec.mainClass="WebVisualization"The server will start on port 8080 (or the next available port up to 8089).
- Sign up for an Alpha Vantage API key at https://www.alphavantage.co/support/#api-key
- Create a file named
AlphaVantageAPI.txtin the project root directory - Add your API key to this file (single line, no quotes or spaces)
- This file is ignored by git to keep your API key secure
Alternatively, you can add your API key to config.properties:
- Copy
config.properties.templatetoconfig.properties - Replace
YOUR_API_KEY_HEREwith your actual API key
Note: Never commit files containing your actual API key to version control.
-
Access the web interface at
http://localhost:8080 -
Log in to your eToro virtual portfolio
-
For individual stock analysis:
- Enter a stock symbol (e.g., AAPL)
- View comprehensive prediction results
- Execute manual or automated trades
-
Monitor the Top 20 Predictions dashboard for the best trading opportunities
- Use the "Buy Stock" and "Sell Stock" buttons for manual trades
- Default position size: 1 share per trade
- Real-time portfolio balance updates
- Click "Auto Trade" for ML-driven trading decisions
- Minimum 80% confidence threshold for automated trades
- Automated position sizing based on:
- Account balance
- Stock volatility
- Prediction confidence
- Maximum 2% risk per trade
- Primary: Alpha Vantage API (real-time market data)
- Backup: Sophisticated mock data generation with realistic price movements
- Data Storage:
- CSV files in
data/csv/for historical stock data - JSON files in
data/json/for API responses
- CSV files in
- Features:
- Historical price data
- Volume analysis
- Technical indicators
- Market trends
- Performance metrics:
- Correlation coefficient
- Mean absolute error
- Root mean squared error
- Relative absolute error
- Automatic failover to mock data when API limits are reached
- Comprehensive error reporting
- Rate limit management
- Data validation and sanitization
- Alpha Vantage API has rate limits (calls per minute/day)
- Mock data is used when API limits are reached
- Virtual trading only (no real money transactions)
- Limited to supported stock symbols
Feel free to submit issues and enhancement requests.
This project is licensed under the MIT License - see the LICENSE file for details.