# srikar-kodakandla/fully-automated-nifty-options-trading architecture

> Architecture diagram of the GitHub repository srikar-kodakandla/fully-automated-nifty-options-trading, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srikar-kodakandla/fully-automated-nifty-options-trading
- Repository: https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading

## Overview

This is a deprecated automated Nifty-options trading system. Its main workflow is scheduled strategy execution: obtain market data, evaluate SuperTrend/ADX signals, select an options spread, and place/manage trades through Zerodha Kite automation; Fyers supplies data and also has separate login, order, and live-feed support. The repository also includes historical backtesting and parameter/stock-selection research. Edges are limited to relationships visible in excerpts, the source index, or README; unsampled internals are not asserted.

Main entry points: [`kite_strategy.py`](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite_strategy.py) (Options strategy), [`fyers/live.py`](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/live.py) (Historical and live data), [`common/backtestingsuper.py`](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/backtestingsuper.py) (SuperTrend backtest), [`fyers/insert_database.py`](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/insert_database.py) (Tick ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Trading runtime"]
  node_strategy["Options strategy<br/>[kite_strategy.py]"]
end

subgraph group_research["Strategy research"]
  node_signals["Technical indicators<br/>[indicator.py]"]
  node_backtest["SuperTrend backtest"]
  node_research_tools["Strategy research"]
  node_stock_selection["Stock selection"]
end

subgraph group_fyers["Fyers data and trading"]
  node_fyers_login["Fyers account login<br/>[accounts_login.py]"]
  node_fyers_auth["Fyers authentication<br/>[login.py]"]
  node_fyers_data["Historical and live data<br/>[live.py]"]
  node_history["History API<br/>[history.py]"]
  node_tick_feed["Tick ingestion<br/>[insert_database.py]"]
  node_tick_store[("Tick database<br/>[database.py]")]
  node_history_store["Stored history lookup<br/>[look_database.py]"]
  node_fyers_orders["Fyers order service<br/>[order.py]"]
end

subgraph group_kite["Zerodha automation"]
  node_kite_broker["Kite browser broker<br/>[Zerodha.py]"]
  node_simulator["Market simulator<br/>[MarketSimulator.py]"]
  node_kite_backtester["Kite backtester<br/>[Backtester.py]"]
end

subgraph group_support["Accounts and messaging"]
  node_account_feeder["Account tick runner"]
  node_notifier["Trade notifications<br/>[message.py]"]
end

node_scheduler(("Market scheduler"))
node_telegram(("Telegram"))

node_scheduler -->|"schedules"| node_strategy
node_strategy -->|"executes trades"| node_kite_broker
node_strategy -->|"gets market data"| node_fyers_data
node_strategy -.->|"evaluates signals"| node_signals
node_strategy -.->|"reports trades"| node_notifier
node_strategy -.->|"manages positions"| node_fyers_orders
node_fyers_login -->|"uses login"| node_fyers_auth
node_fyers_login -.->|"loads data"| node_fyers_data
node_fyers_data -->|"fetches candles"| node_history
node_fyers_data -->|"reads stored data"| node_history_store
node_account_feeder -->|"starts ingestion"| node_tick_feed
node_tick_feed -->|"writes ticks"| node_tick_store
node_tick_feed -->|"reports status"| node_notifier
node_backtest -->|"computes indicators"| node_signals
node_backtest -->|"loads accounts"| node_fyers_login
node_backtest -->|"loads candles"| node_fyers_data
node_notifier -->|"sends messages"| node_telegram
node_kite_backtester -->|"uses simulator"| node_simulator
node_simulator -->|"delegates broker"| node_kite_broker

click node_strategy "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite_strategy.py"
click node_signals "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/indicator.py"
click node_backtest "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/backtestingsuper.py"
click node_research_tools "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/tree/main/common"
click node_stock_selection "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/stock_selection_features_atr.py"
click node_fyers_login "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/accounts_login.py"
click node_fyers_auth "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/login.py"
click node_fyers_data "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/live.py"
click node_history "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/history.py"
click node_tick_feed "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/insert_database.py"
click node_tick_store "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/database.py"
click node_history_store "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/look_database.py"
click node_fyers_orders "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/order.py"
click node_kite_broker "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite/Brokers/Zerodha.py"
click node_simulator "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite/Brokers/MarketSimulator.py"
click node_kite_backtester "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite/Backtester.py"
click node_account_feeder "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/accounts_database.py"
click node_notifier "https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/message.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_strategy toneBlue
class node_signals,node_backtest,node_research_tools,node_stock_selection toneAmber
class node_fyers_login,node_fyers_auth,node_fyers_data,node_history,node_tick_feed,node_tick_store,node_history_store,node_fyers_orders toneMint
class node_kite_broker,node_simulator,node_kite_backtester,node_scheduler toneRose
class node_account_feeder,node_notifier,node_telegram toneIndigo
```

## Components

### Trading runtime

- [Options strategy](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite_strategy.py): `kite_strategy.py`

### Strategy research

- [Technical indicators](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/indicator.py): `common/indicator.py`
- [SuperTrend backtest](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/backtestingsuper.py): `common/backtestingsuper.py`
- [Strategy research](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/tree/main/common): `common`
- [Stock selection](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/stock_selection_features_atr.py): `common/stock_selection_features_atr.py`

### Fyers data and trading

- [Fyers account login](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/accounts_login.py): `fyers/accounts_login.py`
- [Fyers authentication](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/login.py): `fyers/login.py`
- [Historical and live data](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/live.py): `fyers/live.py`
- [History API](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/history.py): `fyers/history.py`
- [Tick ingestion](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/insert_database.py): `fyers/insert_database.py`
- [Tick database](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/database.py): `fyers/database.py`
- [Stored history lookup](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/look_database.py): `fyers/look_database.py`
- [Fyers order service](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/fyers/order.py): `fyers/order.py`

### Zerodha automation

- [Kite browser broker](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite/Brokers/Zerodha.py): `kite/Brokers/Zerodha.py`
- [Market simulator](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite/Brokers/MarketSimulator.py): `kite/Brokers/MarketSimulator.py`
- [Kite backtester](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/kite/Backtester.py): `kite/Backtester.py`

### Accounts and messaging

- [Account tick runner](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/accounts_database.py): `accounts_database.py`
- [Trade notifications](https://github.com/srikar-kodakandla/fully-automated-nifty-options-trading/blob/main/common/message.py): `common/message.py`

### Other components

- **Market scheduler**
- **Telegram**

## Connections

- Market scheduler → Options strategy: schedules
- Options strategy → Kite browser broker: executes trades (evidence: `kite_strategy.py`)
- Options strategy → Historical and live data: gets market data
- Options strategy → Technical indicators: evaluates signals
- Options strategy → Trade notifications: reports trades
- Options strategy → Fyers order service: manages positions
- Fyers account login → Fyers authentication: uses login (evidence: `fyers/accounts_login.py`)
- Fyers account login → Historical and live data: loads data
- Historical and live data → History API: fetches candles (evidence: `fyers/live.py`)
- Historical and live data → Stored history lookup: reads stored data (evidence: `fyers/live.py`)
- Account tick runner → Tick ingestion: starts ingestion (evidence: `accounts_database.py`)
- Tick ingestion → Tick database: writes ticks (evidence: `fyers/insert_database.py`)
- Tick ingestion → Trade notifications: reports status (evidence: `fyers/insert_database.py`)
- SuperTrend backtest → Technical indicators: computes indicators (evidence: `common/backtestingsuper.py`)
- SuperTrend backtest → Fyers account login: loads accounts (evidence: `common/backtestingsuper.py`)
- SuperTrend backtest → Historical and live data: loads candles (evidence: `common/backtestingsuper.py`)
- Trade notifications → Telegram: sends messages (evidence: `common/message.py`)
- Kite backtester → Market simulator: uses simulator (evidence: `kite/Backtester.py`)
- Market simulator → Kite browser broker: delegates broker (evidence: `kite/Brokers/MarketSimulator.py`)
