mirror of
https://github.com/fabianfrank-dev/Stock_Market_Analyzer.git
synced 2026-04-08 23:55:18 +00:00
Page:
Architecture
No results
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Architecture Overview
This page describes the overall architecture of the Stock Market Analysis Tool, including the main components, their interactions, and the data flow.
🔹 High-Level Overview
The application follows a modular structure with clear separation between:
- Data Layer – fetching, storing, and preprocessing financial data
- Core Logic Layer – calculation of indicators, portfolio management, network analysis, and prediction
- Visualization / UI Layer – Streamlit interface and interactive plots
- Entry Point – main.py, which connects all modules
🔹 Component Breakdown
1. Data Layer (/data)
- fetch_data.py: Retrieves stock and market data from external APIs (Yahoo Finance).
- /data_saved/: Static CSV or Parquet files for historical data, caching, and precomputed results.
Responsibilities:
- Provide clean, structured data to core modules
- Ensure data is valid and formatted for indicator and visualization modules
2. Core Logic Layer (/core)
- indicators.py: Computes SMA, EMA, ATR, RSI, MACD, etc.
- market_screener.py: Screens market data, computes correlations, prepares input for heatmaps and network graphs.
- network_graphing.py: Builds interactive correlation networks using Plotly and Louvain clustering.
- portfolio.py: Tracks user-defined portfolios and calculates performance.
- prediction.py: Runs a deterministic forecasting model for price prediction.
Responsibilities:
- Perform all calculations and analyses
- Maintain modularity so each component can be extended independently
- Reference official documentation where applicable
3. Visualization / UI Layer (/GUI)
- user_interface.py: Creates the Streamlit interface, handles user input, and routes actions to the core logic.
- colour_coding.py: Provides color schemes for heatmaps and other visuals.
Responsibilities:
- Render charts, heatmaps, networks, and tables
- Ensure interactive, user-friendly experience
- Separate UI logic from core calculations
4. Entry Point (main.py)
- Initializes the Streamlit environment
- Imports core modules and GUI
- Handles user navigation between pages and visualizations
Responsibilities:
- Connect data layer, core logic, and UI
- Serve as the single entry point for developers and users
🔹 Data Flow
- User input: Ticker, portfolio data, or parameters via Streamlit UI
- Data fetch:
fetch_data.pyretrieves data from Yahoo Finance or loads cached files - Processing: Core modules compute indicators, correlations, predictions
- Visualization: Heatmaps, network graphs, charts, and portfolio results rendered in UI
- Feedback: Users see results and can adjust input to repeat the cycle
Here you can see how the program files interact with eachother:
🔹 Notes for Developers
- The modular design allows easy replacement or extension of:
- Prediction methods
- Visualization types
- Data sources
- Each module should operate independently of UI logic
- All modules reference official documentation where applicable for correctness