Metadata-Version: 2.4
Name: nse-trader-bot
Version: 1.0.0
Summary: Autonomous Indian (NSE) stock market day-trading bot with high risk-reward strategy, real Yahoo Finance data, and live terminal dashboard
Author: Eshaan Sarkar
License-Expression: MIT
Project-URL: Homepage, https://github.com/eshaansarkardipsite/trader-bot
Project-URL: Repository, https://github.com/eshaansarkardipsite/trader-bot
Keywords: trading,nse,stock,bot,algorithmic,day-trading,indian-market
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=13.7.0
Requires-Dist: websocket-client>=1.7.0

# 🇮🇳 Indian Market Day-Trading Bot

An autonomous day-trading bot for the **Indian (NSE) stock market** using real
market data. It starts with **2000 INR virtual credits** used **exclusively for
trading** — no credits are consumed for uptime. The bot dies only if credits
reach 0 or below from trading losses.

## ✨ Features

- **Real NSE/BSE data** via Yahoo Finance (free, no API key required)
- **Autonomous asset selection** — picks the most profitable stocks to trade
- **High risk:reward (1:3)** with multi-indicator confirmation (EMA, RSI, MACD,
  Bollinger Bands, ATR, momentum, higher-timeframe trend)
- **Credit system** — 2000 INR for trading only, no uptime burn, dies at 0
- **Emergency micro-scalping mode** when credits drop below 20%
- **Live terminal dashboard** showing in real time:
  - Available credits (₹)
  - Market status (NSE open/closed)
  - Selected assets with scores & live prices
  - Position size (₹ invested per trade)
  - Open positions with entry/current/SL/TP/conf
  - Unrealized & realized P&L
  - Win rate, trades, drawdown, confidence threshold
- **Market-hours awareness** — avoids opening new trades when NSE is closed
- **Self-logging** of every action

## 🚀 Quick Start

```bash
# 1. Install dependencies
pip install -r requirements.txt

# 2. Run the bot (runs indefinitely)
python bot.py
```

## ⚙️ How it works

1. Continuously fetches live prices for 20 NSE large-cap stocks.
2. Ranks assets by **profit potential** (momentum + volatility + trend +
   liquidity) and picks the top 3-4.
3. Computes a **confidence score** for each from aligned indicators.
4. Only enters trades with **confidence ≥ 62%**.
5. Each trade has a **1:3 risk:reward** (tight stop, wider target).
6. Positions are managed continuously — closed at SL/TP, trailing stop, or
   time exit.
7. Credits change only from trading P&L; when they hit 0, the bot dies.

## 🎛 Modifiable constants (in `config.py`)

| Constant | Default | Meaning |
|----------|---------|---------|
| `INITIAL_CREDITS` | `2000.0` | Starting credits (₹) |
| `CREDIT_BURN_PER_SEC` | `0.0` | Uptime burn rate (0 = trading only) |
| `CANDIDATE_SYMBOLS` | 20 NSE stocks | Universe to trade |
| `BASE_RISK_PCT` | `0.15` | Risk 15% per trade |
| `RISK_REWARD` | `3.0` | Target risk:reward |
| `CONF_THRESHOLD` | `0.62` | Min confidence to trade |

## 📁 Files

| File | Purpose |
|------|---------|
| `bot.py` | Main engine / loop (multi-threaded) |
| `strategy.py` | Signal generation (high confidence, 1:3 R:R) |
| `market_data.py` | Yahoo Finance NSE data & asset scoring |
| `indicators.py` | Technical indicators (EMA, RSI, MACD, BB, ATR) |
| `risk.py` | Risk management & credit survival |
| `executor.py` | Virtual trade execution & P&L tracking |
| `dashboard.py` | Live terminal dashboard (₹, positions, P&L) |
| `config.py` | Central configuration |

## ⚠️ Disclaimer

This is a **virtual trading simulation** for educational purposes. It does not
place real trades. Financial trading carries risk. Use responsibly.
</content>
