CommunityResearch & Data Analysisgithub.com

aryanpardeshi11/nse-bse-hybrid-trader

Institutional-grade Indian stock market (NSE/BSE) intraday, swing, and F&O analysis and deterministic execution engine. Use whenever the user asks to analyze an Indian stock or index (NIFTY, BANKNIFTY, FINNIFTY, SENSEX, or NSE/BSE tickers), evaluate intraday/swing setups (ORB, VWAP, RSI Divergence, Fibonacci), calculate exact INR position sizes with STT/GST/SEBI/stamp duty taxes, run Monte Carlo historical intraday simulations, or stage paper/live orders across major Indian brokers (Zerodha Kite, Angel One SmartAPI, Upstox, Dhan, Fyers, Groww, Kotak Neo, ICICI Breeze, Shoonya).

What is nse-bse-hybrid-trader?

nse-bse-hybrid-trader is a Claude Code agent skill that institutional-grade Indian stock market (NSE/BSE) intraday, swing, and F&O analysis and deterministic execution engine. Use whenever the user asks to analyze an Indian stock or index (NIFTY, BANKNIFTY, FINNIFTY, SENSEX, or NSE/BSE tickers), evaluate intraday/swing setups (ORB, VWAP, RSI Divergence, Fibonacci), calculate exact INR position sizes with STT/GST/SEBI/stamp duty taxes, run Monte Carlo historical intraday simulations, or stage paper/live orders across major Indian brokers (Zerodha Kite, Angel One SmartAPI, Upstox, Dhan, Fyers, Groww, Kotak Neo, ICICI Breeze, Shoonya).

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aryanpardeshi11/indian-day-trader-skill/tree/HEAD/.agents/skills/nse-bse-hybrid-trader

Installed? Explore more Research & Data Analysis skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

NSE/BSE Hybrid Trader

A decoupled trading intelligence and execution skill for Indian equities and derivatives. The LLM performs probabilistic technical and market-structure reasoning (nse-trading-skills synthesis), while deterministic Python scripts enforce INR sizing, broker-accurate brokerage & Indian statutory tax math, 10,000-path Monte Carlo simulation, and multi-broker paper/live execution gating (day-trader-skill architecture).

Supported Indian Brokers

Select any broker via --broker <name> (or set "default_broker" in trading_rules.json):

  • angel_one — Angel One SmartAPI (--broker angel_one, default)
  • zerodha — Zerodha Kite Connect v3 (--broker zerodha / alias kite)
  • upstox — Upstox API v3 (--broker upstox)
  • dhan — DhanHQ API v2 (--broker dhan)
  • fyers — Fyers API v3 (--broker fyers)
  • groww — Groww Trading API v1 (--broker groww)
  • kotak_neo — Kotak Neo Trade API (--broker kotak_neo / alias kotak)
  • icici_breeze — ICICI Direct Breeze API v1 (--broker icici_breeze / alias breeze)
  • shoonya — Finvasia Shoonya Noren API (--broker shoonya / alias finvasia)

Inspect fee profiles, endpoints, and required .env keys anytime with:

python .agents/skills/nse-bse-hybrid-trader/scripts/broker_bridge.py brokers

Configuration & References

Core 5-Step Operational Pipeline

Never rely on mental math for position sizing, tax drag, or probability estimation. Run this sequence from .agents/skills/nse-bse-hybrid-trader/ (or pass the script paths from workspace root):

Step 1 & 2: Indian Market Structure & Multi-Timeframe Confluence

Run nse_data_loader.py to fetch live NSE/BSE 5m, 1d, and 1wk data and compute EMA 20/50/200, PDH/PDL/PDC, 15m Opening Range (ORH/ORL), Anchored Intraday VWAP, RSI(14) + divergences, MACD, ADX, Bollinger Bands, ATR(14), Fibonacci retracements/extensions, RVOL, and a 0-6 Confluence Score:

python .agents/skills/nse-bse-hybrid-trader/scripts/nse_data_loader.py --symbol "<TICKER>" --json

Apply the guardrails in indian_market_rules.md and frameworks in technical_frameworks.md:

  • IST Timing: Observe only during 09:00-09:15 (pre-open) and 09:15-09:30 (Opening Range). Primary intraday execution runs 09:30-14:30 IST. Block new intraday entries after 14:30 IST; flatten open intraday positions by 15:10 IST.
  • Regulatory Checks: Verify circuit bands (2%/5%/10%/20%), SEBI ASM/GSM status, NSE F&O Ban (>95% MWPL), and expiry-day pin/gamma risk. Pass --fno-ban, --asm-gsm, --circuit-band, or --delivery-pct when known.
  • Coordinates: Establish concrete entry, structural stop_loss (invalidation + ATR buffer, rounded to Rs. 0.05 ticks), target_1 (>= 1.5 net R:R), and target_2. Skip setups scoring < 3/6 on confluence.

Step 3: Intraday / Swing Time Machine (nse_timemachine.py)

Test the trade coordinates against 10,000 bootstrapped paths drawn from the ticker's recent 60-day 5m intraday sessions (truncated strictly at 15:15 IST, conservative stop-first check, 1-tick slippage) or 2-year daily pool (--mode SWING), plus historical 15m ORB replay (pass --broker <BROKER> for broker-specific fee drag):

python .agents/skills/nse-bse-hybrid-trader/scripts/nse_timemachine.py --symbol "<TICKER>.NS" --entry <ENTRY> --stop <STOP> --target <TARGET_1> --mode <INTRADAY|SWING> --broker <BROKER> --write --json
  • Gate Requirement: Require positive tax-adjusted Expectancy (avg_net_r > 0) plus clearing the active probability threshold in trading_rules.json:
    • r_breakeven (default): target_first_resolved_pct >= (1 + tax_drag_r) / (1 + R) — realistic R-scaled edge after Indian charges.
    • strict_55 (override via --gate-mode strict_55): target_first_resolved_pct >= 55% — ultra-selective high-win-rate filter.
    • Both thresholds are always reported; if the active gate returns NO-TRADE, downgrade the setup immediately.

Step 4: Deterministic Risk, Broker Fee & Tax Gate (indian_risk_gate.py)

Compute exact INR share/lot sizing, broker-specific brokerage (e.g., zero delivery fee on Zerodha/Dhan/Shoonya vs Rs. 10/order on Kotak Neo vs percentage/capped plans on Angel One/Groww/ICICI Breeze), statutory friction (STT 2026 rates, NSE Transaction Fee, SEBI Fee, Stamp Duty, DP charge, 18% GST), and verify all hard circuit breakers:

python .agents/skills/nse-bse-hybrid-trader/scripts/indian_risk_gate.py --broker <BROKER> --symbol "<TICKER>" --capital <CAPITAL_INR> --risk-pct <RISK_PCT> --entry <ENTRY> --stop <STOP> --target <TARGET_1> --segment <EQ_INTRADAY|EQ_DELIVERY|FNO_FUT|FNO_OPT> --timemachine-json .agents/skills/nse-bse-hybrid-trader/state/timemachine_result.json --write --json
  • Hard Circuit Breakers: Max risk/trade 1.0% default (2.0% hard ceiling), tax-inclusive sizing, min net R:R >= 1.5, max daily drawdown 3.0% (auto-checked against SQLite paper ledger), exact whole-share / F&O lot rounding, IST window lock, and circuit/ban checks.
  • Never override a BLOCK verdict.

Step 5: Multi-Broker Order Staging & Paper/Live Dispatch (broker_bridge.py)

Only after Steps 3 and 4 return PASS:

  1. (Optional, once daily per broker) Sync instrument master to local SQLite (<2ms symbol/token/lot-size lookup — supports .json, .json.gz, and .csv):

    python .agents/skills/nse-bse-hybrid-trader/scripts/broker_bridge.py sync-scrip --broker <BROKER>
    

    (Pass --offline <path> for custom/exported CSV or JSON masters, e.g. Kotak Neo / ICICI Breeze / Shoonya.)

  2. Paper Ledger (Default): Stage with verified risk fingerprint, broker-native payload, and simulated Rs. 0.05 tick slippage:

    python .agents/skills/nse-bse-hybrid-trader/scripts/broker_bridge.py stage --broker <BROKER> --symbol "<TICKER>" --segment <SEGMENT> --entry <ENTRY> --stop <STOP> --target <TARGET_1> --risk-json .agents/skills/nse-bse-hybrid-trader/state/risk_verdict.json --paper
    
  3. Live Multi-Broker Dispatch (--live): Requires open IST execution window, resolved token (for angel_one, upstox, dhan, or any F&O contract), broker credentials in .env (check brokers subcommand), and explicit confirmation passing --live --confirm "CONFIRM LIVE".

Required Output Format

Always present final trade analyses in this 4-block structure:

  1. Market & Regulatory Context: Ticker, Broker, Segment, IST Phase, Circuit/ASM/F&O Ban status, HTF Bias, RVOL & Delivery % notes.
  2. Technical Setup Matrix: Entry, Stop-Loss, Target 1, Target 2 (Rs. 0.05 tick aligned), Confluence Score (X/6), and exact triggers (VWAP, 15m ORH/ORL, Fib pocket, RSI Divergence, PDH/PDL).
  3. Time Machine & Tax-Adjusted Risk Gate: Position Size (Shares/Lots), Margin Required, Broker Fee + Statutory Charges & Breakeven Move (INR), Net R:R after taxes, Monte Carlo Target-First % & Net EV, and Gate Verdict (PASS / BLOCK).
  4. Actionable Execution Ticket: Ready-to-run broker_bridge.py CLI command and broker-native JSON/form payload.

What It Never Does

  • Never places a live order automatically or from a scheduled/background run (--paper is always the default).
  • Never overrides a BLOCK verdict from indian_risk_gate.py or a NO-TRADE verdict from nse_timemachine.py.
  • Never asks for, stores, or echoes broker API keys, MPINs, or TOTP secrets in chat (keys stay in local .env).
  • Never relies on mental math for INR position sizing, statutory taxes, or win-rate estimation.
  • Never treats a historical Time Machine simulation or stop-loss level as a guaranteed fill or prediction.

Safety, Code Review & Risk Disclaimer

  • Trade at your own risk — author is not responsible: Educational and automation tooling only, NOT SEBI-registered investment, financial, or tax advice. You assume 100% responsibility for any trades, bugs, API errors, slippage, circuit freezes, or financial losses.
  • Review every file before running: Inspect config/trading_rules.json (brokerage/STT/GST rates), config/nse_holidays.json (exchange holidays), and scripts/broker_bridge.py before live execution. Note that _strip_attached_fields() strips attached_stoploss_trigger and attached_target_price on non-ROBO/non-BO live orders, so traders using non-bracket order modes must place and verify separate stop-loss/target/GTT orders on their broker terminal.
  • Unofficial data disclaimer: Built-in live candles use Yahoo Finance's free unofficial chart endpoint (5m/1d/1wk), which can lag, rate-limit, or miss corporate actions. Verify live quotes directly with your broker before acting.

Related Skills