# tembolo1284/quantedge architecture

> Architecture diagram of the GitHub repository tembolo1284/quantedge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tembolo1284/quantedge
- Repository: https://github.com/tembolo1284/quantedge

## Overview

QuantEdge is a C++ quantitative-strategy framework with an example runner that loads price series, generates signals, backtests them, and prints final capital. The runner demonstrates pairs trading, mean reversion, and momentum; pairs trading also supports loading paired CSV price files. Mean-reversion and pairs calculations use the shared statistics implementation, while momentum computes its own price change. The README documents these three strategy capabilities. Edges reflect calls visible in the excerpts; no market-data service or persistent store is shown.

Main entry points: [`src/main.cpp`](https://github.com/tembolo1284/quantedge/blob/main/src/main.cpp) (Example runner), [`src/PairsTrader.cpp`](https://github.com/tembolo1284/quantedge/blob/main/src/PairsTrader.cpp) (Pairs trading), [`src/MeanReversionStrategy.cpp`](https://github.com/tembolo1284/quantedge/blob/main/src/MeanReversionStrategy.cpp) (Mean reversion), [`src/MomentumStrategy.cpp`](https://github.com/tembolo1284/quantedge/blob/main/src/MomentumStrategy.cpp) (Momentum)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Example entry"]
  node_runner["Example runner<br/>[main.cpp]"]
end

subgraph group_strategies["Trading strategies"]
  node_pairs["Pairs trading<br/>[PairsTrader.cpp]"]
  node_meanrev["Mean reversion"]
  node_momentum["Momentum"]
end

subgraph group_foundation["Shared foundation"]
  node_statistics["Statistics<br/>[Statistics.cpp]"]
  node_base["Strategy interface<br/>[StrategyBase.hpp]"]
end

node_prices["Price files"]

node_runner -->|"runs workflow"| node_pairs
node_runner -->|"runs workflow"| node_meanrev
node_runner -->|"runs workflow"| node_momentum
node_pairs -->|"calculates signals"| node_statistics
node_meanrev -->|"calculates means"| node_statistics
node_pairs -->|"reads CSV prices"| node_prices
node_meanrev -->|"implements interface"| node_base
node_momentum -->|"implements interface"| node_base

click node_runner "https://github.com/tembolo1284/quantedge/blob/main/src/main.cpp"
click node_pairs "https://github.com/tembolo1284/quantedge/blob/main/src/PairsTrader.cpp"
click node_meanrev "https://github.com/tembolo1284/quantedge/blob/main/src/MeanReversionStrategy.cpp"
click node_momentum "https://github.com/tembolo1284/quantedge/blob/main/src/MomentumStrategy.cpp"
click node_statistics "https://github.com/tembolo1284/quantedge/blob/main/src/Statistics.cpp"
click node_base "https://github.com/tembolo1284/quantedge/blob/main/include/StrategyBase.hpp"

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 toneBlue
class node_pairs,node_meanrev,node_momentum toneAmber
class node_statistics,node_base toneMint
class node_prices toneIndigo
```

## Components

### Example entry

- [Example runner](https://github.com/tembolo1284/quantedge/blob/main/src/main.cpp): `src/main.cpp`

### Trading strategies

- [Pairs trading](https://github.com/tembolo1284/quantedge/blob/main/src/PairsTrader.cpp): `src/PairsTrader.cpp`
- [Mean reversion](https://github.com/tembolo1284/quantedge/blob/main/src/MeanReversionStrategy.cpp): `src/MeanReversionStrategy.cpp`
- [Momentum](https://github.com/tembolo1284/quantedge/blob/main/src/MomentumStrategy.cpp): `src/MomentumStrategy.cpp`

### Shared foundation

- [Statistics](https://github.com/tembolo1284/quantedge/blob/main/src/Statistics.cpp): `src/Statistics.cpp`
- [Strategy interface](https://github.com/tembolo1284/quantedge/blob/main/include/StrategyBase.hpp): `include/StrategyBase.hpp`

### Other components

- **Price files**

## Connections

- Example runner → Pairs trading: runs workflow (evidence: `src/main.cpp`)
- Example runner → Mean reversion: runs workflow (evidence: `src/main.cpp`)
- Example runner → Momentum: runs workflow (evidence: `src/main.cpp`)
- Pairs trading → Statistics: calculates signals (evidence: `src/PairsTrader.cpp`)
- Mean reversion → Statistics: calculates means (evidence: `src/MeanReversionStrategy.cpp`)
- Pairs trading → Price files: reads CSV prices (evidence: `src/PairsTrader.cpp`)
- Mean reversion → Strategy interface: implements interface
- Momentum → Strategy interface: implements interface
