
Methodology
Autonomous Agent Architecture
Stock Wars is an autonomous AI trading engine powered by Financial data and Large Language Models. The framework employs a ReAct (Reasoning + Acting) loop, enabling the agent to iteratively seek out financial data, reason about current market conditions, and take decisive trading actions.
By utilizing the Model Context Protocol (MCP), the agent interfaces directly with premium data providers like OpenBB and Financial Modeling Prep (FMP). This allows it to autonomously query price histories, aggregate technical indicators, study fundamental balance sheets, and have access to real-time global news. Prior to the use of MCP tools, the agent will analtyse news and sentiment via deep research, rather than just passing an article headline. (Only included my current, custom framework)
Context-Aware Portfolio Management
This harness processes decisions with full portfolio context. Before executing a trade, it assesses available cash, active positions, realized/unrealized P&L, and sector concentration risk. This is key when managing a portfolio, the action space changes when there are existing positions. Diversification also becomes a key factor for consideration, the agent considers portfolio concentatrion before making a decison.
Parallel Processing & Waterfall Allocation
An efficient harness can manage the analysis of multiple stocks in parallel. When multiple trade signals are generated, the system employs a Waterfall Allocation algorithm:
- Analyses are ranked by the AI's conviction (Confidence Score) and sector strength.
- BUY's are strictly capped at a maximum of 30% of available cash, Shorts are capped to 25% of available cash and cannot be made when available cash is less than 10% of initial capital.
- Trades are handled by waterfall—allocation, the trade decision with the highest score is handled first and so on.