TradeNeuro AI – Full Project Overview
🔷 1. Objective
TradeNeuro AI is a modular, real-time, AI-powered system designed for automated Bank Nifty options trading using intelligent decision-making modules, real-time data ingestion, and dynamic trade control layers.
It is not just an “algo trading bot”, but an agentic AI decision system that processes context, learns from feedback, adapts strategies, and enforces multi-layered safety controls.
🔷 2. System Highlights
Feature Description
🔁 Real-time loop Executes every 1 second with prioritized module orchestration
🧠 Modular AI System 275 AI modules grouped into logical categories
📊 Data Sources Real-time tick data via Shoonya API
📈 Chart Engine TradingView Lightweight Charts for 1s/1m candles
🧪 Paper & Real Trading Supports paper trading (default) and real trading (via broker APIs)
📚 Memory + Learning Retains strategy performance, behavior bias, feedback memory
🛡️ Safety Layers Multi-layer risk and anomaly protection (GuardrailAI, RiskManager, etc.)
📦 Lightweight System Runs on local laptop with Redis, MongoDB, DuckDB
📤 Fully Modular All 275 modules run as plug-and-play Python agents
🗺️ Meta-AI Strategy Layer Auto switches strategies via MetaPlannerAI, GoalOptimizerAI
🔷 3. Architecture Diagram
arduino
Copy
Edit
┌────────────────────────────┐
│ User Frontend + ReplayAI │
└────────────┬───────────────┘
│
┌────────────▼────────────┐
│ Event Loop & Scheduler │
└────────────┬────────────┘
│
┌────────────────────────┼────────────────────────┐
│ │ │
┌─────▼────┐ ┌──────▼─────┐ ┌───────▼──────┐
│ ChartAI │ ticks → │ Core AI │ signals │ DecisionAI │
└──────────┘ │ Modules │──────────▶(final gate) │
│ (SignalGen,│ └─────┬───────┘
┌────────────┐ │ Execution)│ │
│ Shoonya API│ └────────────┘ │
└────┬───────┘ │
│ ▼
┌─────▼───────┐ ┌─────────────┐
│ Tick Stream │ ⏱ Every 1 sec │ Broker/Paper│
│ + CandleGen │─────────────────────────────────▶│ ExecutionAI │
└─────────────┘ └─────────────┘
🔷 4. Module Categories (275 AI Modules)
All modules are organized into folders inside modules/. Below are the major categories:
✅ Real-Time Core Modules (14)
Handles tick collection, signal generation, execution logic, and integration:
ChartAI, SignalGeneratorAI, ExecutionAI, DecisionAI, Orchestrator, BrokerExecutionAI, etc.
📉 Option Logic Modules (24)
Handles strike selection, CE/PE direction, premiums, expiry logic:
StrikeSelectorAI, DirectionSelectorAI, ATMCheckerAI, etc.
🛡️ Risk Control Modules (28)
Real-time risk checks and trade filtering:
RiskManager, DrawdownLimiterAI, CapitalGuardAI, SlippageMonitorAI, etc.
🧠 Context Awareness Modules (32)
Interprets volatility, news, bias, time filters:
SessionBiasAI, NewsEventPauseAI, VolatilitySafetySwitch, TimeFilterAI, etc.
📊 Indicator Modules (35)
Processes technical indicators in parallel:
RSI_AI, MACD_AI, VolumeSpikeAI, ADX_AI, SupertrendAI, etc.
🔁 Feedback & Learning (21)
Remembers past success/failure, adjusts logic:
TradeFeedbackAI, StrategyMemoryAI, PatternMemoryAI, AutoUpdateAI, etc.
🧩 Meta Strategy Modules (18)
Planner/goal modules:
MetaPlannerAI, GoalOptimizerAI, GuardrailAI, AutoSwitchAI, etc.
👁️ Explanation & UI Modules (14)
Human-readable trade explanation and visualization:
ReplayAI, AICoach, TradeNarratorAI, etc.
🔄 Behavior Diagnostics & Logging (17)
Module performance, error checks, logging:
ModuleHeartbeatAI, OvertradeBlockerAI, LoopLatencyAI, etc.
🔷 5. Data Flow (Real-Time Loop)
Shoonya API → Tick Feed → parsed by tick_stream_handler.py
Ticks → Redis PubSub → published to event bus
ChartAI builds 1s and 1m OHLC candles → stores in DuckDB/Mongo
Event Loop (every 1 sec) triggers:
All AI Modules (parallel or priority-based)
Resulting signals aggregated
DecisionAI applies final logic (confidence, risk, feedback)
ExecutionAI sends trade to paper/real broker module
Result logged, visualized, and fed back into learning modules
🔷 6. Technologies Used
Layer Tools / Frameworks
🐍 Language Python 3.11
🔌 Broker API Shoonya (Finvasia)
🧠 ML + Analysis NumPy, Pandas, Scikit-learn
📶 Event Bus Redis Pub/Sub
🧠 LLMs (optional) OpenAI API
📊 UI / Charts TradingView Lightweight Charts
🧱 DBs DuckDB, MongoDB
🧪 Testing Pytest
🐳 DevOps Docker (Redis, MongoDB)
📋 Configs YAML, .env files
🚦 Async Framework asyncio / aiohttp
📝 Logging logging, local log files
🔷 7. Current Development Phase
You're currently in:
🔧 Phase 2 – Real-Time Core Modules
✅ Tick stream from Shoonya running
✅ Redis PubSub working
✅ Event loop + Scheduler live
⏳ In progress: ChartAI → 1s/1m OHLC + TradingView UI
🔷 8. Development Timeline (Aggressive Fast-Track)
Phase Task Duration
0 Setup, Docker, Redis, Mongo 2–3 days ✅
1 Event Loop + Scheduler 5–7 days ✅
2 Real-time core + Shoonya 7–10 days ⏳
3 Option Logic (strikes etc.) 3–4 days
4 Risk Modules 6–7 days
5 Context Modules 6–7 days
6 Diagnostics & Behavior 6–7 days
7 Meta AI 7–10 days
8 UI + Explainability 6–7 days
9 Final Integration 5–6 days
10 Paper Trading + Review 3 months
🔷 9. Future Goals
✅ Complete core module integrations
✅ Build tick-to-OHLC converter (done)
✅ Show TradingView charts (in progress)
⏳ Paper test performance: Track win-rate, drawdown
🚀 Later: Enable AutoSwitchAI to transition to real trading
🔷 10. Why This Project is Unique
Combines LLMs + ML + Real-time Trading
Modular, agentic AI design with memory + feedback
Zero cloud cost – runs on local laptop
Full safety-first system before allowing any trade
Designed to be explainable, auditable, and highly adaptive