# jega1987/16th_night-aug_momentum-f-o-scanner architecture

> Architecture diagram of the GitHub repository jega1987/16th_night-aug_momentum-f-o-scanner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jega1987/16th_night-aug_momentum-f-o-scanner
- Repository: https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner

## Overview

Index Squeeze Scanner is a paper-trading application: it gathers market data, detects and scores squeeze breakouts, plans and manages hypothetical positions, and presents scan and performance results. Its principal workflow runs through the scheduled runtime into scanning, then signal sizing/management and persistent audit records. Broker feeds and the options overlay are supporting capabilities; dashboard analytics expose outcomes. Relationships are based on the README and the supplied excerpts/SOURCE INDEX; unsampled implementation details are not assumed.

Main entry points: [`runtime.py`](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/runtime.py) (Scheduler runtime), [`scanner.py`](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/scanner.py) (Scan orchestration), [`database.py`](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/database.py) (Persistent records), [`feed_base.py`](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_base.py) (Feed contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["Web entry<br/>[main.py]"]
  node_runtime_mgr["Scheduler runtime<br/>[runtime.py]"]
  node_config["Strategy config<br/>[config.py]"]
  node_clock["Market clock<br/>[clock.py]"]
  node_kite_login["Kite login<br/>[kite_autologin.py]"]
end

subgraph group_market["Market data"]
  node_feed_contract["Feed contract<br/>[feed_base.py]"]
  node_kite_feed["Kite feed<br/>[feed_kite.py]"]
  node_mock_feed["Mock feed<br/>[feed_mock.py]"]
  node_tick_bars["Tick aggregation<br/>[feed_ws.py]"]
  node_candle_store["Candle store<br/>[candle_store.py]"]
  node_universe["Symbol universe<br/>[universe.py]"]
end

subgraph group_strategy["Signal strategy"]
  node_scanner["Scan orchestration<br/>[scanner.py]"]
  node_indicators["Technical indicators<br/>[indicators.py]"]
  node_filters["Confluence scoring<br/>[filters.py]"]
  node_signal_budget["Signal budget<br/>[signal_budget.py]"]
end

subgraph group_trading["Paper trading"]
  node_signal_engine["Position manager<br/>[signal_engine.py]"]
  node_options["Options overlay<br/>[options_layer.py]"]
  node_database[("Persistent records<br/>[database.py]")]
end

subgraph group_insights["Monitoring and insights"]
  node_dashboard["Dashboard API<br/>[dashboard.py]"]
  node_analytics["Performance analytics<br/>[analytics.py]"]
  node_notifier["Signal notifications<br/>[notifier.py]"]
end

node_user(("Operator"))

node_user -->|"opens dashboard"| node_main
node_main -->|"starts runtime"| node_runtime_mgr
node_main -->|"serves routes"| node_dashboard
node_main -->|"registers login"| node_kite_login
node_runtime_mgr -->|"reads settings"| node_config
node_runtime_mgr -->|"checks sessions"| node_clock
node_runtime_mgr -->|"loads symbols"| node_universe
node_runtime_mgr -->|"runs scans"| node_scanner
node_runtime_mgr -->|"limits signals"| node_signal_budget
node_runtime_mgr -->|"manages positions"| node_signal_engine
node_runtime_mgr -->|"sets up overlay"| node_options
node_runtime_mgr -->|"configures alerts"| node_notifier
node_kite_login -->|"exchanges token"| node_kite_feed
node_kite_feed -->|"persists token"| node_database
node_kite_feed -->|"implements contract"| node_feed_contract
node_mock_feed -->|"implements contract"| node_feed_contract
node_feed_contract -->|"aggregates stream"| node_tick_bars
node_candle_store -->|"fetches candles"| node_feed_contract
node_candle_store -->|"splices streamed bars"| node_tick_bars
node_candle_store -->|"reads and writes bars"| node_database
node_scanner -->|"loads candle series"| node_candle_store
node_scanner -->|"checks live quotes"| node_feed_contract
node_scanner -->|"scores setups"| node_filters
node_filters -->|"uses calculations"| node_indicators
node_scanner -->|"hands off setups"| node_signal_engine
node_scanner -->|"caps candidates"| node_signal_budget
node_scanner -->|"logs scan results"| node_database
node_signal_engine -->|"requests option plan"| node_options
node_options -->|"gets option quotes"| node_feed_contract
node_options -->|"stores IV history"| node_database
node_signal_engine -->|"records and updates trades"| node_database
node_signal_engine -->|"sends signal"| node_notifier
node_dashboard -->|"reads application data"| node_database
node_dashboard -->|"serves performance"| node_analytics
node_analytics -->|"queries trade history"| node_database

click node_main "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/main.py"
click node_runtime_mgr "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/runtime.py"
click node_config "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/config.py"
click node_clock "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/clock.py"
click node_kite_login "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/kite_autologin.py"
click node_feed_contract "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_base.py"
click node_kite_feed "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_kite.py"
click node_mock_feed "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_mock.py"
click node_tick_bars "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_ws.py"
click node_candle_store "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/candle_store.py"
click node_universe "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/universe.py"
click node_scanner "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/scanner.py"
click node_indicators "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/indicators.py"
click node_filters "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/filters.py"
click node_signal_budget "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/signal_budget.py"
click node_signal_engine "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/signal_engine.py"
click node_options "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/options_layer.py"
click node_database "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/database.py"
click node_dashboard "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/dashboard.py"
click node_analytics "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/analytics.py"
click node_notifier "https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/notifier.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_main,node_runtime_mgr,node_config,node_clock,node_kite_login toneBlue
class node_feed_contract,node_kite_feed,node_mock_feed,node_tick_bars,node_candle_store,node_universe toneAmber
class node_scanner,node_indicators,node_filters,node_signal_budget toneMint
class node_signal_engine,node_options,node_database toneRose
class node_dashboard,node_analytics,node_notifier,node_user toneIndigo
```

## Components

### Application runtime

- [Web entry](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/main.py): `main.py`
- [Scheduler runtime](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/runtime.py): `runtime.py`
- [Strategy config](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/config.py): `config.py`
- [Market clock](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/clock.py): `clock.py`
- [Kite login](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/kite_autologin.py): `kite_autologin.py`

### Market data

- [Feed contract](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_base.py): `feed_base.py`
- [Kite feed](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_kite.py): `feed_kite.py`
- [Mock feed](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_mock.py): `feed_mock.py`
- [Tick aggregation](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/feed_ws.py): `feed_ws.py`
- [Candle store](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/candle_store.py): `candle_store.py`
- [Symbol universe](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/universe.py): `universe.py`

### Signal strategy

- [Scan orchestration](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/scanner.py): `scanner.py`
- [Technical indicators](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/indicators.py): `indicators.py`
- [Confluence scoring](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/filters.py): `filters.py`
- [Signal budget](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/signal_budget.py): `signal_budget.py`

### Paper trading

- [Position manager](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/signal_engine.py): `signal_engine.py`
- [Options overlay](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/options_layer.py): `options_layer.py`
- [Persistent records](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/database.py): `database.py`

### Monitoring and insights

- [Dashboard API](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/dashboard.py): `dashboard.py`
- [Performance analytics](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/analytics.py): `analytics.py`
- [Signal notifications](https://github.com/jega1987/16th_night-aug_momentum-f-o-scanner/blob/main/notifier.py): `notifier.py`

### Other components

- **Operator**

## Connections

- Operator → Web entry: opens dashboard (evidence: `README.md`)
- Web entry → Scheduler runtime: starts runtime (evidence: `main.py`)
- Web entry → Dashboard API: serves routes (evidence: `main.py`)
- Web entry → Kite login: registers login (evidence: `main.py`)
- Scheduler runtime → Strategy config: reads settings (evidence: `runtime.py`)
- Scheduler runtime → Market clock: checks sessions (evidence: `runtime.py`)
- Scheduler runtime → Symbol universe: loads symbols (evidence: `runtime.py`)
- Scheduler runtime → Scan orchestration: runs scans (evidence: `runtime.py`)
- Scheduler runtime → Signal budget: limits signals (evidence: `runtime.py`)
- Scheduler runtime → Position manager: manages positions (evidence: `runtime.py`)
- Scheduler runtime → Options overlay: sets up overlay (evidence: `runtime.py`)
- Scheduler runtime → Signal notifications: configures alerts (evidence: `runtime.py`)
- Kite login → Kite feed: exchanges token (evidence: `kite_autologin.py`)
- Kite feed → Persistent records: persists token (evidence: `feed_kite.py`)
- Kite feed → Feed contract: implements contract (evidence: `feed_kite.py`)
- Mock feed → Feed contract: implements contract (evidence: `feed_mock.py`)
- Feed contract → Tick aggregation: aggregates stream (evidence: `feed_ws.py`)
- Candle store → Feed contract: fetches candles (evidence: `candle_store.py`)
- Candle store → Tick aggregation: splices streamed bars (evidence: `candle_store.py`)
- Candle store → Persistent records: reads and writes bars (evidence: `candle_store.py`)
- Scan orchestration → Candle store: loads candle series (evidence: `scanner.py`)
- Scan orchestration → Feed contract: checks live quotes (evidence: `scanner.py`)
- Scan orchestration → Confluence scoring: scores setups (evidence: `scanner.py`)
- Confluence scoring → Technical indicators: uses calculations (evidence: `filters.py`)
- Scan orchestration → Position manager: hands off setups (evidence: `scanner.py`)
- Scan orchestration → Signal budget: caps candidates (evidence: `scanner.py`)
- Scan orchestration → Persistent records: logs scan results (evidence: `scanner.py`)
- Position manager → Options overlay: requests option plan (evidence: `signal_engine.py`)
- Options overlay → Feed contract: gets option quotes (evidence: `options_layer.py`)
- Options overlay → Persistent records: stores IV history (evidence: `options_layer.py`)
- Position manager → Persistent records: records and updates trades (evidence: `signal_engine.py`)
- Position manager → Signal notifications: sends signal (evidence: `signal_engine.py`)
- Dashboard API → Persistent records: reads application data (evidence: `dashboard.py`)
- Dashboard API → Performance analytics: serves performance (evidence: `dashboard.py`)
- Performance analytics → Persistent records: queries trade history (evidence: `analytics.py`)
