πŸ“„ PAPER TRADING β€” MONTH 1 OF 3

Trade-Lab.
AI That Trades
The Market.

An autonomous AI agent that trades NSE/BSE Nifty 50 stocks using four backtested swing strategies. Wakes at 9:00 AM IST every trading day, scans 32 stocks, consults Claude AI, and executes β€” fully without human involvement.

PYTHON CLAUDE AI DYNAMIC RISK AI UPSTOX API AZURE VM TELEGRAM

// SYSTEM STATUS

Phase Paper Trading
Market NSE/BSE Nifty 50
Stocks Scanned 32 Nifty 50
Capital β‚Ή1,00,000
Jobs/Day 11 automated
AI Brain Claude (Anthropic)
Market Context Dynamic (4-State AI)
Data Feed Upstox API (SEBI)
Infrastructure Azure VM 24/7
System running since May 2026
SCROLL TO EXPLORE β†’
EMA Crossover ✦ Supertrend + MACD ✦ Dynamic Context ✦ Defensive Mode ✦ Breakout + Volume ✦ Momentum Pullback ✦ Claude AI ✦ Upstox API ✦ Azure VM ✦ NSE/BSE ✦ Risk Manager ✦ Self-Learning ✦ Swing Trading ✦ EMA Crossover ✦ Supertrend + MACD ✦ Dynamic Context ✦ Defensive Mode ✦ Breakout + Volume ✦ Momentum Pullback ✦ Claude AI ✦ Upstox API ✦ Azure VM ✦ NSE/BSE ✦ Risk Manager ✦ Self-Learning ✦ Swing Trading ✦
01 / The Problem

Human Limitations

Markets generate data every millisecond. Humans cannot scan 32 stocks simultaneously, enforce discipline under pressure, or wake at 9:00 AM IST without fail β€” every single day.

Bad Data = Bad Decisions

Yahoo Finance was an unofficial scraper β€” random 429 errors, 15–30 min stale prices, silent failures. Replaced with Upstox API: official SEBI-regulated, real-time, SLA-backed.

No Learning = No Edge

Static rule engines don't improve. Trade-Lab analyzes every closed trade across 10 dimensions and injects lessons directly into the AI's decision context β€” every week.

02 / Architecture

How It
Thinks.

AZURE VM 09:00 IST β€” Daily Trigger
HOLIDAY CHECK 16 NSE/BSE 2026 holidays
AI NIFTY CONTEXT Strong/Neutral/Mild/Bear
UPSTOX API 6mo OHLCV Β· Real-time
32 STOCKS Nifty 50 universe
30-MIN CACHE No redundant calls
EMA+RSI Score 1.0 Β· WR 63%
ST+MACD Score 1.2β˜… Β· WR 66%
BREAKOUT Score 0.8 Β· WR 57%
MOMENTUM Score 1.0 Β· WR 65%
SCORE GATE β‰₯ 2.0 β‰₯2 strategies must agree β†’ else SKIP
EARNINGS GATE Β±5 days β†’ skip
SIGNAL FRESHNESS Stale >3d β†’ skip
LEARNING MEMORY 10-dim lessons injected
CLAUDE AI decision Β· confidence Β· entry Β· SL Β· TP ~$0.005 per call
β‘ 
β‘‘
β‘’
β‘£
β‘€
β‘₯
⑦
ALL 7 MUST PASS
PAPER BROKER +0.08% slippage
TRADE JOURNAL 30+ fields recorded
TELEGRAM Instant phone alert
03 / Daily Schedule

11 Jobs. Every Trading Day.

Fully autonomous β€” no human involvement required

09:00
Live Scan
Claude API
09:30
SL/TP Check
10:15
SL/TP Check
11:00
SL/TP Check
11:45
SL/TP Check
12:30
Midday Check
13:15
SL/TP Check
14:00
SL/TP Check
14:45
SL/TP Check
15:15
SL/TP Check
15:45
EOD Close
Sunday 20:00
Weekly Self-Learning Analysis
10-dim analysis Β· Updates context
04 / Strategies

Four Strategies.
One Consensus.

Score gate β‰₯ 2.0 required β€” at least 2 strategies must agree before Claude AI is consulted.

WEIGHT 1.0

EMA Crossover + RSI

0%

28 trades/yr Β· ~4 day hold

ENTRY: 9 > 21 > 50 > 200 EMA + RSI 40–70 + ADX > 20
SL/TP: entry βˆ’ 1.5Γ—ATR / entry + 3Γ—ATR
WEIGHT 1.2 β˜… BEST

Supertrend + MACD

0%

22 trades/yr Β· ~5 day hold

ENTRY: ST = Bullish + MACD > Signal line
SL/TP: ST line / entry + 2.5Γ—ATR
WEIGHT 0.8

Breakout + Volume

0%

15 trades/yr Β· ~7 day hold

ENTRY: Close > 20d high + Volume > 1.3Γ— avg
SL/TP: entry Γ— 93% / entry Γ— 115%
WEIGHT 1.0

Momentum Pullback

0%

20 trades/yr Β· ~4 day hold

ENTRY: Close > 20 > 50 EMA + RSI 45–62 + MACD hist > 0
SL/TP: entry βˆ’ 1.5Γ—ATR / entry + 3Γ—ATR
EMA+RSI
1.0
+
ST+MACD
1.2
+
BKT
0.8
+
MOM
1.0

COMBINED SCORE β‰₯ 2.0

CLAUDE AI CALLED

05 / Self-Learning

The Bot That
Gets Smarter.

Every Sunday at 20:00 IST, Trade-Lab analyzes every closed trade across 10 dimensions and injects lessons directly into Claude's decision context.

TRADE CLOSESpaper_broker.sell() β†’ journal
SUNDAY ANALYSISTradeAnalyzer runs 10-dim
CLAUDE CONTEXTLessons injected morningly
β‘  Overall Performance
β‘‘ By Strategy Combo
β‘’ By Nifty Trend
β‘£ By VIX Level
β‘€ By Sector
β‘₯ By Individual Stock
⑦ By Day of Week
β‘§ By Month
⑨ By RSI Zone
β‘© By AI Confidence
"In STRONG BULLISH: win rate is 72%. Confidence justified."
"Banking sector: only 44% WR β€” reduce exposure."
"RSI 50–62 entry zone: 71% WR vs 48% elsewhere."
06 / Risk Management

7 Rules. All Must Pass.

Hard-coded. Cannot be overridden. Not even by Claude.

βœ“

β‘  BUY Signal Confirmed

Sanity check β€” decision must explicitly be BUY
βœ“

β‘‘ Open Positions < 5

No overextension β€” max 5 simultaneous holdings
βœ“

β‘’ Daily P&L > βˆ’3%

Day circuit breaker β€” stops all trades if down 3%
βœ“

β‘£ Symbol Not Already Held

No averaging down β€” one position per symbol
βœ“

β‘€ Sector Exposure < 40%

Diversification cap β€” no single sector dominance
βœ“

β‘₯ AI Confidence β‰₯ 65%

Raised from 55% β€” only high-conviction trades enter
βœ“

⑦ No Circuit Breaker Active

Hard block β€” system never trades through limit

// Dynamic Defensive Shield (AI Context)

Claude AI constantly evaluates the 10-day Nifty 50 trend, dynamically adjusting the bot's risk appetite and enforcing defensive filters to protect capital during downturns.

🟒 STRONG BULLISH / NEUTRAL

Normal operation. All 32 stocks scanned. Standard entry criteria apply.

🟑 MILDLY BEARISH

Restricted Mode Activated. Only scans defensive sectors (FMCG, Pharma, IT). Enforces strict oversold gates (RSI ≀ 40) & Volume > 20d avg.

πŸ”΄ STRONG BEARISH

Emergency Skip. Morning scan aborted immediately to protect capital in a crashing market.

βš™οΈ FAILSAFE

Deterministic rule-based fallback if Claude API goes down. The bot never runs blind.

// POSITION SIZING
risk_amount = capital * 0.02
shares = risk_amount / (entry - stop_loss)
cost = (shares * entry) + 20
// MARKET REALISM
Buy: entry price += 0.08% (slippage)
Sell: exit price -= 0.08% (slippage)
NSE Circuit: exit capped at prev_close * 0.90
07 / Tech Stack

Built
With.

Python

Core language β€” agent, strategies, risk, broker

Claude AI

Decision brain β€” entry, SL, TP, confidence scoring

Upstox API

SEBI-regulated NSE/BSE feed β€” OHLCV + live quotes

Azure VM

24/7 cloud deployment β€” 11 scheduled jobs/day IST

Telegram

Real-time phone alerts β€” BUY, SELL, daily report

GitHub Education

Free Azure credits (~$100) β€” ~9 months runtime

08 / Performance

Paper Results
So Far.

πŸ“„ PAPER TRADING IN PROGRESS β€” Month 1 of 3 Β· Live metrics will be published after 90-day validation
β€”
SHARPE RATIO
Publishing Month 3
β€”
MAX DRAWDOWN
Target: ≀ 15%
β€”
WIN RATE
Target: β‰₯ 55%
β€”
CLOSED TRADES
Target: β‰₯ 20
// LIVE TRADING CHECKLIST
90+ days of paper trading
Win rate β‰₯ 55%
Max drawdown ≀ 15%
β‰₯ 20 closed trades
Start live with β‚Ή50,000

Live trading begins Month 4 on Upstox Β· β‚Ή50,000 initial

// API ECONOMICS
Market Condition Calls/Day Cost/Day $4.77 credit lasts
Active bull market 8–12 $0.05 ~3 months
Normal market 4–7 $0.025 ~5 months
Quiet market 1–3 $0.01 16+ months

Note: Claude is only called when: trading day + score β‰₯ 2.0 + earnings clear + signal fresh

← BACK TO PROJECTS VIEW ON LINKEDIN β†’