# virtrivedi/stock-price-modeling-analytics architecture

> Architecture diagram of the GitHub repository virtrivedi/stock-price-modeling-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/virtrivedi/stock-price-modeling-analytics
- Repository: https://github.com/virtrivedi/stock-price-modeling-analytics

## Overview

##### Project type and purpose
- From the file tree and README title “Stock-Price-Modeling-Analytics,” this is a data-analytics pipeline focused on processing market data, computing correlations, generating price features, and producing visualizations and model outputs. It is not a client-server or web application; rather it’s a collection of standalone scripts that form a processing pipeline for stock-price analysis.

##### File structure
- Top-level Python scripts:
- bar_generation.py            – Aggregates tick data into time bars (e.g., minute/second OHLC).
- correlation_generation.py    – Computes correlation matrices from price or feature series.
- correlation_heatmap.py       – Reads correlation results and plots a heatmap.
- parse_book_fills.py          – Parses trade‐fill events from raw order‐book data.
- parse_book_tops.py(.cpp/.py) – Parses top‐of-book snapshots; C++ for performance, Python as fallback.
- price_correlation.py         – A wrapper or specialized correlation calculator.
- price_prediction.py          – Trains or applies predictive models on engineered features.
- No dedicated folders, but implicit modular separation by functionality: data ingestion/parsing, feature engineering, modeling, visualization.

##### README for additional insights
- The README is sparse, so infer architecture from filenames: a linear pipeline that starts with raw data parsing, proceeds through feature generation, then correlation analysis and visualization, finishing with price‐prediction modeling.

##### Detailed capturing of architectural elements
- Parallel downstream stages: one branch feeding correlation_heatmap, another feeding price_prediction.

[Data Sources] → [parse_book_tops (C++)] → [parsed order-book data]
↘
→ [parse_book_fills (Py)] → [parsed fills]
→ [bar_generation] → [OHLC bar CSV]
→ [correlation_generation / price_correlation] → [correlation matrix]
↘
→ [correlation_heatmap]
→ [price_prediction] → [model outputs / performance metrics]

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Sources"
        DS["External Raw Data Files"]:::data
    end

    subgraph "Parsing Stage"
        P1["parse_book_tops (C++)"]:::proc
        P2["parse_book_tops (Python)"]:::proc
        P3["parse_book_fills (Python)"]:::proc
    end

    DS --> P1
    DS --> P2
    DS --> P3

    subgraph "Parsed Data Artifacts"
        IOD1["Parsed Order-Book Data"]:::storage
        IOD2["Parsed Fills"]:::storage
    end

    P1 --> IOD1
    P2 --> IOD1
    P3 --> IOD2

    subgraph "Feature Engineering"
        BG["bar_generation.py"]:::proc
        CG["correlation_generation.py"]:::proc
        PC["price_correlation.py"]:::proc
    end

    IOD1 --> BG
    IOD2 --> BG
    BG --> DS1["OHLC Bar CSV"]:::storage
    DS1 --> CG
    DS1 --> PC
    CG --> CS["Correlation Matrix"]:::storage
    PC --> CS

    subgraph "Visualization Module"
        CH["correlation_heatmap.py"]:::vis
    end

    subgraph "Modeling Module"
        PP["price_prediction.py"]:::vis
    end

    CS --> CH
    DS1 --> PP

    subgraph "Documentation"
        RD["README.md"]:::doc
        GI[".gitignore"]:::doc
    end

    classDef data fill:#B3CDE3,stroke:#005B96,color:#03396C;
    classDef proc fill:#C7E9C0,stroke:#238B45,color:#006D2C;
    classDef storage fill:#FDE0DD,stroke:#E6550D,color:#A63603,shape:cylinder;
    classDef vis fill:#FFF5BA,stroke:#FFD700,color:#B8860B;
    classDef doc fill:#E0E0E0,stroke:#666666,color:#333333;

    click P1 "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/parse_book_tops.cpp"
    click P2 "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/parse_book_tops.py"
    click P3 "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/parse_book_fills.py"
    click BG "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/bar_generation.py"
    click CG "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/correlation_generation.py"
    click PC "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/price_correlation.py"
    click CH "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/correlation_heatmap.py"
    click PP "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/price_prediction.py"
    click RD "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/README.md"
    click GI "https://github.com/virtrivedi/stock-price-modeling-analytics/blob/main/.gitignore"
```
