# conexionesquantlab/cortex-discretional-journal architecture

> Architecture diagram of the GitHub repository conexionesquantlab/cortex-discretional-journal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/conexionesquantlab/cortex-discretional-journal
- Repository: https://github.com/conexionesquantlab/cortex-discretional-journal

## Overview

Cortex is a Streamlit discretionary trading journal. Traders sign in, select a month, review or edit daily PNL/MAE and comments, and use performance metrics and charts to review results. The main app handles the interface and workflow; monthly CSV files provide local persistence. The README gives only a brief product description, and excerpts omit portions of app.py, so some UI-to-processing relationships are shown as unverified rather than asserted as source-confirmed calls.

Main entry points: [`app.py`](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py) (Performance metrics), [`data`](https://github.com/conexionesquantlab/cortex-discretional-journal/tree/main/data) (Monthly CSVs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Journal interface"]
  node_login["Sign-in<br/>[app.py]"]
  node_month["Month selection<br/>[app.py]"]
  node_tradegrid["Daily trade grid<br/>[app.py]"]
  node_session["Session access<br/>[app.py]"]
end

subgraph group_analytics["Trading analytics"]
  node_metrics["Performance metrics<br/>[app.py]"]
  node_dashboard["Metric dashboard<br/>[app.py]"]
  node_charts["Performance charts<br/>[app.py]"]
end

subgraph group_persistence["Monthly records"]
  node_loader["Monthly loader<br/>[app.py]"]
  node_cleaner["Data cleaning<br/>[app.py]"]
  node_records[("Monthly CSVs")]
  node_saver["Record saving<br/>[app.py]"]
end

node_trader(("Trader"))

node_trader -->|"signs in"| node_login
node_login -->|"sets session"| node_session
node_trader -.->|"selects month"| node_month
node_month -.->|"loads period"| node_loader
node_loader -.->|"reads CSV"| node_records
node_loader -->|"cleans data"| node_cleaner
node_cleaner -.->|"provides rows"| node_tradegrid
node_trader -.->|"edits entries"| node_tradegrid
node_tradegrid -.->|"saves edits"| node_saver
node_saver -->|"writes CSV"| node_records
node_cleaner -.->|"normalizes input"| node_metrics
node_metrics -.->|"supplies metrics"| node_dashboard
node_metrics -.->|"supplies series"| node_charts

click node_login "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_month "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_tradegrid "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_session "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_loader "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_cleaner "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_records "https://github.com/conexionesquantlab/cortex-discretional-journal/tree/main/data"
click node_saver "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_metrics "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_dashboard "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"
click node_charts "https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py"

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_login,node_month,node_tradegrid,node_session toneBlue
class node_metrics,node_dashboard,node_charts toneAmber
class node_loader,node_cleaner,node_records,node_saver toneMint
class node_trader toneIndigo
```

## Components

### Journal interface

- [Sign-in](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`
- [Month selection](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`
- [Daily trade grid](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`
- [Session access](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`

### Trading analytics

- [Performance metrics](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`
- [Metric dashboard](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`
- [Performance charts](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`

### Monthly records

- [Monthly loader](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`
- [Data cleaning](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`
- [Monthly CSVs](https://github.com/conexionesquantlab/cortex-discretional-journal/tree/main/data): `data`
- [Record saving](https://github.com/conexionesquantlab/cortex-discretional-journal/blob/main/app.py): `app.py`

### Other components

- **Trader**

## Connections

- Trader → Sign-in: signs in (evidence: `app.py`)
- Sign-in → Session access: sets session (evidence: `app.py`)
- Trader → Month selection: selects month
- Month selection → Monthly loader: loads period (evidence: `app.py`)
- Monthly loader → Monthly CSVs: reads CSV
- Monthly loader → Data cleaning: cleans data (evidence: `app.py`)
- Data cleaning → Daily trade grid: provides rows (evidence: `app.py`)
- Trader → Daily trade grid: edits entries
- Daily trade grid → Record saving: saves edits (evidence: `app.py`)
- Record saving → Monthly CSVs: writes CSV (evidence: `app.py`)
- Data cleaning → Performance metrics: normalizes input (evidence: `app.py`)
- Performance metrics → Metric dashboard: supplies metrics (evidence: `app.py`)
- Performance metrics → Performance charts: supplies series (evidence: `app.py`)
