# kumaranand05/stock-trading-screener architecture

> Architecture diagram of the GitHub repository kumaranand05/stock-trading-screener, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kumaranand05/stock-trading-screener
- Repository: https://github.com/kumaranand05/stock-trading-screener

## Overview

This is an NSE stock screener. Running `main.py` scans the configured symbols, collects or refreshes time-series data, adds technical indicators, evaluates crossover signals, computes performance figures for matches, and saves updated data and scanner results locally. The graph includes the documented indicator and strategy branches; candlestick and chart-pattern detection are described as under development but have no implementation path in the supplied tree. Relationships are based on the README and shown source excerpts; unsampled modules are not assumed to be connected.

Main entry points: [`main.py`](https://github.com/kumaranand05/stock-trading-screener/blob/main/main.py) (Scan coordinator), [`ticker_info/ticker_data.py`](https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/ticker_data.py) (Data collector), [`ticker_info/download_data.py`](https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/download_data.py) (Data and result writer), [`stock_data`](https://github.com/kumaranand05/stock-trading-screener/tree/main/stock_data) (Local stock history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scan workflow"]
  node_main["Scan coordinator<br/>[main.py]"]
  node_universe["NSE stock list<br/>[stock_list.py]"]
  node_performance["Performance metrics"]
end

subgraph group_data["Market data"]
  node_collector["Data collector<br/>[ticker_data.py]"]
  node_yfinance["yfinance API"]
  node_prices[("Local stock history")]
end

subgraph group_analysis["Technical analysis"]
  node_ema["Moving averages<br/>[moving_averages.py]"]
  node_rsi["RSI indicator<br/>[rsi.py]"]
  node_bollinger["Bollinger bands<br/>[bollinger_bands.py]"]
  node_analyzer["Signal analyzer"]
  node_crossovers["Crossover strategies"]
  node_intersection["Crossover detection<br/>[intersection.py]"]
  node_regression["Linear regression<br/>[regression.py]"]
end

subgraph group_output["Persistence and results"]
  node_writer["Data and result writer<br/>[download_data.py]"]
  node_results["Scanner results CSV"]
end

node_user(("Screener operator"))

node_user -->|"runs"| node_main
node_main -->|"reads symbols"| node_universe
node_main -->|"collects data"| node_collector
node_collector -->|"reads history"| node_prices
node_collector -->|"returns refreshed history"| node_prices
node_collector -->|"fetches prices"| node_yfinance
node_collector -->|"adds averages"| node_ema
node_collector -->|"adds RSI"| node_rsi
node_collector -->|"adds bands"| node_bollinger
node_main -->|"updates history"| node_writer
node_main -->|"analyzes prices"| node_analyzer
node_analyzer -->|"evaluates strategies"| node_crossovers
node_crossovers -->|"checks crossings"| node_intersection
node_intersection -->|"fits trends"| node_regression
node_main -->|"gets metrics"| node_performance
node_main -->|"saves results"| node_writer
node_writer -->|"writes history"| node_prices
node_writer -->|"writes CSV"| node_results

click node_main "https://github.com/kumaranand05/stock-trading-screener/blob/main/main.py"
click node_universe "https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/stock_list.py"
click node_performance "https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/stock_performance.py"
click node_collector "https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/ticker_data.py"
click node_prices "https://github.com/kumaranand05/stock-trading-screener/tree/main/stock_data"
click node_ema "https://github.com/kumaranand05/stock-trading-screener/blob/main/indicators/moving_averages.py"
click node_rsi "https://github.com/kumaranand05/stock-trading-screener/blob/main/indicators/rsi.py"
click node_bollinger "https://github.com/kumaranand05/stock-trading-screener/blob/main/indicators/bollinger_bands.py"
click node_analyzer "https://github.com/kumaranand05/stock-trading-screener/blob/main/strategies/technical_analysis.py"
click node_crossovers "https://github.com/kumaranand05/stock-trading-screener/blob/main/strategies/crossover_strategies.py"
click node_intersection "https://github.com/kumaranand05/stock-trading-screener/blob/main/chart_utilities/intersection.py"
click node_regression "https://github.com/kumaranand05/stock-trading-screener/blob/main/chart_utilities/regression.py"
click node_writer "https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/download_data.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_universe,node_performance,node_user toneBlue
class node_collector,node_yfinance,node_prices toneAmber
class node_ema,node_rsi,node_bollinger,node_analyzer,node_crossovers,node_intersection,node_regression toneMint
class node_writer,node_results toneRose
```

## Components

### Scan workflow

- [Scan coordinator](https://github.com/kumaranand05/stock-trading-screener/blob/main/main.py): `main.py`
- [NSE stock list](https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/stock_list.py): `ticker_info/stock_list.py`
- [Performance metrics](https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/stock_performance.py): `ticker_info/stock_performance.py`

### Market data

- [Data collector](https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/ticker_data.py): `ticker_info/ticker_data.py`
- **yfinance API**
- [Local stock history](https://github.com/kumaranand05/stock-trading-screener/tree/main/stock_data): `stock_data`

### Technical analysis

- [Moving averages](https://github.com/kumaranand05/stock-trading-screener/blob/main/indicators/moving_averages.py): `indicators/moving_averages.py`
- [RSI indicator](https://github.com/kumaranand05/stock-trading-screener/blob/main/indicators/rsi.py): `indicators/rsi.py`
- [Bollinger bands](https://github.com/kumaranand05/stock-trading-screener/blob/main/indicators/bollinger_bands.py): `indicators/bollinger_bands.py`
- [Signal analyzer](https://github.com/kumaranand05/stock-trading-screener/blob/main/strategies/technical_analysis.py): `strategies/technical_analysis.py`
- [Crossover strategies](https://github.com/kumaranand05/stock-trading-screener/blob/main/strategies/crossover_strategies.py): `strategies/crossover_strategies.py`
- [Crossover detection](https://github.com/kumaranand05/stock-trading-screener/blob/main/chart_utilities/intersection.py): `chart_utilities/intersection.py`
- [Linear regression](https://github.com/kumaranand05/stock-trading-screener/blob/main/chart_utilities/regression.py): `chart_utilities/regression.py`

### Persistence and results

- [Data and result writer](https://github.com/kumaranand05/stock-trading-screener/blob/main/ticker_info/download_data.py): `ticker_info/download_data.py`
- **Scanner results CSV**

### Other components

- **Screener operator**

## Connections

- Screener operator → Scan coordinator: runs (evidence: `README.md`)
- Scan coordinator → NSE stock list: reads symbols (evidence: `main.py`)
- Scan coordinator → Data collector: collects data (evidence: `main.py`)
- Data collector → Local stock history: reads history (evidence: `ticker_info/ticker_data.py`)
- Data collector → Local stock history: returns refreshed history (evidence: `ticker_info/ticker_data.py`)
- Data collector → yfinance API: fetches prices (evidence: `ticker_info/ticker_data.py`)
- Data collector → Moving averages: adds averages (evidence: `ticker_info/ticker_data.py`)
- Data collector → RSI indicator: adds RSI (evidence: `ticker_info/ticker_data.py`)
- Data collector → Bollinger bands: adds bands (evidence: `ticker_info/ticker_data.py`)
- Scan coordinator → Data and result writer: updates history (evidence: `main.py`)
- Scan coordinator → Signal analyzer: analyzes prices (evidence: `main.py`)
- Signal analyzer → Crossover strategies: evaluates strategies (evidence: `strategies/technical_analysis.py`)
- Crossover strategies → Crossover detection: checks crossings (evidence: `strategies/crossover_strategies.py`)
- Crossover detection → Linear regression: fits trends (evidence: `chart_utilities/intersection.py`)
- Scan coordinator → Performance metrics: gets metrics (evidence: `main.py`)
- Scan coordinator → Data and result writer: saves results (evidence: `main.py`)
- Data and result writer → Local stock history: writes history (evidence: `ticker_info/download_data.py`)
- Data and result writer → Scanner results CSV: writes CSV (evidence: `ticker_info/download_data.py`)
