How avinashsasi1955/trade_mind works
Nivesh.ai is an Indian-market paper-trading and research application. A user signs in to the dashboard and can request an analysis or manual agent run; the backend gathers market and sentiment context, screens and scores candidates, applies risk gates, and may record a paper execution. Scheduled scans and research features also support backtesting, security lookup, charting, historical data, and post-market model validation. The graph reflects documented capabilities and sampled wiring; several larger subsystems are represented at module level because their implementation was not excerpted.
Main entry points: service.py API Service · __init__.py Agent Pipeline · worker.py Scheduled Worker · risk_engine.py Trade Risk Controls
Components 31
User Interface
- Dashboard
frontend/app.js
Application Services
- API Service
backend/service.py - HTTP Server
backend/server.py - Application Database
backend/database.py - Authentication
backend/security.py - AI Gateway
backend/ai_gateway.py - Scheduled Worker
backend/tasks/worker.py - Market Scheduler
backend/scheduler.py - Live Updates
backend/sse_broadcaster.py - Configuration
backend/config.py
Trading Intelligence
- Agent Pipeline
backend/brains/__init__.py - Sentiment Brain
backend/brains/sentiment_brain.py - Candidate Screener
backend/brains/screener_brain.py - Signal Brain
backend/brains/signal_brain.py - Risk Brain
backend/brains/risk_brain.py - Execution Brain
backend/brains/execution_brain.py - Trade Risk Controls
backend/risk_engine.py - Brain Event Bus
backend/brains/bus.py
Market Data
- Market Data
backend/market.py - Market Ingestion
backend/market_ingestion_v3.py - Security Master
backend/security_master.py - Charts And Analysis
backend/charting.py
Research And Audit
- Backtesting
backend/backtesting.py - ML Research Pipeline
backend/ml_pipeline.py - Volume Profile
backend/volume_profile.py - ASI Indicator
backend/asi_indicator.py - Model Validation
backend/ml/validation_engine.py - Counterfactual Replay
backend/brains/counterfactual_replay.py - Trading Coach
backend/brains/trading_coach.py - Intelligence Memory
backend/intelligence_memory.py
Other components
- Trader
Connections 32
- Trader → Dashboard: uses
README.md - Dashboard → HTTP Server: requests API
README.md - HTTP Server → API Service: routes requests
backend/server.py - HTTP Server → Authentication: authenticates
backend/server.py - API Service → Agent Pipeline: runs agent
backend/service.py - Agent Pipeline → Sentiment Brain: runs
backend/brains/__init__.py - Agent Pipeline → Candidate Screener: screens candidates
backend/brains/__init__.py - Agent Pipeline → Signal Brain: scores candidates
backend/brains/__init__.py - Agent Pipeline → Risk Brain: gates signals
backend/brains/__init__.py - Agent Pipeline → Execution Brain: executes approved
backend/brains/__init__.py - API Service → Application Database: persists data
backend/service.py - API Service → Market Data: uses market data
backend/service.py - API Service → Security Master: looks up securities
backend/service.py - API Service → Charts And Analysis: serves charts
backend/service.py - API Service → Backtesting: runs reports
backend/service.py - API Service → AI Gateway: requests narratives
backend/service.py - Trade Risk Controls → Application Database: reads risk state
backend/risk_engine.py - Trade Risk Controls → Market Data: reads prices
backend/risk_engine.py - Trade Risk Controls → Security Master: resolves instruments
backend/risk_engine.py - Market Ingestion → Model Validation: checks market data
backend/market_ingestion_v3.py - ML Research Pipeline → Volume Profile: calculates features
backend/ml_pipeline.py - ML Research Pipeline → ASI Indicator: uses indicator
backend/ml_pipeline.py - Model Validation → Intelligence Memory: records audit
backend/ml/validation_engine.py - Counterfactual Replay → Intelligence Memory: uses trade memory
backend/brains/counterfactual_replay.py - Scheduled Worker → Counterfactual Replay: runs replay
backend/tasks/worker.py - Scheduled Worker → Market Ingestion: repairs data gaps
backend/tasks/worker.py - Market Scheduler → API Service: triggers scans
- API Service → Live Updates: publishes updates
backend/sse_broadcaster.py - Agent Pipeline → Brain Event Bus: publishes events
backend/brains/__init__.py - Trading Coach → Counterfactual Replay: reviews outcomes
- API Service → Configuration: uses settings
backend/service.py - Scheduled Worker → Configuration: uses settings
backend/tasks/worker.py