A comprehensive stock market analysis tool with real-time data, technical indicators, and persistent user data.
- π User Authentication - Secure login and registration system
- π Real-time Stock Analysis with Yahoo Finance data
- Technical Indicators: MACD, Bollinger Bands, RSI, SMA, EMA, SuperTrend
- Interactive Charts with Plotly
- User Data Persistence - Stats and analysis history are saved
- Keep-Alive System - App stays running and doesn't sleep
- Automatic Backups - Data is backed up regularly
- Comprehensive Logging - All activity is logged
- User Statistics - Track individual user analysis counts
- Popular Stocks Tracking - See the most searched stocks on the platform
-
Run the setup script:
./setup.sh
-
Start the application:
./run_app.sh
-
Access the app:
- Open your browser to:
http://localhost:8501
- Open your browser to:
-
Create virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Run the app:
streamlit run trading_simulator.py
- Login: Use your username and password to access the app
- Register: Create a new account with username, email, and password
- Demo User: Use
demo/demo123for testing
- Enter a stock ticker (e.g., AAPL, MSFT, GOOGL)
- Select date range for analysis
- View comprehensive technical analysis
- Get buy/sell recommendations
- Your analysis count is automatically tracked
- Popular stocks are displayed based on search frequency
- All user interactions are automatically saved
- Analysis history is preserved
- User statistics are maintained
- Data is backed up regularly
./run_app.sh./stop_app.shtail -f keep_alive.log- User Data:
data/users.json - Statistics:
data/stats.json - Analysis History:
data/analysis_history.json - Stock Search Stats:
data/stock_stats.json - Backups:
backups/directory
The app includes an automatic keep-alive system that:
- Sends periodic pings to prevent the app from sleeping
- Logs all activity
- Automatically restarts if the app becomes unresponsive
- Runs every 5 minutes by default
Your data is automatically saved and includes:
- User Information: Sign-ups and user counts
- Analysis History: All stock analyses performed
- Statistics: App usage statistics
- Session Data: Current session information
Automatic backups are created:
- Daily backups of all data files
- Timestamped backup folders
- Automatic cleanup of old backups (30+ days)
- Manual backup creation available
Comprehensive logging includes:
- Keep-alive ping status
- Data save/load operations
- Error tracking
- Performance metrics
- Check if port 8501 is available
- Ensure all dependencies are installed
- Check the logs:
tail -f keep_alive.log
- Check the
data/directory - Restore from backups in
backups/directory - Check logs for error messages
- Check if the keep-alive service is running
- Verify the app URL is correct
- Check network connectivity
βββ trading_simulator.py # Main Streamlit application
βββ keep_alive.py # Keep-alive service
βββ data_persistence.py # Data persistence module
βββ run_app.sh # Start script
βββ stop_app.sh # Stop script
βββ setup.sh # Setup script
βββ requirements.txt # Python dependencies
βββ data/ # Data storage directory
βββ backups/ # Backup directory
βββ logs/ # Log files
STREAMLIT_URL: URL of the Streamlit app (default: http://localhost:8501)KEEP_ALIVE_INTERVAL: Ping interval in seconds (default: 300)
The app uses .streamlit/config.toml for configuration:
- Headless mode enabled
- CORS disabled for local development
- Custom theme colors
The app analyzes stocks using:
- Moving Averages: SMA, EMA
- Momentum: MACD, RSI
- Volatility: Bollinger Bands
- Trend: SuperTrend
- Support/Resistance: Pivot Points
- Volume Analysis: Volume trends
The app provides:
- Buy/Sell/Hold recommendations
- Confidence levels (High/Medium/Low)
- Risk assessment with volatility metrics
- Support and resistance levels
- Detailed reasoning for each recommendation
For issues or questions:
- Check the logs first
- Verify all dependencies are installed
- Ensure the virtual environment is activated
- Check if ports are available
Happy Trading! π