The quantitative agent now supports strategy selection via command-line arguments!
# Use statistical arbitrage (default)
python mcp_quantitative_agent/quantitative_agent.py analyze --category weather --strategy statistical_arbitrage
# Use moving average
python mcp_quantitative_agent/quantitative_agent.py analyze --category weather --strategy moving_average --ma-period 7# Moving average with custom parameters
python mcp_quantitative_agent/quantitative_agent.py analyze \
--category politics \
--strategy moving_average \
--ma-period 14 \
--ma-type ema \
--signal-type trend_followingpython mcp_quantitative_agent/quantitative_agent.py strategiesOutput:
============================================================
AVAILABLE STRATEGIES
============================================================
✅ STATISTICAL_ARBITRAGE
Description: Multi-source comparison to find statistical arbitrage
Best for: weather, politics, economics
Requires: External data sources (NOAA, FRED, etc.)
MOVING_AVERAGE
Description: Price trend analysis using moving averages
Best for: politics, economics
Requires: Historical price data from Kalshi
Parameters:
--ma-period: Moving average window (default: 7 days)
--ma-type: sma or ema (default: sma)
--signal-type: mean_reversion or trend_following (default: mean_reversion)
Current Strategy: statistical_arbitrage
# Statistical arbitrage (weather markets - best fit)
python mcp_quantitative_agent/quantitative_agent.py analyze \
--category weather \
--limit 10 \
--strategy statistical_arbitrage
# Moving average (politics markets)
python mcp_quantitative_agent/quantitative_agent.py analyze \
--category politics \
--limit 10 \
--strategy moving_average \
--ma-period 7 \
--signal-type mean_reversion
# Moving average with EMA (economics markets)
python mcp_quantitative_agent/quantitative_agent.py analyze \
--category economics \
--limit 10 \
--strategy moving_average \
--ma-period 14 \
--ma-type ema \
--signal-type trend_following# List strategies
python mcp_quantitative_agent/quantitative_agent.py strategies
# List categories
python mcp_quantitative_agent/quantitative_agent.py categories
# Analyze single market
python mcp_quantitative_agent/quantitative_agent.py market --ticker KXHIGHCHI-25NOV08-T48The strategy system is available via the MCP server:
cd mcp_quantitative_agent
python server_simple.pyThe MCP server exposes these tools:
analyze_weather_markets- with strategy parameteranalyze_politics_markets- with strategy parameteranalyze_economics_markets- with strategy parameteranalyze_single_market- with strategy parameterget_market_categories- list categories and strategies
AI agents (like Claude) can now choose strategies:
{
"tool": "analyze_weather_markets",
"arguments": {
"limit": 10,
"strategy": "statistical_arbitrage"
}
}{
"tool": "analyze_politics_markets",
"arguments": {
"limit": 5,
"strategy": "moving_average",
"ma_period": 7,
"signal_type": "mean_reversion"
}
}You can also use the standalone script:
# With strategy selection
python analyze_with_strategy.py \
--category weather \
--strategy statistical_arbitrage \
--limit 10
python analyze_with_strategy.py \
--category politics \
--strategy moving_average \
--ma-period 7 \
--limit 10Category: WEATHER
Strategy: statistical_arbitrage
Sources: NOAA (GFS), Open-Meteo (ECMWF), Climatology
Summary:
Markets Analyzed: 2
Average Edge: -4.90%
Max Edge: 7.90%
Markets with >8% Edge: 1
Average Confidence: 0.88
Markets:
KXHIGHLAX-25NOV08-T74: Will the high temp in LA be <74°?
Edge: -17.7% | Recommendation: BUY NO
Sources: NOAA: 0.996, Open-Meteo: 0.975, Climatology: 0.421
Category: POLITICS
Strategy: moving_average
Strategy Config: {'ma_period': 7, 'ma_type': 'sma', 'signal_type': 'mean_reversion'}
Summary:
Markets Analyzed: 5
Average Edge: +25.3%
Markets with >8% Edge: 4
Markets:
KXCONGESTIONEND-25: NYC congestion pricing
Edge: +44.5% | Recommendation: BUY YES
User Command
↓
Quantitative Agent (with strategy parameter)
↓
Strategy Factory (strategies/__init__.py)
↓
Strategy Selection
├── Statistical Arbitrage (strategies/statistical_arbitrage.py)
└── Moving Average (strategies/moving_average.py)
↓
Analysis Result
↓
MCP Server / CLI Output
✅ Strategy Selection - Choose between multiple analysis methods ✅ Configurable Parameters - Customize each strategy (MA period, type, etc.) ✅ MCP Compatible - Works with MCP protocol for AI agents ✅ CLI Support - Use via command line ✅ Backward Compatible - Defaults to statistical arbitrage
- Strategy selection via CLI
- Strategy listing
- Statistical arbitrage integration
- Moving average strategy implementation
- MCP server integration
- Configuration passing
- The quantitative agent currently uses the original analysis methods (weather_test, politics_test, economics_test)
- The strategies are implemented and ready
- Full integration where strategies completely replace the analysis methods is possible but not yet done
If you want strategies to completely replace the test modules:
- Update
analyze_category()to use strategy.analyze() instead of config"analyze" - Update result formatting to handle StrategyResult objects
- Test with both strategies across all categories
YES, the strategy system works with the quantitative agent!
You can:
- ✅ Select strategies via CLI (
--strategy statistical_arbitrageor--strategy moving_average) - ✅ Configure strategy parameters (
--ma-period 7,--ma-type sma, etc.) - ✅ List available strategies (
strategiescommand) - ✅ Use via MCP server
- ✅ Use via standalone script
The infrastructure is in place and working. The agent supports strategy selection and configuration, making it flexible for different analysis approaches!