# marketfeedtelugu/marketfeedtelugu-screener architecture

> Architecture diagram of the GitHub repository marketfeedtelugu/marketfeedtelugu-screener, 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/marketfeedtelugu/marketfeedtelugu-screener
- Repository: https://github.com/marketfeedtelugu/marketfeedtelugu-screener

## Overview

This is a Claude Code–driven stock-screener product: users define a strategy card, fetch market data, screen a stock universe into risk-sized trade plans, review news, then evaluate the strategy through backtesting or paper trading. The dashboard presents the funnel, charts, and results. The graph also shows the expression, bar/timeframe, and simulation layers that support these workflows. Some module relationships are documented by the README or SOURCE INDEX; unsampled implementation details are omitted rather than inferred.

Main entry points: [`engine/scan.py`](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/scan.py) (Universe scanner), [`screener.py`](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/screener.py) (Screener CLI), [`engine/data.py`](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/data.py) (Market data), [`engine/backtest.py`](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/backtest.py) (Backtesting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Strategy workflow"]
  node_cli["Screener CLI<br/>[screener.py]"]
  node_cards["Strategy cards<br/>[card.py]"]
end

subgraph group_market["Market analysis"]
  node_data[("Market data<br/>[data.py]")]
  node_panel["Market panel<br/>[panel.py]"]
  node_scanner["Universe scanner<br/>[scan.py]"]
  node_news["News checks<br/>[news.py]"]
end

subgraph group_evaluation["Testing and review"]
  node_backtest["Backtesting<br/>[backtest.py]"]
  node_forward["Forward testing<br/>[forward.py]"]
  node_report["Backtest reports<br/>[report.py]"]
  node_dashboard["Interactive dashboard<br/>[dashboard.py]"]
  node_static["Static dashboard"]
end

subgraph group_runtime["Trading engine"]
  node_bars["Bar histories<br/>[bars.py]"]
  node_timeframes["Timeframe mapping<br/>[timeframes.py]"]
  node_expressions["Rule expressions<br/>[expr.py]"]
  node_risk["Position sizing<br/>[risk.py]"]
  node_simulator["Trade simulation<br/>[sim.py]"]
end

node_user(("Strategy author"))
node_yahoo["Yahoo Finance"]
node_nse["NSE data"]

node_user -->|"requests screener"| node_cli
node_cli -->|"creates and reads"| node_cards
node_cli -->|"downloads data"| node_data
node_data -->|"fetches bars"| node_yahoo
node_data -->|"fetches lists and filings"| node_nse
node_cli -->|"runs scan"| node_scanner
node_scanner -->|"loads market data"| node_data
node_scanner -->|"evaluates card rules"| node_cards
node_scanner -->|"uses market context"| node_panel
node_scanner -->|"screens histories"| node_bars
node_scanner -->|"checks rules"| node_expressions
node_scanner -->|"sizes plans"| node_risk
node_scanner -->|"simulates signals"| node_simulator
node_scanner -->|"builds chart history"| node_timeframes
node_cli -->|"checks trade news"| node_news
node_cli -->|"runs backtest"| node_backtest
node_backtest -->|"simulates trades"| node_simulator
node_backtest -->|"tests funnel history"| node_panel
node_backtest -->|"accounts for costs"| node_risk
node_cli -->|"starts paper trading"| node_forward
node_forward -->|"refreshes signals"| node_scanner
node_forward -->|"paper-trades signals"| node_simulator
node_cli -->|"builds reports"| node_report
node_cli -->|"renders results"| node_dashboard
node_dashboard -->|"generates static view"| node_static
node_cards -->|"compiles rules"| node_expressions
node_timeframes -->|"loads bar data"| node_data
node_expressions -->|"evaluates bar series"| node_bars

click node_cli "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/screener.py"
click node_cards "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/card.py"
click node_data "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/data.py"
click node_bars "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/bars.py"
click node_timeframes "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/timeframes.py"
click node_expressions "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/expr.py"
click node_panel "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/panel.py"
click node_scanner "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/scan.py"
click node_risk "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/risk.py"
click node_simulator "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/sim.py"
click node_news "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/news.py"
click node_backtest "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/backtest.py"
click node_forward "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/forward.py"
click node_report "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/report.py"
click node_dashboard "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/dashboard.py"
click node_static "https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/dashboard_static.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_cli,node_cards toneBlue
class node_data,node_panel,node_scanner,node_news toneAmber
class node_backtest,node_forward,node_report,node_dashboard,node_static toneMint
class node_bars,node_timeframes,node_expressions,node_risk,node_simulator toneRose
class node_user,node_yahoo,node_nse toneIndigo
```

## Components

### Strategy workflow

- [Screener CLI](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/screener.py): `screener.py`
- [Strategy cards](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/card.py): `engine/card.py`

### Market analysis

- [Market data](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/data.py): `engine/data.py`
- [Market panel](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/panel.py): `engine/panel.py`
- [Universe scanner](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/scan.py): `engine/scan.py`
- [News checks](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/news.py): `engine/news.py`

### Testing and review

- [Backtesting](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/backtest.py): `engine/backtest.py`
- [Forward testing](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/forward.py): `engine/forward.py`
- [Backtest reports](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/report.py): `engine/report.py`
- [Interactive dashboard](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/dashboard.py): `engine/dashboard.py`
- [Static dashboard](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/dashboard_static.py): `engine/dashboard_static.py`

### Trading engine

- [Bar histories](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/bars.py): `engine/bars.py`
- [Timeframe mapping](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/timeframes.py): `engine/timeframes.py`
- [Rule expressions](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/expr.py): `engine/expr.py`
- [Position sizing](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/risk.py): `engine/risk.py`
- [Trade simulation](https://github.com/marketfeedtelugu/marketfeedtelugu-screener/blob/main/engine/sim.py): `engine/sim.py`

### Other components

- **Strategy author**
- **Yahoo Finance**
- **NSE data**

## Connections

- Strategy author → Screener CLI: requests screener (evidence: `README.md`)
- Screener CLI → Strategy cards: creates and reads (evidence: `README.md`)
- Screener CLI → Market data: downloads data (evidence: `README.md`)
- Market data → Yahoo Finance: fetches bars (evidence: `engine/data.py`)
- Market data → NSE data: fetches lists and filings (evidence: `engine/data.py`)
- Screener CLI → Universe scanner: runs scan (evidence: `README.md`)
- Universe scanner → Market data: loads market data (evidence: `engine/scan.py`)
- Universe scanner → Strategy cards: evaluates card rules (evidence: `engine/scan.py`)
- Universe scanner → Market panel: uses market context (evidence: `engine/scan.py`)
- Universe scanner → Bar histories: screens histories (evidence: `engine/scan.py`)
- Universe scanner → Rule expressions: checks rules (evidence: `engine/scan.py`)
- Universe scanner → Position sizing: sizes plans (evidence: `engine/scan.py`)
- Universe scanner → Trade simulation: simulates signals (evidence: `engine/scan.py`)
- Universe scanner → Timeframe mapping: builds chart history (evidence: `engine/scan.py`)
- Screener CLI → News checks: checks trade news (evidence: `README.md`)
- Screener CLI → Backtesting: runs backtest (evidence: `README.md`)
- Backtesting → Trade simulation: simulates trades (evidence: `engine/backtest.py`)
- Backtesting → Market panel: tests funnel history (evidence: `engine/backtest.py`)
- Backtesting → Position sizing: accounts for costs (evidence: `engine/backtest.py`)
- Screener CLI → Forward testing: starts paper trading (evidence: `README.md`)
- Forward testing → Universe scanner: refreshes signals (evidence: `engine/forward.py`)
- Forward testing → Trade simulation: paper-trades signals (evidence: `engine/forward.py`)
- Screener CLI → Backtest reports: builds reports (evidence: `screener.py`)
- Screener CLI → Interactive dashboard: renders results (evidence: `README.md`)
- Interactive dashboard → Static dashboard: generates static view (evidence: `engine/dashboard.py`)
- Strategy cards → Rule expressions: compiles rules (evidence: `engine/card.py`)
- Timeframe mapping → Market data: loads bar data (evidence: `engine/timeframes.py`)
- Rule expressions → Bar histories: evaluates bar series (evidence: `engine/expr.py`)
