Architecture Roadmap
Current Status: Phase 3 (Hybrid Generative Intelligence)
Signal.Engine has successfully transitioned from a heuristic scanner to a sequence-aware reasoning agent. The current architecture leverages Supervised Fine-Tuning (SFT) for market "common sense" and Proximal Policy Optimization (PPO) for execution logic.
Phase 4: Portfolio Optimization & Risk Parity
The next immediate evolution focuses on moving from individual symbol predictions to a holistic portfolio view.
- Global Risk Constraints: Implementation of a
RiskManagermodule that monitors total exposure across the Nifty 500. - Dynamic Position Sizing: Shifting from fixed quantity trades (
--qty 1) to Kelly Criterion or Volatility-Adjusted sizing. - Usage Example:
# Proposed execution with dynamic risk allocation python -m src.trader_alpaca --universe NIFTY_NEXT_50 --risk_limit 0.02 --strategy risk_parity
Phase 5: Cognitive Sentiment Integration (LLM Reasoning)
Integrating unstructured data to provide macro-context to the LSTM-based "Brain."
- News & Earnings Parsers: LLM agents (GPT-4/Claude) will summarize news sentiment and earnings calls into a "Sentiment Score."
- Reasoning Injection: The
HybridBrainwill receive a sentiment vector as an additional feature input, allowing the model to stay "flat" during high-impact news events despite bullish technicals. - Public Interface:
# Planned configuration in .env OPENAI_API_KEY="sk-..." SENTIMENT_WEIGHT=0.3 # Balance between technicals and news
Phase 6: Multi-Asset & Cross-Market Correlation
Expansion beyond the Indian Equity market (Nifty) to global assets and correlated instruments.
- Universal Adapters: Standardizing the
data_loader.pyto support Binance (Crypto), Interactive Brokers (Global Equities), and OANDA (Forex). - Correlation Mapping: The agent will recognize that a spike in Brent Crude or the USD/INR pair should trigger specific defensive routines in Auto and Paint stocks.
- Configuration:
# config/universe.yaml universes: - name: "Commodity_Linked" symbols: ["RELIANCE.NS", "BPCL.NS"] correlates: ["CL=F"] # Crude Oil Futures
Phase 7: Execution Sharding & High-Frequency Adaptation
Scaling the infrastructure to handle thousands of symbols with sub-second latency.
- Distributed Processing: Moving from single-process scans to a task queue (Celery/Redis) where "Worker Agents" process different sectors in parallel.
- Order Book Analysis: Integrating Level 2 data (Market Depth) into the Reinforcement Learning environment to reduce slippage in low-liquidity midcaps.
- Infrastructure Change: Transitioning from a single Python script to a containerized microservice architecture.
Phase 8: Autonomous Swarm Intelligence
The final phase involves a multi-agent system where specialized "Sub-Agents" compete and collaborate.
- Specialist Agents:
- The Bull: Trained specifically for parabolic trend following.
- The Bear: Trained for mean reversion and short-selling in high-volatility regimes.
- The Hedger: Dedicated to neutralising Delta during market uncertainty.
- The Jury (Consensus Layer): A top-level Meta-Agent that allocates capital to the Sub-Agents based on the current "Market Regime" identified by the system.
- Dashboard View: The React frontend will evolve to show the "Swarm Status," displaying which sub-agents are currently in control of the capital.
Roadmap Summary
| Phase | Milestone | Focus | Interface |
| :--- | :--- | :--- | :--- |
| Phase 3 | Current | Generative LSTM + PPO | CLI / FastAPI / React |
| Phase 4 | Risk | Kelly Criterion & Risk Parity | --risk_limit flags |
| Phase 5 | LLM | News Sentiment & Macro Context | OpenAI/Anthropic API |
| Phase 6 | Global | Crypto & Forex Adapters | Multi-broker support |
| Phase 7 | Scale | Sharded Workers & Level 2 Data | Redis / Docker Compose |
| Phase 8 | Swarm | Multi-Agent Consensus | Meta-Agent Allocation |