326 lines
No EOL
9.9 KiB
Markdown
326 lines
No EOL
9.9 KiB
Markdown
# Market Data Processing Pipeline -cskill
|
|
|
|
Complete end-to-end pipeline for processing market data from raw sources to actionable insights. This skill demonstrates how **"expertise reutilizível"** is implemented as a **"standard operational procedure"** in pipeline form.
|
|
|
|
## 🎯 **About This Pipeline Skill**
|
|
|
|
This is a **Claude Skill** created by the Agent-Skill-Creator that embodies the concept of expertise captured as executable procedures. It represents a complete **end-to-end workflow** that transforms raw market data through multiple processing stages to deliver actionable investment insights.
|
|
|
|
**Key Characteristics:**
|
|
- **Type**: Pipeline Skill (Complete End-to-End Processing)
|
|
- **Architecture**: Sequential 4-Stage Pipeline
|
|
- **Expertise Domain**: Financial Analysis & Technical Trading
|
|
- **Naming Convention**: `-cskill` suffix indicates Agent-Skill-Creator origin
|
|
|
|
## 🔄 **Pipeline Architecture: Standard Operational Procedure**
|
|
|
|
This skill implements a **complete end-to-end pipeline** where each stage automatically processes the output of the previous stage:
|
|
|
|
### **Stage 1: Raw Data Acquisition**
|
|
```
|
|
Market Data Sources → Data Collection → Validation → Validated Raw Data
|
|
```
|
|
- Fetches data from Yahoo Finance, Alpha Vantage APIs
|
|
- Validates data quality and completeness
|
|
- Handles multiple data sources with quality scoring
|
|
|
|
### **Stage 2: Data Processing & Enrichment**
|
|
```
|
|
Validated Raw Data → Cleaning → Normalization → Feature Engineering → Processed Data
|
|
```
|
|
- Cleans and normalizes data across sources
|
|
- Adds derived features (returns, volatility, indicators)
|
|
- Ensures data consistency and quality
|
|
|
|
### **Stage 3: Technical Analysis**
|
|
```
|
|
Processed Data → Indicator Calculation → Signal Generation → Technical Analysis Results
|
|
```
|
|
- Calculates RSI, MACD, Bollinger Bands, Moving Averages
|
|
- Generates trading signals based on technical indicators
|
|
- Computes risk metrics (volatility, drawdown, Sharpe ratio)
|
|
|
|
### **Stage 4: Insight Generation & Reporting**
|
|
```
|
|
Technical Analysis → Pattern Recognition → Recommendation Generation → Actionable Insights
|
|
```
|
|
- Creates investment recommendations with confidence scores
|
|
- Generates portfolio-level insights
|
|
- Produces comprehensive analysis reports
|
|
|
|
## 🚀 **Quick Start**
|
|
|
|
### **Installation**
|
|
```bash
|
|
# Install as Claude plugin
|
|
cd market-data-pipeline-cskill
|
|
/plugin marketplace add ./
|
|
|
|
# Install Python dependencies
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
### **Basic Usage**
|
|
```bash
|
|
# Execute complete pipeline for multiple stocks
|
|
"Run market data pipeline for AAPL, MSFT, GOOGL"
|
|
|
|
# Analyze specific sector
|
|
"Execute tech sector analysis pipeline using market-data-pipeline-cskill"
|
|
|
|
# Generate daily report
|
|
"Generate today's market analysis report with pipeline"
|
|
```
|
|
|
|
### **Python Usage**
|
|
```python
|
|
from scripts.pipeline_executor import MarketDataPipeline
|
|
|
|
# Initialize pipeline
|
|
pipeline = MarketDataPipeline()
|
|
|
|
# Configure analysis
|
|
config = {
|
|
'tickers': ['AAPL', 'MSFT', 'GOOGL'],
|
|
'period': '6mo',
|
|
'data_sources': ['yahoo_finance']
|
|
}
|
|
|
|
# Execute complete pipeline
|
|
results = pipeline.execute_pipeline(config)
|
|
|
|
# Get summary
|
|
print(pipeline.get_pipeline_summary(results))
|
|
```
|
|
|
|
## 📊 **Pipeline vs Component Architecture**
|
|
|
|
### **Pipeline Approach (This Skill)**
|
|
✅ **Complete Solution**: One command executes entire workflow
|
|
✅ **Automatic Flow**: Data passes seamlessly between stages
|
|
✅ **Consistent Processing**: Uniform methodology across all stages
|
|
✅ **Error Handling**: Graceful degradation with validation
|
|
|
|
### **Component Approach (Alternative)**
|
|
❌ **Manual Coordination**: User must manage 4 separate skills
|
|
❌ **Data Transfer**: Manual output/input handling required
|
|
❌ **Complexity**: Higher cognitive load for users
|
|
❌ **Error Prone**: More opportunities for user error
|
|
|
|
## 🎯 **Practical Examples**
|
|
|
|
### **Example 1: Daily Market Analysis**
|
|
```bash
|
|
User: "Execute today's market analysis pipeline"
|
|
|
|
Pipeline Execution:
|
|
1. Fetch latest data for watchlist stocks
|
|
2. Process and clean data automatically
|
|
3. Calculate technical indicators
|
|
4. Generate daily investment report
|
|
|
|
Output: Complete analysis with actionable recommendations
|
|
```
|
|
|
|
### **Example 2: Portfolio Risk Assessment**
|
|
```bash
|
|
User: "Run portfolio risk analysis pipeline"
|
|
|
|
Pipeline Execution:
|
|
1. Acquire historical data for portfolio holdings
|
|
2. Process and calculate correlations
|
|
3. Compute risk metrics and VaR
|
|
4. Generate risk assessment report
|
|
|
|
Output: Comprehensive risk analysis with mitigation strategies
|
|
```
|
|
|
|
### **Example 3: Sector Comparison**
|
|
```bash
|
|
User: "Compare technology sector performance pipeline"
|
|
|
|
Pipeline Execution:
|
|
1. Gather data for all tech sector stocks
|
|
2. Process and normalize across companies
|
|
3. Calculate sector-specific metrics
|
|
4. Generate comparative analysis
|
|
|
|
Output: Sector performance rankings and relative analysis
|
|
```
|
|
|
|
## 📋 **Output Structure**
|
|
|
|
The pipeline generates comprehensive insights including:
|
|
|
|
### **Individual Ticker Analysis**
|
|
```json
|
|
{
|
|
"ticker": "AAPL",
|
|
"recommendation": {
|
|
"action": "BUY",
|
|
"confidence": 0.82,
|
|
"reasoning": "Strong buy signals with high confidence",
|
|
"time_horizon": "short_to_medium_term"
|
|
},
|
|
"key_insights": [
|
|
"Strong positive momentum over 20 days (+15.2%)",
|
|
"Strong BUY signals detected"
|
|
],
|
|
"risk_assessment": {
|
|
"level": "MEDIUM",
|
|
"volatility": 0.25,
|
|
"max_drawdown": -0.12
|
|
},
|
|
"technical_outlook": {
|
|
"trend": "BULLISH",
|
|
"momentum": "BULLISH",
|
|
"overall_sentiment": "BULLISH"
|
|
}
|
|
}
|
|
```
|
|
|
|
### **Portfolio-Level Insights**
|
|
```json
|
|
{
|
|
"portfolio_summary": {
|
|
"total_tickers": 3,
|
|
"buy_recommendations": 2,
|
|
"sell_recommendations": 0,
|
|
"hold_recommendations": 1
|
|
},
|
|
"portfolio_strategy": {
|
|
"strategy": "AGGRESSIVE_GROWTH",
|
|
"description": "Multiple buy opportunities suggest bullish conditions"
|
|
},
|
|
"diversification_insights": {
|
|
"concentration_risk": "LOW",
|
|
"recommendation_distribution": {"BUY": 2, "SELL": 0, "HOLD": 1}
|
|
}
|
|
}
|
|
```
|
|
|
|
## ⚙️ **Configuration**
|
|
|
|
### **Pipeline Settings**
|
|
```json
|
|
{
|
|
"pipeline_settings": {
|
|
"cache_duration": 3600,
|
|
"parallel_processing": true,
|
|
"quality_threshold": 0.95,
|
|
"error_handling": "graceful_degradation"
|
|
}
|
|
}
|
|
```
|
|
|
|
### **Technical Indicators**
|
|
```json
|
|
{
|
|
"analysis_config": {
|
|
"indicators": {
|
|
"rsi": {"period": 14, "oversold": 30, "overbought": 70},
|
|
"macd": {"fast": 12, "slow": 26, "signal": 9},
|
|
"bollinger_bands": {"period": 20, "std_dev": 2}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
## 🧠 **The Power of Pipeline Skills**
|
|
|
|
This example demonstrates the core concept that **Claude Skills represent captured expertise** as **executable standard procedures**:
|
|
|
|
### **Expertise Captured:**
|
|
- Financial analysis methodologies from professional trading
|
|
- Technical analysis procedures and best practices
|
|
- Market data processing workflows
|
|
- Investment research and risk assessment practices
|
|
|
|
### **Procedure Implemented:**
|
|
- Automatic execution of complex multi-stage workflows
|
|
- Seamless data flow between processing stages
|
|
- Quality assurance and validation at each step
|
|
- Consistent application of domain expertise
|
|
|
|
### **Value Delivered:**
|
|
- **Complete Solution**: End-to-end processing in one command
|
|
- **Expertise Access**: Professional analysis without manual effort
|
|
- **Consistency**: Standardized procedure every time
|
|
- **Efficiency**: Complex workflows executed automatically
|
|
|
|
## 🔧 **Technical Specifications**
|
|
|
|
### **Dependencies**
|
|
```python
|
|
pandas>=1.3.0 # Data processing
|
|
numpy>=1.21.0 # Numerical calculations
|
|
yfinance>=0.1.70 # Market data fetching
|
|
requests>=2.25.0 # API requests
|
|
matplotlib>=3.3.0 # Visualization (optional)
|
|
```
|
|
|
|
### **Performance Characteristics**
|
|
- **Processing Time**: ~30-60 seconds for 3-5 tickers
|
|
- **Data Sources**: Yahoo Finance (free), Alpha Vantage (API key required)
|
|
- **Cache Duration**: 1 hour for market data
|
|
- **Quality Threshold**: 95% data quality required
|
|
|
|
### **Error Handling**
|
|
- **Graceful Degradation**: Pipeline continues if individual stages fail
|
|
- **Data Validation**: Quality checks at each stage transition
|
|
- **Fallback Sources**: Multiple data sources with automatic selection
|
|
- **Comprehensive Logging**: Detailed execution logs for debugging
|
|
|
|
## 📈 **Use Cases**
|
|
|
|
### **For Individual Investors**
|
|
- Daily portfolio analysis and monitoring
|
|
- Risk assessment and position sizing
|
|
- Market timing and entry/exit signals
|
|
- Sector rotation strategies
|
|
|
|
### **For Financial Advisors**
|
|
- Client portfolio analysis
|
|
- Investment recommendation generation
|
|
- Risk reporting and compliance
|
|
- Market research summaries
|
|
|
|
### **For Quantitative Analysts**
|
|
- Systematic strategy backtesting
|
|
- Risk factor analysis
|
|
- Signal generation and validation
|
|
- Portfolio optimization
|
|
|
|
## 🚨 **Important Notes**
|
|
|
|
### **Data Limitations**
|
|
- Yahoo Finance data may have delays and limitations
|
|
- Real-time data requires premium subscriptions
|
|
- Historical data accuracy varies by exchange
|
|
|
|
### **Analysis Limitations**
|
|
- Technical analysis has inherent limitations
|
|
- Past performance does not guarantee future results
|
|
- Market conditions can change rapidly
|
|
|
|
### **Risk Disclaimer**
|
|
```
|
|
This analysis is generated by automated systems and should not be
|
|
considered as financial advice. Please consult with a qualified
|
|
financial advisor before making investment decisions.
|
|
```
|
|
|
|
## 🎉 **Conclusion**
|
|
|
|
This **market-data-pipeline-cskill** exemplifies how Claude Skills transform **"expertise reutilizível"** into **executable "standrd operational procedures"** that deliver complete end-to-end solutions.
|
|
|
|
The pipeline architecture ensures that complex multi-stage workflows can be executed automatically, transforming raw data into actionable insights through a sequence of well-defined processing stages.
|
|
|
|
**This is the essence of Claude Skills: captured expertise made executable as standard procedures.**
|
|
|
|
---
|
|
|
|
**Created by**: Agent-Skill-Creator
|
|
**Naming Convention**: `-cskill` suffix for clear identification
|
|
**Architecture**: End-to-End Pipeline Processing
|
|
**Type**: Claude Skill (Executable Expertise) |