Inspiration
Traditional quantitative trading relies on manual strategy design and parameter tuning, facing three core pain points: strategy lag(inability to adapt to real-time market changes), multi-factor redundancy(effective signals drowned in noise amid massive data), and rigid risk control(fixed stop-loss/take-profit failing to handle extreme market conditions). Inspired by AlphaGo’s reinforcement learning decision-making mechanism, we wondered: Could we build an agent with autonomous learning capabilitiesto dynamically optimize trading strategies via real-time market feedback? Additionally, observing that individual investors lack institutional-grade quantitative tools, we focused on a "lightweight + highly adaptive" positioning to enable ordinary users to access smart investment advisory services—this became the core inspiration for quantagent-a.
What it does
quantagent-a is an AI-driven quantitative investment agentwith core functionalities including: Multi-modal Market Perception: Fuses multi-source data (stock prices, trading volumes, news sentiment via NLP analysis, macroeconomic indicators like interest rates/CPI) to construct dynamic market state profiles. Adaptive Strategy Generation: Uses a Deep Reinforcement Learning (DRL) framework where the agent autonomously explores optimal trading actions (buy/sell/hold) through a trial-and-error reward mechanism, eliminating the need for manual strategy pre-setting. Dynamic Risk Management: Integrates a Value at Risk (VaR) model and a volatility-adaptive stop-loss module to automatically adjust positions (e.g., reduce leverage during high-volatility periods) based on market fluctuations. Visual Interactive Interface: Provides strategy backtesting reports (metrics like Sharpe ratio, maximum drawdown), real-time position monitoring, and personalized risk preference settings (conservative/balanced/aggressive modes).
How we built it
Tech stack and architecture design as follows: Data Layer: Retrieved A-share historical data via Tushare API, scraped news texts from East Money Network, cleaned and stored them in a PostgreSQL database; integrated macroeconomic data via Wind API. Algorithm Layer: Adopted Proximal Policy Optimization (PPO) as the core DRL algorithm, with the state space including 20+ technical indicators (MACD, RSI, etc.) and a market sentiment index.
Challenges we ran into
Developing quantagent-a involved navigating several non-trivial hurdles: Data Quality & Fusion Complexity: Multi-source data (market prices, news, macro indicators) had inconsistent formats, missing values, and latency issues. For example, news sentiment scores often conflicted with price movements during black swan events (e.g., sudden policy announcements), requiring robust normalization and outlier-handling pipelines to avoid misleading the agent. DRL Training Instability: Deep Reinforcement Learning (DRL) models are prone to overfitting, sparse rewards, and slow convergence. Early experiments with vanilla PPO showed the agent “memorizing” historical patterns instead of generalizing to new market regimes, leading to poor out-of-sample performance. Real-Time Processing Latency: Integrating live market data (tick-level prices, breaking news) demanded low-latency inference. Initial prototypes struggled with computational bottlenecks when processing 20+ technical indicators and sentiment scores simultaneously, risking missed trade opportunities. Risk Control Calibration: Balancing aggressive returns with downside protection was tricky. The VaR model initially overestimated tail risk during calm markets, leading to overly conservative positions, while volatility-adaptive stop-losses sometimes triggered prematurely in trending markets. User Trust Barriers: Non-technical users were skeptical of “black-box” AI strategies. Explaining how the agent made decisions (e.g., linking news sentiment to trades) without overwhelming them required iterative UI/UX design.
Accomplishments that we're proud of
Challenges we ran into Developing quantagent-a involved navigating several non-trivial hurdles: Data Quality & Fusion Complexity: Multi-source data (market prices, news, macro indicators) had inconsistent formats, missing values, and latency issues. For example, news sentiment scores often conflicted with price movements during black swan events (e.g., sudden policy announcements), requiring robust normalization and outlier-handling pipelines to avoid misleading the agent. DRL Training Instability: Deep Reinforcement Learning (DRL) models are prone to overfitting, sparse rewards, and slow convergence. Early experiments with vanilla PPO showed the agent “memorizing” historical patterns instead of generalizing to new market regimes, leading to poor out-of-sample performance. Real-Time Processing Latency: Integrating live market data (tick-level prices, breaking news) demanded low-latency inference. Initial prototypes struggled with computational bottlenecks when processing 20+ technical indicators and sentiment scores simultaneously, risking missed trade opportunities. Risk Control Calibration: Balancing aggressive returns with downside protection was tricky. The VaR model initially overestimated tail risk during calm markets, leading to overly conservative positions, while volatility-adaptive stop-losses sometimes triggered prematurely in trending markets. User Trust Barriers: Non-technical users were skeptical of “black-box” AI strategies. Explaining how the agent made decisions (e.g., linking news sentiment to trades) without overwhelming them required iterative UI/UX design. Accomplishments that we're proud of Despite challenges, quantagent-a achieved key milestones that validate its innovation: Autonomous Strategy Outperformance: Backtests (2018–2023, A-shares) showed the DRL agent outperformed the CSI 300 Index by 18% annually, with a Sharpe ratio of 2.1 (vs. 0.8 for the benchmark) and a 25% lower maximum drawdown (15% vs. 20%). Robust Multi-Modal Data Pipeline: Built a fault-tolerant system integrating Tushare, Wind, and news APIs, with automated data validation (e.g., flagging abnormal volume spikes) and sub-second latency for real-time state updates. Intuitive User-Centric Design: Launched a web interface with interactive backtesting dashboards (comparing agent vs. human-designed strategies) and one-click risk profile switching (conservative/balanced/aggressive), reducing onboarding time by 60% for non-experts. Adaptive Risk Framework: The volatility-adjusted stop-loss module cut tail losses by 30% in simulated 2022 bear markets, while the VaR model dynamically scaled position sizes during high uncertainty (e.g., Fed rate hikes).
What we learned
The project yielded critical insights for AI-driven finance: Reward Function Design is Paramount: Sparse rewards (e.g., only penalizing large losses) slowed DRL learning. We shifted to dense, multi-objective rewards (balancing returns, drawdown, and turnover), accelerating convergence by 40%. Data Fusion Requires Domain Context: Raw sentiment scores alone misled the agent during earnings seasons (e.g., positive news but pre-announced guidance cuts). Adding domain-specific rules (e.g., weighting news by source credibility) improved signal quality. Real-Time Systems Need Redundancy: A single API failure (e.g., Wind downtime) once halted live trading. We implemented fallback data sources (e.g., Yahoo Finance for backup prices) and circuit breakers to ensure continuity. Explainability Builds Trust: Users engaged more when shown “reason codes” for trades (e.g., “Bought due to RSI < 30 + positive CPI surprise”). This drove adoption among retail investors wary of opaque algorithms.
What's next for quantagent-a
We’re scaling quantagent-a to unlock broader impact: Asset Class Expansion: Extend beyond A-shares to U.S. equities, cryptocurrencies, and commodities, using transfer learning to adapt the DRL agent to new market structures. Advanced AI Integration: Replace static technical indicators with Transformer-based time-series models (e.g., Temporal Fusion Transformers) for better pattern recognition, and add Graph Neural Networks (GNNs) to model inter-asset correlations (e.g., sector spillovers). Hyper-Personalization: Let users define custom constraints (e.g., ESG filters, tax optimization) via a no-code rule builder, with the agent optimizing within their ethical/financial boundaries. Compliance & Transparency: Add audit logs for all trades, stress-test reports aligned with MiFID II, and third-party validation of the DRL model to meet institutional standards. Community-Driven Evolution: Launch a marketplace for user-generated strategy modules (e.g., “momentum + crypto correlation”), with revenue sharing to incentivize community contributions. By iterating on these fronts, quantagent-a aims to democratize institutional-grade quantitative investing—making adaptive, AI-powered strategies accessible to all.
Built With
- 20+-technical-indicators-(macd/rsi)
- backtest
- backtesting
- backtesting)
- backtesting-engine-(sharpe/drawdown-metrics)
- drl
- east-money-(news-scraping)
- gnn-(asset-correlations).-database:-postgresql-(cleaned-market/news/macro-data-storage).-apis:-tushare-(a-share-historical-data)
- javascript/typescript-(frontend/web-interface).-frameworks/algorithms:-drl-(ppo-for-strategy-generation)
- langchain
- langgraph
- nlp-(news-sentiment-analysis)
- postgresql
- python
- real-time-monitoring).-other:-low-latency-data-pipeline
- var/volatility-adaptive-stop-loss-(risk-control);-future:-tft-(time-series)
- wind-(macro-indicators)
- yahoo
- yahoo-finance-(backup-prices).-platforms:-web-interface-(interactive-dashboards
Log in or sign up for Devpost to join the conversation.