๐ Advanced AI-Powered Market Prediction & Backtesting Platform
A modern web application that brings the power of Kronos AI to your browser, featuring real-time market predictions and comprehensive backtesting capabilities for both stocks and cryptocurrencies.
- AI-Powered Forecasting: Generate future price predictions using advanced machine learning models
- Multi-Asset Support: Supports both stocks and cryptocurrencies
- Customizable Timeframes: Adjust prediction length from 30 to 500 periods
- Real-time Visualization: Interactive charts with professional trading theme
- Historical Analysis: Test prediction accuracy on historical data
- Performance Metrics: Comprehensive statistics including accuracy, returns, and Sharpe ratio
- Configurable Lookback: Analyze performance over 100-1000 historical periods
- Visual Reports: Clear charts showing prediction vs actual performance
- Dark Trading Theme: Professional interface designed for traders
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Real-time Updates: AJAX-powered interface with loading indicators
- Symbol Management: Add custom symbols beyond the popular lists
- Docker Support: Containerized for easy deployment
- vast.ai Compatible: Optimized for GPU cloud deployment
- Production Ready: Gunicorn WSGI server with multi-worker support
- Auto-deployment: One-click deployment script included
Dark trading interface with prediction and backtesting capabilities
# Clone the repository
git clone https://github.com/henryzhangpku/kronos-webapp.git
cd kronos-webapp
# Run the automated deployment script
bash deploy.shThe application will be available at http://localhost:5000
# Clone the repository
git clone https://github.com/henryzhangpku/kronos-webapp.git
cd kronos-webapp
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.py- Create a new instance on vast.ai
- Upload this repository to your instance
- Run the deployment script:
bash deploy.sh
- Access via your instance's public IP on port 5000
Generate market predictions for a given symbol.
Request Body:
{
"symbol": "AAPL",
"asset_type": "stock",
"pred_length": 120
}Response:
{
"success": true,
"plot": "base64_encoded_image",
"stats": {
"current_price": 175.50,
"predicted_change": 0.025
}
}Run backtesting analysis for a given symbol.
Request Body:
{
"symbol": "BTC",
"asset_type": "crypto",
"lookback": 512
}Response:
{
"success": true,
"plot": "base64_encoded_image",
"stats": {
"accuracy": 0.73,
"total_return": 0.15,
"sharpe_ratio": 1.45
}
}Add a custom symbol to the available list.
Request Body:
{
"symbol": "NVDA",
"asset_type": "stock"
}kronos-webapp/
โโโ app.py # Main Flask application
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Docker configuration
โโโ deploy.sh # Automated deployment script
โโโ README.md # This file
โโโ templates/
โ โโโ index.html # Main web interface
โโโ static/
โโโ css/
โ โโโ styles.css # Dark trading theme styles
โโโ js/
โโโ app.js # Frontend JavaScript logic
- Framework: Flask 2.3.3 with RESTful API design
- AI Integration: Seamless integration with Kronos prediction models
- Data Visualization: Matplotlib with base64 encoding for web delivery
- Production Server: Gunicorn WSGI server with multiple workers
- Framework: Bootstrap 5 for responsive design
- JavaScript: ES6+ with modern async/await patterns
- Styling: Custom CSS with CSS variables for theming
- Icons: Font Awesome for professional iconography
- Containerization: Docker with multi-stage builds
- Cloud Ready: Optimized for vast.ai and other cloud platforms
- Scalability: Configurable worker processes and timeout settings
- Monitoring: Built-in health checks and logging
- AAPL, GOOGL, MSFT, AMZN, TSLA
- NVDA, META, NFLX, ADBE, CRM
- SPY, QQQ, IWM, GLD, TLT
- BTC, ETH, BNB, XRP, ADA
- SOL, DOGE, DOT, AVAX, MATIC
- LINK, UNI, LTC, BCH, ETC
Custom symbols can be added through the web interface
# Flask Configuration
FLASK_APP=app.py
FLASK_ENV=production
PYTHONPATH=/app
# Application Settings (optional)
MAX_PREDICTION_LENGTH=500
MAX_LOOKBACK_PERIOD=1000
DEFAULT_PREDICTION_LENGTH=120
DEFAULT_LOOKBACK_PERIOD=512The included Dockerfile uses:
- Python 3.11 slim base image
- Multi-worker Gunicorn server
- 120-second timeout for ML operations
- Automatic port exposure on 5000
-
Port Already in Use
# Kill process on port 5000 sudo lsof -t -i tcp:5000 | xargs kill -9
-
Docker Build Fails
# Clean Docker cache docker system prune -a -
AI Models Not Loading
- Ensure the original Kronos AI codebase is available
- Check the import paths in
app.py - Verify all dependencies are installed
-
Memory Issues
- Reduce the number of Gunicorn workers
- Increase Docker memory allocation
- Use smaller prediction/lookback periods
# View container logs
docker logs kronos-app
# Check container status
docker ps -a
# Enter container for debugging
docker exec -it kronos-app bashThis project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For support, please:
- Check the troubleshooting section above
- Review existing GitHub issues
- Create a new issue with detailed information
- Real-time market data streaming
- Portfolio management features
- Multi-timeframe analysis
- Alert system for predictions
- Export functionality for reports
- User authentication and sessions
- Historical prediction tracking
- Advanced charting with TradingView
Built with โค๏ธ by the Kronos AI Team
Empowering traders with artificial intelligence since 2024