An intelligent, agentic system built with the Microsoft Semantic Kernel Architecture and C# that performs quantitative research by analyzing YouTube videos, Market trends, and generating trading signals. This system combines the power of AI-driven content analysis with sophisticated trading algorithms.
- YouTube Video Analysis: Automatically fetches and analyzes financial videos from YouTube (especially Quantopian channel)
- Trading Signal Generation: Creates actionable trading signals using AI and technical analysis
- Risk Management: Comprehensive portfolio risk assessment and position sizing
- Market Data Integration: Real-time market data from Binance and other sources
- Portfolio Management: Track positions, calculate metrics, and manage trades
- Agent Orchestration: Autonomous job scheduling and execution
- Market Sentiment Agent: Multi-source sentiment analysis (news, social media, fear/greed index, technical)
- Statistical Pattern Agent: Deep mathematical analysis to detect exploitable market patterns
- Monte Carlo Simulation Framework: Advanced risk modeling with stochastic scenario generation
- Interactive Strategy Builder: Visual strategy development with real-time backtesting
- Research Notebook Environment: Interactive quantitative research platform with code execution
- Sentiment Analysis: Extract market sentiment from video content and internet sources
- Technical Insights: Identify trading concepts and strategies from video content
- Signal Generation: Convert insights into executable trading signals
- Risk Assessment: AI-driven portfolio risk evaluation
- Academic Research: Extract trading strategies from research papers
The system is built around Microsoft Semantic Kernel, providing:
- Plugin Architecture: Modular AI functions for different domains
- Natural Language Processing: Advanced content analysis capabilities
- Function Calling: Structured AI interactions with trading systems
- Orchestration: Intelligent job scheduling and execution
YouTubeAnalysisService: YouTube integration and content analysisTradingSignalService: Signal generation and managementMarketDataService: Real-time and historical market dataRiskManagementService: Portfolio risk assessmentPortfolioService: Position and performance tracking
MarketSentimentAgentService: Multi-source sentiment analysis and market directionStatisticalPatternAgentService: Mathematical pattern detection and exploitability analysis
MonteCarloService: Stochastic simulation and risk modelingStrategyBuilderService: Interactive strategy development and optimizationNotebookService: Interactive research environment and code execution
PodcastAnalysisPlugin: AI functions for YouTube video content analysisYouTubeAnalysisPlugin: Dedicated YouTube video analysis functionsTradingPlugin: Trading operations and signal managementMarketDataPlugin: Market data retrieval and analysisRiskManagementPlugin: Risk assessment and portfolio management
MarketSentimentPlugin: Sentiment analysis and trading signal generationStatisticalPatternPlugin: Pattern detection and statistical analysis functions
MonteCarloPlugin: Stochastic simulation and risk analysis functionsStrategyBuilderPlugin: Interactive strategy development and backtestingNotebookPlugin: Research notebook execution and analysis tools
AgentOrchestrator: Main orchestration engineModels: Data structures and business entities
- .NET 8.0 SDK
- OpenAI API Key
- YouTube Data API Key (v3)
- Binance API Keys (optional, for live trading)
-
Clone the repository
cd /Users/misango/codechest/ArithmaxResearchChest -
Configure Settings Update
appsettings.jsonwith your API keys:{ "OpenAI": { "ApiKey": "your-openai-api-key", "ModelId": "gpt-4o" }, "Spotify": { "ClientId": "your-spotify-client-id", "ClientSecret": "your-spotify-client-secret" }, "Binance": { "ApiKey": "your-binance-api-key", "SecretKey": "your-binance-secret-key", "TestMode": true } } -
Install Dependencies
dotnet restore
-
Build the Project
dotnet build
-
Run the Agent
dotnet run
The application now includes a web-based frontend built with Blazor Server, providing an interactive dashboard with widgets for various financial analyses.
To run with the web frontend:
# Using the launcher script
./launch.sh web
# Or directly with dotnet
dotnet run -- --webThe web interface will be available at http://localhost:5000 with:
- Dashboard: Overview with market data, sentiment, portfolio, news, and risk widgets
- Market Analysis: Technical and comprehensive analysis tools
- Portfolio: Portfolio management and Alpaca integration
- Research: Academic paper search functionality
// Analyze a Spotify podcast episode
var episode = await podcastService.AnalyzePodcastAsync("https://open.spotify.com/episode/69tcEMbTyOEcPfgEJ95xos");// Generate signals for all tracked symbols
var signals = await signalService.GenerateSignalsAsync();
// Generate signal for specific symbol
var btcSignal = await signalService.GenerateSignalAsync("BTCUSDT");// Assess portfolio risk
var riskAssessment = await riskService.AssessPortfolioRiskAsync();
// Calculate position size
var positionSize = await riskService.CalculatePositionSizeAsync(signal);// Get portfolio metrics
var metrics = await portfolioService.CalculateMetricsAsync();
// Execute trading signal
var executed = await portfolioService.ExecuteSignalAsync(signal, quantity);The system exposes AI functions through Semantic Kernel plugins:
AnalyzePodcastAsync(): Full podcast analysis with insights and signalsGetPodcastSentimentAsync(): Extract sentiment score from podcastExtractTradingInsightsAsync(): Get technical trading insights
GenerateTradingSignalsAsync(): Generate signals for symbolsExecuteTradingSignalAsync(): Execute a signal with risk managementGetActiveSignalsAsync(): Retrieve current active signalsAnalyzeTradingPerformanceAsync(): Performance analysis and metrics
GetMarketDataAsync(): Current market data for symbolsGetHistoricalDataAsync(): Historical price dataCompareSymbolsAsync(): Compare multiple symbols performanceGetMarketOverviewAsync(): Overall market summary
AssessPortfolioRiskAsync(): Comprehensive risk assessmentGetPortfolioSummaryAsync(): Portfolio positions and metricsCalculatePositionSizeAsync(): Optimal position sizingAnalyzeDiversificationAsync(): Portfolio diversification analysis
AnalyzeMarketSentimentAsync(): Multi-source sentiment analysisCompareSentimentAcrossAssetsAsync(): Cross-asset sentiment comparisonGenerateSentimentTradingSignalsAsync(): Sentiment-based trading signalsGetSentimentAlertsAsync(): Extreme sentiment condition alertsGetSentimentTrendAsync(): Historical sentiment trend analysis
DetectPatternsAsync(): Comprehensive pattern detectionDetectSpecificPatternAsync(): Target specific pattern typesComparePatternAcrossSymbolsAsync(): Multi-symbol pattern comparisonDetectAnomaliesAsync(): Statistical anomaly detectionAnalyzeVolatilityPatternsAsync(): Volatility clustering analysisGenerateImplementationRoadmapAsync(): Pattern implementation guidance
RunMonteCarloSimulationAsync(): Execute stochastic price simulationsCalculateValueAtRiskAsync(): Compute VaR with confidence intervalsGenerateStressTestScenariosAsync(): Portfolio stress testing under extreme conditionsAnalyzeSimulationResultsAsync(): Statistical analysis of simulation outcomesVisualizeSimulationPathsAsync(): Interactive visualization of price paths
BuildStrategyAsync(): Construct trading strategies with componentsBacktestStrategyAsync(): Real-time strategy backtestingOptimizeParametersAsync(): Genetic algorithm parameter optimizationValidateStrategyAsync(): Walk-forward analysis and robustness testingGenerateStrategyReportAsync(): Performance attribution and risk metrics
ExecuteCodeAsync(): Run code cells with real-time outputCreateVisualizationAsync(): Generate charts and statistical plotsRunStatisticalAnalysisAsync(): Hypothesis testing and regression analysisExportNotebookAsync(): Export research findings and documentationShareAnalysisAsync(): Collaborative research sharing capabilities
This system builds upon your existing Python quantitative strategies:
- EMA/SMA Strategies: Technical indicator integration
- Scalping Strategy: High-frequency signal generation
- Swing Trading: Medium-term position management
- Risk Management: Drawdown control and position sizing
- Portfolio Optimization: Multi-asset strategy execution
- AI-Driven Analysis: Semantic understanding of market content
- Automated Orchestration: Self-managing agent workflows
- Natural Language Interface: Conversational trading interactions
- Multi-Source Integration: Podcast, market data, and news analysis
- Initialization: Load configuration and register plugins
- Scheduled Jobs: Podcast analysis, market data updates
- Signal Generation: AI-powered trading signal creation
- Risk Validation: Comprehensive risk checks before execution
- Portfolio Management: Position tracking and performance monitoring
- Continuous Learning: Adaptation based on performance feedback
Multi-Source Sentiment Analysis & Prediction
- Analyzes news sentiment from financial news sources
- Processes social media sentiment (Twitter, Reddit, Discord)
- Monitors Fear & Greed Index and volatility indicators
- Performs technical sentiment analysis
- Generates market direction predictions
Key Features:
- Real-time sentiment aggregation from multiple sources
- Confidence-weighted sentiment scoring
- Contrarian vs momentum signal generation
- Extreme sentiment alert system
- Historical sentiment trend analysis
Deep Mathematical Market Analysis
- Detects mean reversion patterns with statistical significance
- Identifies momentum and trend patterns
- Analyzes seasonal and calendar effects
- Performs volatility clustering analysis (GARCH modeling)
- Detects statistical anomalies and outliers
- Analyzes fractal patterns and self-similarity
- Identifies potential arbitrage opportunities
- Performs regime change detection
- Analyzes market microstructure patterns
Supported Pattern Types:
- Mean Reversion: ADF tests, Hurst exponent, half-life calculations
- Momentum: Autocorrelation analysis, trend strength measurement
- Seasonality: Intraday, day-of-week, monthly effects
- Volatility: GARCH parameters, volatility clustering
- Correlation: Cross-asset correlation breakdowns
- Anomaly: Outlier detection, jump detection
- Fractal: Self-similarity analysis, fractal dimension
- Arbitrage: Price discrepancy identification
- Regime: Market regime change detection
- Microstructure: Order flow analysis, volume patterns
Advanced Risk Modeling & Scenario Analysis
- Generates thousands of market scenarios using stochastic processes
- Implements Geometric Brownian Motion (GBM) for price simulation
- Performs Value-at-Risk (VaR) calculations with confidence intervals
- Analyzes portfolio stress testing under extreme market conditions
- Provides probability distributions for returns and drawdowns
Key Features:
- Customizable simulation parameters (time horizon, volatility, drift)
- Multi-asset portfolio simulation capabilities
- Historical backtesting integration
- Risk metric calculations (VaR, CVaR, Expected Shortfall)
- Interactive visualization of simulation results
Dynamic Trading Strategy Development
- Visual strategy construction with drag-and-drop components
- Real-time backtesting against historical market data
- Parameter optimization using genetic algorithms
- Walk-forward analysis for strategy robustness testing
- Performance attribution and risk decomposition
Supported Strategy Components:
- Entry Signals: Technical indicators, price patterns, volume analysis
- Exit Rules: Profit targets, stop losses, trailing stops, time exits
- Risk Management: Position sizing, portfolio heat management
- Filters: Market regime filters, volatility filters, correlation filters
- Performance Metrics: Sharpe ratio, Sortino ratio, maximum drawdown
Interactive Quantitative Research Platform
- Jupyter-like notebook interface for financial analysis
- Code execution with real-time output visualization
- Integration with all FeenQR services and plugins
- Markdown support for documentation and analysis notes
- Export capabilities for sharing research findings
Built-in Analysis Tools:
- Data Visualization: Charts, graphs, and statistical plots
- Statistical Analysis: Hypothesis testing, regression analysis
- Time Series Analysis: ARIMA, GARCH, cointegration testing
- Machine Learning: Model training and evaluation workflows
- Performance Analytics: Strategy benchmarking and comparison
Notebook Plugins:
MonteCarloPlugin: Simulation execution and result analysisStrategyBuilderPlugin: Interactive strategy developmentDataAnalysisPlugin: Statistical and visualization functionsModelValidationPlugin: Backtesting and performance evaluation
The system tracks comprehensive metrics:
- Total return and P&L
- Sharpe ratio and volatility
- Maximum drawdown
- Win rate and profit factor
- Portfolio diversification
- Risk-adjusted returns
Built-in risk controls include:
- Maximum drawdown limits
- Position size constraints
- Volatility targeting
- Diversification requirements
- Stop-loss and take-profit management
- Autonomous Operation: Self-managing job execution
- Adaptive Learning: Performance-based strategy adjustment
- Multi-Modal Analysis: Text, audio, and numerical data processing
- Contextual Decision Making: Market regime awareness
- Natural Language Interaction: Conversational AI interface
- Research & Strategy Development Tools: Monte Carlo simulations, interactive strategy builder, and research notebook environment
- Web Interface: Blazor Server dashboard with comprehensive widgets for market analysis, portfolio management, and research
- AI Agent Architecture: Full Semantic Kernel integration with modular plugins and autonomous orchestration
- Audio Processing: Integrate speech-to-text for actual podcast transcription
- Live Trading: Enhanced Alpaca integration for production trading
- Advanced Machine Learning: Deep learning models for price prediction and pattern recognition
- Multi-Asset Support: Expand beyond crypto to stocks, forex, commodities, and derivatives
- Real-time Data Pipeline: High-frequency data processing and order book analysis
- Cloud Deployment: Azure/container deployment with scalable architecture
This system provides a comprehensive quantitative research platform with AI-driven analysis, autonomous trading capabilities, and advanced research tools for professional quantitative finance.
