# aiop247/market_update architecture

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

- Interactive diagram: https://gitdiagram.com/aiop247/market_update
- Repository: https://github.com/aiop247/market_update

## Overview

Market_Update is a collection of market-monitoring and trading-signal tools, with a Flask application alongside many independently runnable scanners. The main workflow is to obtain market candles or quotes, evaluate a strategy, and produce a signal; some scanners also persist signals or send alerts. The sampled code confirms historical-data access, sector filtering, signal persistence, and a web route, while the README provides no further product description. Scanner-to-helper links follow the SOURCE INDEX; unsampled details and dashboard wiring are omitted.

Main entry points: [`fetch_history.py`](https://github.com/aiop247/market_update/blob/main/fetch_history.py) (Historical data client), [`trading_signals.db`](https://github.com/aiop247/market_update/blob/main/trading_signals.db) (Signal database), [`app.py`](https://github.com/aiop247/market_update/blob/main/app.py) (Flask application), [`config.py`](https://github.com/aiop247/market_update/blob/main/config.py) (Runtime configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Flask application<br/>[app.py]"]
end

subgraph group_market["Market data"]
  node_hist["Historical data client<br/>[fetch_history.py]"]
end

subgraph group_strategies["Trading scanners"]
  node_nifty1["Nifty 50 1m"]
  node_scan1221["Supertrend SMA"]
  node_lodha["Lodha 5m"]
  node_persistent["Persistent 5m"]
  node_adx["ADX Supertrend"]
  node_combo["Combo trend"]
  node_niftyscan["Nifty 1m"]
  node_swing["Supertrend swing"]
  node_sector10["Sector filter"]
  node_heikin["Heikin Ashi"]
  node_niftyrun["Nifty buy sell"]
  node_momentum["Explosive momentum"]
  node_sector1["Sector momentum"]
  node_sectoralert["Sector alerts<br/>[1_sector_alert.py]"]
  node_legacy["Earlier scanner<br/>[070426.py]"]
end

subgraph group_state["Configuration and state"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_db[("Signal database<br/>[trading_signals.db]")]
end

node_user(("Market user"))
node_fyers{{"Fyers market API"}}

node_user -->|"opens dashboard"| node_webapp
node_webapp -->|"uses settings"| node_config
node_webapp -->|"uses data client"| node_hist
node_hist -->|"reads credentials"| node_config
node_hist -->|"requests candles"| node_fyers
node_nifty1 -->|"uses data client"| node_hist
node_scan1221 -->|"uses data client"| node_hist
node_lodha -->|"uses data client"| node_hist
node_persistent -->|"uses data client"| node_hist
node_adx -->|"uses data client"| node_hist
node_combo -->|"uses data client"| node_hist
node_niftyscan -->|"uses data client"| node_hist
node_swing -->|"uses data client"| node_hist
node_sector10 -->|"uses data client"| node_hist
node_heikin -->|"uses data client"| node_hist
node_niftyrun -->|"uses data client"| node_hist
node_momentum -->|"uses data client"| node_hist
node_sector1 -->|"uses data client"| node_hist
node_sectoralert -->|"uses settings"| node_config
node_legacy -->|"uses data client"| node_hist
node_scan1221 -->|"writes signals"| node_db
node_combo -->|"reads and writes"| node_db
node_niftyscan -->|"reads and writes"| node_db
node_adx -->|"reads and writes"| node_db
node_swing -->|"writes signals"| node_db

click node_webapp "https://github.com/aiop247/market_update/blob/main/app.py"
click node_hist "https://github.com/aiop247/market_update/blob/main/fetch_history.py"
click node_config "https://github.com/aiop247/market_update/blob/main/config.py"
click node_db "https://github.com/aiop247/market_update/blob/main/trading_signals.db"
click node_nifty1 "https://github.com/aiop247/market_update/blob/main/0_140726_Nifty_50_1min.py"
click node_scan1221 "https://github.com/aiop247/market_update/blob/main/0_2026_06_23_1221.py"
click node_lodha "https://github.com/aiop247/market_update/blob/main/0_LODHA_5_Min_140726.py"
click node_persistent "https://github.com/aiop247/market_update/blob/main/0_PERSISTENT_5_Min_140726.py"
click node_adx "https://github.com/aiop247/market_update/blob/main/0_adx_st_scanner_070726.py"
click node_combo "https://github.com/aiop247/market_update/blob/main/0_combo_trend_scanner_020726.py"
click node_niftyscan "https://github.com/aiop247/market_update/blob/main/0_nifty_1min_scanner_100726.py"
click node_swing "https://github.com/aiop247/market_update/blob/main/0_supertrend_11_4_scanner_2026_06_19.py"
click node_sector10 "https://github.com/aiop247/market_update/blob/main/10_sector_filtered_scanner.py"
click node_heikin "https://github.com/aiop247/market_update/blob/main/1_010626-buy-sell-5min-heikin-ashi_UPDATED.py"
click node_niftyrun "https://github.com/aiop247/market_update/blob/main/1_Nifty_50_run-buy-sell-1min.py"
click node_momentum "https://github.com/aiop247/market_update/blob/main/1_explosive_momentum_scanner.py"
click node_sector1 "https://github.com/aiop247/market_update/blob/main/1_sector_filtered_scanner.py"
click node_sectoralert "https://github.com/aiop247/market_update/blob/main/1_sector_alert.py"
click node_legacy "https://github.com/aiop247/market_update/blob/main/070426.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_webapp,node_user toneBlue
class node_hist toneAmber
class node_nifty1,node_scan1221,node_lodha,node_persistent,node_adx,node_combo,node_niftyscan,node_swing,node_sector10,node_heikin,node_niftyrun,node_momentum,node_sector1,node_sectoralert,node_legacy,node_fyers toneMint
class node_config,node_db toneRose
```

## Components

### Web application

- [Flask application](https://github.com/aiop247/market_update/blob/main/app.py): `app.py`

### Market data

- [Historical data client](https://github.com/aiop247/market_update/blob/main/fetch_history.py): `fetch_history.py`

### Trading scanners

- [Nifty 50 1m](https://github.com/aiop247/market_update/blob/main/0_140726_Nifty_50_1min.py): `0_140726_Nifty_50_1min.py`
- [Supertrend SMA](https://github.com/aiop247/market_update/blob/main/0_2026_06_23_1221.py): `0_2026_06_23_1221.py`
- [Lodha 5m](https://github.com/aiop247/market_update/blob/main/0_LODHA_5_Min_140726.py): `0_LODHA_5_Min_140726.py`
- [Persistent 5m](https://github.com/aiop247/market_update/blob/main/0_PERSISTENT_5_Min_140726.py): `0_PERSISTENT_5_Min_140726.py`
- [ADX Supertrend](https://github.com/aiop247/market_update/blob/main/0_adx_st_scanner_070726.py): `0_adx_st_scanner_070726.py`
- [Combo trend](https://github.com/aiop247/market_update/blob/main/0_combo_trend_scanner_020726.py): `0_combo_trend_scanner_020726.py`
- [Nifty 1m](https://github.com/aiop247/market_update/blob/main/0_nifty_1min_scanner_100726.py): `0_nifty_1min_scanner_100726.py`
- [Supertrend swing](https://github.com/aiop247/market_update/blob/main/0_supertrend_11_4_scanner_2026_06_19.py): `0_supertrend_11_4_scanner_2026_06_19.py`
- [Sector filter](https://github.com/aiop247/market_update/blob/main/10_sector_filtered_scanner.py): `10_sector_filtered_scanner.py`
- [Heikin Ashi](https://github.com/aiop247/market_update/blob/main/1_010626-buy-sell-5min-heikin-ashi_UPDATED.py): `1_010626-buy-sell-5min-heikin-ashi_UPDATED.py`
- [Nifty buy sell](https://github.com/aiop247/market_update/blob/main/1_Nifty_50_run-buy-sell-1min.py): `1_Nifty_50_run-buy-sell-1min.py`
- [Explosive momentum](https://github.com/aiop247/market_update/blob/main/1_explosive_momentum_scanner.py): `1_explosive_momentum_scanner.py`
- [Sector momentum](https://github.com/aiop247/market_update/blob/main/1_sector_filtered_scanner.py): `1_sector_filtered_scanner.py`
- [Sector alerts](https://github.com/aiop247/market_update/blob/main/1_sector_alert.py): `1_sector_alert.py`
- [Earlier scanner](https://github.com/aiop247/market_update/blob/main/070426.py): `070426.py`

### Configuration and state

- [Runtime configuration](https://github.com/aiop247/market_update/blob/main/config.py): `config.py`
- [Signal database](https://github.com/aiop247/market_update/blob/main/trading_signals.db): `trading_signals.db`

### Other components

- **Market user**
- **Fyers market API**

## Connections

- Market user → Flask application: opens dashboard (evidence: `app.py`)
- Flask application → Runtime configuration: uses settings (evidence: `app.py`)
- Flask application → Historical data client: uses data client (evidence: `app.py`)
- Historical data client → Runtime configuration: reads credentials (evidence: `fetch_history.py`)
- Historical data client → Fyers market API: requests candles (evidence: `fetch_history.py`)
- Nifty 50 1m → Historical data client: uses data client (evidence: `0_140726_Nifty_50_1min.py`)
- Supertrend SMA → Historical data client: uses data client (evidence: `0_2026_06_23_1221.py`)
- Lodha 5m → Historical data client: uses data client (evidence: `0_LODHA_5_Min_140726.py`)
- Persistent 5m → Historical data client: uses data client (evidence: `0_PERSISTENT_5_Min_140726.py`)
- ADX Supertrend → Historical data client: uses data client (evidence: `0_adx_st_scanner_070726.py`)
- Combo trend → Historical data client: uses data client (evidence: `0_combo_trend_scanner_020726.py`)
- Nifty 1m → Historical data client: uses data client (evidence: `0_nifty_1min_scanner_100726.py`)
- Supertrend swing → Historical data client: uses data client (evidence: `0_supertrend_11_4_scanner_2026_06_19.py`)
- Sector filter → Historical data client: uses data client (evidence: `10_sector_filtered_scanner.py`)
- Heikin Ashi → Historical data client: uses data client (evidence: `1_010626-buy-sell-5min-heikin-ashi_UPDATED.py`)
- Nifty buy sell → Historical data client: uses data client (evidence: `1_Nifty_50_run-buy-sell-1min.py`)
- Explosive momentum → Historical data client: uses data client (evidence: `1_explosive_momentum_scanner.py`)
- Sector momentum → Historical data client: uses data client (evidence: `1_sector_filtered_scanner.py`)
- Sector alerts → Runtime configuration: uses settings (evidence: `1_sector_alert.py`)
- Earlier scanner → Historical data client: uses data client (evidence: `070426.py`)
- Supertrend SMA → Signal database: writes signals (evidence: `0_2026_06_23_1221.py`)
- Combo trend → Signal database: reads and writes (evidence: `0_combo_trend_scanner_020726.py`)
- Nifty 1m → Signal database: reads and writes (evidence: `0_nifty_1min_scanner_100726.py`)
- ADX Supertrend → Signal database: reads and writes (evidence: `0_adx_st_scanner_070726.py`)
- Supertrend swing → Signal database: writes signals (evidence: `0_supertrend_11_4_scanner_2026_06_19.py`)
