share-ai

byKishan Sharma

# Replit Agent Prompt: Autonomous Indian Intraday AI Paper-Trading System (PAPER TRADING ONLY) Build this complete system in one pass — no phases, no check-ins mid-build. Give one final report at the end: what was built, what was tested, what needs my attention. ## Safety rules (absolute, no exceptions) - PAPER TRADING ONLY. No real orders, ever, under any framing. - Upstox integration = **read-only market data only** (quotes/OHLC/depth/WebSocket ticks). Never request or call any order-placement/modify/cancel endpoint. No such code path anywhere, not even disabled/commented. - All trades are simulated: just a row written to our own `trades` table. - **Do NOT ask me for the Upstox API key/secret during the build.** Leave them as empty environment variables / Replit Secrets placeholders (e.g. `UPSTOX_API_KEY`, `UPSTOX_API_SECRET`) that I will fill in myself manually after the build is complete — I'm keeping these confidential. Build and test everything else (including the Market Data Agent's code) without needing real values; use mocked/dummy data for any test that would otherwise require live credentials. - Before finishing, search the codebase yourself for any broker order-placement calls and confirm zero. Report this explicitly. - Upstox tokens expire daily — login must stay a manual step each day (no stored password/TOTP). ## What it does Once I start it, it runs autonomously through NSE hours (09:15–15:30 IST, configurable) with only a manual STOP/HALT control: scan → rank → analyze → challenge → risk-check → decide → paper-execute → monitor → exit → learn → repeat. ## Parameters (config file, not hardcoded) - Starting capital ₹15,000; kill switch at ₹5,000 equity - Max 1 open position; max risk 5% of equity per trade; min net R:R 1.5 - Eligible stocks: ≤ ₹1,500/share; top 5 candidates (long + short) - Opportunity Scout re-scans every 15 min (fixed); open trades are monitored in real time regardless of scan cycle, never interrupted by a new scan - Flat cost: ₹25/transaction → ₹50 per round-trip trade; net_profit = gross − 50; R:R check uses net, not gross ## Agents (separate modules) 1. **Market Data Agent** — sole owner of the Upstox connection (read-only scope only); writes live prices to a local cache DB; everyone else reads from this cache, never from Upstox directly; flags stale data (>5–10s old) as unusable. 2. **Opportunity Scout** — deterministic ranking from the cache, filtered ≤₹1,500, top 5 long+short, rationale only via LLM. 3. **Technical Agent** — chart-based PROCEED/WAIT + entry/target/stop-loss plan. 4. **Regime Agent** — market-context classification (trending/choppy/vol). 5. **News Agent** — pluggable provider, simulated for now, tagged SIMULATED/LIVE/UNKNOWN. 6. **Trade Proposal** — deterministic merge of 3–5. 7. **Critic** — deterministic hard checks + LLM adversarial pass; can veto. 8. **Risk Manager** — 100% deterministic, hard veto, no LLM. 9. **Main AI** — final PROCEED/WAIT using net R:R vs. 1.5 minimum; low/fixed temp, strict schema, can't override Risk Manager or Final Safety Gate. 10. **Final Safety Gate** — deterministic last check. 11. **Paper Execution** — writes simulated trade to DB only. 12. **Position Manager** — real-time stop-loss/target/time exit monitoring, independent of Scout's scan cycle. 13. **Learning Engine** — logs closed trades, retrieval for agents' context; passive analytics only, no auto-changes to params/prompts. ## Upstox connection flow - OAuth2 login: I log into Upstox myself; app exchanges the returned code for a token using the Secrets I add manually post-build. - Dashboard shows Connect/Connected/Disconnected states; pipeline pauses if disconnected or data is stale. ## Dashboard (separate pages, not one long page) - Live Trading: live price chart (from cache), current position w/ entry/target/stop, equity vs. ₹15,000 and ₹5,000 kill line, STOP/HALT control. - Trade History/Journal. - Connection/Settings: Upstox connect status, config parameters. ## Do not add - Any real order placement, "for testing" or otherwise. - Stored/auto Upstox credentials bypassing daily manual login. - Auto-tuning of parameters/prompts by the Learning Engine. - Hardcoded universe/thresholds/costs outside the config file. NO need to make multiple pages. I need only one page which is dashboard. NO need to write essay in the dashboard. no need to write agent description. need option to connect to upstock in the top of the dashborad

No preview

Comments (0)

No comments yet. Be the first!

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

Dashboard: Open cockpit
Dashboard: 1. Start Upstox login
Dashboard: 2. Confirm Connected state
Dashboard: 3. Review stale data warning
Dashboard: 1. Monitor live chart
Dashboard: 2. Check open position
Dashboard: 3. Track equity vs kill line
Dashboard: 4. Press and hold STOP/HALT
Dashboard: 5. Review trade journal
Dashboard: 6. Adjust config parameters
Dashboard: 7. Resume scanning pipeline

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

Dashboard: Open cockpit
Dashboard: 1. Start Upstox login
Dashboard: 2. Confirm Connected state
Dashboard: 3. Review stale data warning
Dashboard: 1. Monitor live chart
Dashboard: 2. Check open position
Dashboard: 3. Track equity vs kill line
Dashboard: 4. Press and hold STOP/HALT
Dashboard: 5. Review trade journal
Dashboard: 6. Adjust config parameters
Dashboard: 7. Resume scanning pipeline