# bhupesh-debug/barclays-markets-quant-intern-ml architecture

> Architecture diagram of the GitHub repository bhupesh-debug/barclays-markets-quant-intern-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhupesh-debug/barclays-markets-quant-intern-ml
- Repository: https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml
- Video tour (about a minute): https://gitdiagram.com/bhupesh-debug/barclays-markets-quant-intern-ml/video

## Overview

This is a synthetic multi-asset quantitative signal research project, not a live-trading system. The main workflow is to generate synthetic prices, engineer no-lookahead signals, compare models in a cost-aware walk-forward backtest, and produce diagnostics and reports. The run script is the orchestration layer; it also writes metrics and charts. The README documents the broader feature set and results. Source excerpts establish the core calls, but some output and diagnostic details are supported only by README statements.

Main entry points: [`run_all.py`](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/run_all.py) (Pipeline runner), [`src/backtest.py`](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/backtest.py) (Walk-forward backtest), [`src/models.py`](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/models.py) (Signal models), [`src/data_gen.py`](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/data_gen.py) (Synthetic markets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_research["Research workflow"]
  node_runner["Pipeline runner<br/>[run_all.py]"]
  node_generator["Synthetic markets<br/>[data_gen.py]"]
  node_market_data["Synthetic prices"]
end

subgraph group_analysis["Signals and models"]
  node_features["Feature engineering<br/>[features.py]"]
  node_models["Signal models<br/>[models.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_backtest["Walk-forward backtest<br/>[backtest.py]"]
  node_diagnostics["Fit and regime diagnostics<br/>[evaluate.py]"]
end

subgraph group_outputs["Research outputs"]
  node_metrics["Metrics report<br/>[metrics.json]"]
  node_charts["Research charts"]
end

node_analyst(("Researcher"))

node_analyst -->|"runs pipeline"| node_runner
node_runner -->|"calls generator"| node_generator
node_runner -->|"writes prices"| node_market_data
node_runner -->|"builds features"| node_features
node_runner -->|"runs backtest"| node_backtest
node_backtest -->|"fits and predicts"| node_models
node_runner -->|"creates models"| node_models
node_runner -->|"computes diagnostics"| node_diagnostics
node_runner -->|"writes metrics"| node_metrics
node_runner -->|"writes charts"| node_charts

click node_runner "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/run_all.py"
click node_generator "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/data_gen.py"
click node_market_data "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/data/synthetic/synthetic_markets.csv"
click node_features "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/features.py"
click node_models "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/models.py"
click node_backtest "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/backtest.py"
click node_diagnostics "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/evaluate.py"
click node_metrics "https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/reports/metrics.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_generator,node_market_data toneBlue
class node_features,node_models toneAmber
class node_backtest,node_diagnostics toneMint
class node_metrics,node_charts toneRose
class node_analyst toneIndigo
```

## Components

### Research workflow

- [Pipeline runner](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/run_all.py): `run_all.py`
- [Synthetic markets](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/data_gen.py): `src/data_gen.py`
- [Synthetic prices](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/data/synthetic/synthetic_markets.csv): `data/synthetic/synthetic_markets.csv`

### Signals and models

- [Feature engineering](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/features.py): `src/features.py`
- [Signal models](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/models.py): `src/models.py`

### Evaluation

- [Walk-forward backtest](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/backtest.py): `src/backtest.py`
- [Fit and regime diagnostics](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/src/evaluate.py): `src/evaluate.py`

### Research outputs

- [Metrics report](https://github.com/bhupesh-debug/barclays-markets-quant-intern-ml/blob/main/reports/metrics.json): `reports/metrics.json`
- **Research charts**

### Other components

- **Researcher**

## Connections

- Researcher → Pipeline runner: runs pipeline (evidence: `README.md`)
- Pipeline runner → Synthetic markets: calls generator (evidence: `run_all.py`)
- Pipeline runner → Synthetic prices: writes prices (evidence: `run_all.py`)
- Pipeline runner → Feature engineering: builds features (evidence: `run_all.py`)
- Pipeline runner → Walk-forward backtest: runs backtest (evidence: `run_all.py`)
- Walk-forward backtest → Signal models: fits and predicts (evidence: `src/backtest.py`)
- Pipeline runner → Signal models: creates models (evidence: `run_all.py`)
- Pipeline runner → Fit and regime diagnostics: computes diagnostics (evidence: `run_all.py`)
- Pipeline runner → Metrics report: writes metrics (evidence: `run_all.py`)
- Pipeline runner → Research charts: writes charts (evidence: `run_all.py`)
