AI Newsletter Digest improvements: fixed QP soft line break decoding, URL extraction, and content cleaning
This commit is contained in:
139
skills/market-environment-analysis/SKILL.md
Normal file
139
skills/market-environment-analysis/SKILL.md
Normal file
@@ -0,0 +1,139 @@
|
||||
---
|
||||
name: market-environment-analysis
|
||||
description: Comprehensive market environment analysis and reporting tool. Analyzes global markets including US, European, Asian markets, forex, commodities, and economic indicators. Provides risk-on/risk-off assessment, sector analysis, and technical indicator interpretation. Triggers on keywords like market analysis, market environment, global markets, trading environment, market conditions, investment climate, market sentiment, forex analysis, stock market analysis, 相場環境, 市場分析, マーケット状況, 投資環境.
|
||||
---
|
||||
|
||||
# Market Environment Analysis
|
||||
|
||||
Comprehensive analysis tool for understanding market conditions and creating professional market reports anytime.
|
||||
|
||||
## Core Workflow
|
||||
|
||||
### 1. Initial Data Collection
|
||||
Collect latest market data using web_search tool:
|
||||
1. Major stock indices (S&P 500, NASDAQ, Dow, Nikkei 225, Shanghai Composite, Hang Seng)
|
||||
2. Forex rates (USD/JPY, EUR/USD, major currency pairs)
|
||||
3. Commodity prices (WTI crude, Gold, Silver)
|
||||
4. US Treasury yields (2-year, 10-year, 30-year)
|
||||
5. VIX index (Fear gauge)
|
||||
6. Market trading status (open/close/current values)
|
||||
|
||||
### 2. Market Environment Assessment
|
||||
Evaluate the following from collected data:
|
||||
- **Trend Direction**: Uptrend/Downtrend/Range-bound
|
||||
- **Risk Sentiment**: Risk-on/Risk-off
|
||||
- **Volatility Status**: Market anxiety level from VIX
|
||||
- **Sector Rotation**: Where capital is flowing
|
||||
|
||||
### 3. Report Structure
|
||||
|
||||
#### Standard Report Format:
|
||||
```
|
||||
1. Executive Summary (3-5 key points)
|
||||
2. Global Market Overview
|
||||
- US Markets
|
||||
- Asian Markets
|
||||
- European Markets
|
||||
3. Forex & Commodities Trends
|
||||
4. Key Events & Economic Indicators
|
||||
5. Risk Factor Analysis
|
||||
6. Investment Strategy Implications
|
||||
```
|
||||
|
||||
## Script Usage
|
||||
|
||||
### market_utils.py
|
||||
Provides common functions for report creation:
|
||||
```bash
|
||||
# Generate report header
|
||||
python scripts/market_utils.py
|
||||
|
||||
# Available functions:
|
||||
- format_market_report_header(): Create header
|
||||
- get_market_session_times(): Check trading hours
|
||||
- categorize_volatility(vix): Interpret VIX levels
|
||||
- format_percentage_change(value): Format price changes
|
||||
```
|
||||
|
||||
## Reference Documentation
|
||||
|
||||
### Key Indicators Interpretation (references/indicators.md)
|
||||
Reference when you need:
|
||||
- Important levels for each index
|
||||
- Technical analysis key points
|
||||
- Sector-specific focus areas
|
||||
|
||||
### Analysis Patterns (references/analysis_patterns.md)
|
||||
Reference when analyzing:
|
||||
- Risk-on/Risk-off criteria
|
||||
- Economic indicator interpretation
|
||||
- Inter-market correlations
|
||||
- Seasonality and market anomalies
|
||||
|
||||
## Output Examples
|
||||
|
||||
### Quick Summary Version
|
||||
```
|
||||
📊 Market Summary [2025/01/15 14:00]
|
||||
━━━━━━━━━━━━━━━━━━━━━
|
||||
【US】S&P 500: 5,123.45 (+0.45%)
|
||||
【JP】Nikkei 225: 38,456.78 (-0.23%)
|
||||
【FX】USD/JPY: 149.85 (↑0.15)
|
||||
【VIX】16.2 (Normal range)
|
||||
|
||||
⚡ Key Events
|
||||
- Japan GDP Flash
|
||||
- US Employment Report
|
||||
|
||||
📈 Environment: Risk-On Continues
|
||||
```
|
||||
|
||||
### Detailed Analysis Version
|
||||
Start with executive summary, then analyze each section in detail.
|
||||
Key clarifications:
|
||||
1. Current market phase (Bullish/Bearish/Neutral)
|
||||
2. Short-term direction (1-5 days outlook)
|
||||
3. Risk events to monitor
|
||||
4. Recommended position adjustments
|
||||
|
||||
## Important Considerations
|
||||
|
||||
### Timezone Awareness
|
||||
- Consider all major market timezones
|
||||
- US markets: Evening to early morning (Asian time)
|
||||
- European markets: Afternoon to evening (Asian time)
|
||||
- Asian markets: Morning to afternoon (Local time)
|
||||
|
||||
### Economic Calendar Priority
|
||||
Categorize by importance:
|
||||
- ⭐⭐⭐ Critical (FOMC, NFP, CPI, etc.)
|
||||
- ⭐⭐ Important (GDP, Retail Sales, etc.)
|
||||
- ⭐ Reference level
|
||||
|
||||
### Data Source Priority
|
||||
1. Official releases (Central banks, Government statistics)
|
||||
2. Major financial media (Bloomberg, Reuters)
|
||||
3. Broker reports
|
||||
4. Analyst consensus estimates
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Data Collection Notes
|
||||
- Check market holidays (holiday calendars)
|
||||
- Be aware of daylight saving time changes
|
||||
- Distinguish between flash and final data
|
||||
|
||||
### Market Volatility Response
|
||||
1. First organize the facts
|
||||
2. Reference historical similar events
|
||||
3. Verify with multiple sources
|
||||
4. Maintain objective analysis
|
||||
|
||||
## Customization Options
|
||||
|
||||
Adjust based on user's investment style:
|
||||
- **Day Traders**: Intraday charts, order flow focus
|
||||
- **Swing Traders**: Daily/weekly technicals emphasis
|
||||
- **Long-term Investors**: Fundamentals, macro economics focus
|
||||
- **Forex Traders**: Currency correlations, interest rate differentials
|
||||
- **Options Traders**: Volatility analysis, Greeks monitoring
|
||||
6
skills/market-environment-analysis/_meta.json
Normal file
6
skills/market-environment-analysis/_meta.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"ownerId": "kn7agf701n3afzzbq8ge0wa8k1809wm4",
|
||||
"slug": "market-environment-analysis",
|
||||
"version": "0.1.0",
|
||||
"publishedAt": 1769870272220
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
# Market Analysis Patterns
|
||||
|
||||
## Market Pattern Analysis
|
||||
|
||||
### Trend Identification
|
||||
1. **Uptrend**
|
||||
- Higher highs and higher lows
|
||||
- Moving averages trending upward
|
||||
- Price rises accompanied by volume increases
|
||||
|
||||
2. **Downtrend**
|
||||
- Lower highs and lower lows
|
||||
- Moving averages trending downward
|
||||
- Decreased volume on bounces
|
||||
|
||||
3. **Range-Bound Market**
|
||||
- Trading within defined range
|
||||
- Moving averages sideways
|
||||
- Declining volume trend
|
||||
|
||||
### Risk-On / Risk-Off Assessment
|
||||
|
||||
#### Risk-On Environment Characteristics
|
||||
- Stock markets rising (especially emerging markets)
|
||||
- High-yield currency buying (AUD, NZD, etc.)
|
||||
- VIX index declining
|
||||
- Interest rates rising
|
||||
- Risk assets like crude oil rising
|
||||
|
||||
#### Risk-Off Environment Characteristics
|
||||
- Flight to safe assets (yen buying, Swiss franc buying)
|
||||
- Gold prices rising
|
||||
- Bond buying (yields falling)
|
||||
- VIX index rising
|
||||
- Emerging market currencies and stocks selling
|
||||
|
||||
## Economic Indicator Interpretation
|
||||
|
||||
### Employment Data (US)
|
||||
|
||||
- **Nonfarm Payrolls (NFP)**
|
||||
- +200k or more above expectations: Strong employment, rate hike expectations
|
||||
- -100k or more below expectations: Employment deterioration, rate cut expectations
|
||||
|
||||
- **Unemployment Rate**
|
||||
- 3.5% or below: Near full employment
|
||||
- 4.0% or above: Signs of employment environment deterioration
|
||||
|
||||
### Inflation Indicators
|
||||
|
||||
- **CPI (Consumer Price Index)**
|
||||
- 2% YoY: Fed target level
|
||||
- 3%+: Inflation alert
|
||||
- Below 1%: Deflation risk
|
||||
|
||||
- **PPI (Producer Price Index)**
|
||||
- Important as CPI leading indicator
|
||||
- Captures upstream inflation
|
||||
|
||||
### Central Bank Policy
|
||||
|
||||
- **Fed (Federal Reserve)**
|
||||
- Watch dot plot
|
||||
- Policy rate outlook changes
|
||||
|
||||
- **BOJ (Bank of Japan)**
|
||||
- YCC (Yield Curve Control) policy
|
||||
- ETF purchase trends
|
||||
|
||||
- **ECB (European Central Bank)**
|
||||
- 2% inflation target
|
||||
- Response to regional disparities
|
||||
|
||||
## Inter-Market Correlation Analysis
|
||||
|
||||
### Positive Correlation Patterns
|
||||
- Stocks ↑ → Interest rates ↑ (strong economy)
|
||||
- USD/JPY ↑ → Nikkei ↑ (exporters favorable)
|
||||
- Crude oil ↑ → Inflation expectations ↑
|
||||
|
||||
### Inverse Correlation Patterns
|
||||
- Interest rates ↑ → Bond prices ↓
|
||||
- Dollar ↑ → Gold prices ↓
|
||||
- VIX ↑ → Stocks ↓
|
||||
|
||||
## Seasonality & Anomalies
|
||||
|
||||
### Monthly Patterns
|
||||
- **January Effect**: New year fund inflows
|
||||
- **Sell in May**: Pre-summer doldrums position closing
|
||||
- **September**: Historically weak month
|
||||
- **December**: Tax-loss selling, Santa Claus rally
|
||||
|
||||
### Day-of-Week Effects
|
||||
- **Monday**: Weekend risk pricing
|
||||
- **Friday**: Position adjustments
|
||||
|
||||
### Fiscal Year-End
|
||||
- **End of March**: Japanese corporate fiscal year, repatriation flows
|
||||
- **End of December**: Western corporate fiscal year
|
||||
|
||||
## Technical Indicator Usage
|
||||
|
||||
### Trend Indicators
|
||||
- **Moving Averages**: 25-day, 75-day, 200-day line relationships
|
||||
- **MACD**: Identifying trend turning points
|
||||
- **Bollinger Bands**: Volatility and contrarian entry points
|
||||
|
||||
### Oscillators
|
||||
- **RSI**: Over 70 overbought, below 30 oversold
|
||||
- **Stochastics**: Short-term turning points
|
||||
- **Volume**: Confirming price movement reliability
|
||||
|
||||
## Sentiment Analysis
|
||||
|
||||
### Capturing Investor Psychology
|
||||
- **Put/Call Ratio**: Option market skew
|
||||
- **Bull/Bear Ratio**: Investor surveys
|
||||
- **Fear & Greed Index**: CNN Fear & Greed Index
|
||||
|
||||
### News Flow Analysis
|
||||
- Headline tone changes
|
||||
- Media coverage frequency
|
||||
- Social media buzzwords
|
||||
99
skills/market-environment-analysis/references/indicators.md
Normal file
99
skills/market-environment-analysis/references/indicators.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# Market Indicators Reference
|
||||
|
||||
## Major Stock Indices
|
||||
|
||||
### Japan
|
||||
- **Nikkei 225**: Stock price average of 225 representative stocks on Tokyo Stock Exchange Prime
|
||||
- Key levels: 30,000, 35,000, 40,000 yen
|
||||
- Moving averages: Emphasize 25-day, 75-day, 200-day lines
|
||||
|
||||
- **TOPIX**: Market-cap weighted average of all Tokyo Stock Exchange Prime stocks
|
||||
- Better reflects overall market
|
||||
- Heavily influenced by banking/financial sector
|
||||
|
||||
### United States
|
||||
- **S&P 500**: 500 large-cap US stocks
|
||||
- Most representative US stock index
|
||||
- Key levels: 4,000, 4,500, 5,000 points
|
||||
|
||||
- **NASDAQ**: Tech-focused
|
||||
- Reflects mega-cap tech stock trends like GAFAM
|
||||
- Higher volatility
|
||||
|
||||
- **Dow Jones Industrial Average**: Simple average of 30 stocks
|
||||
- Historically significant but limited representation
|
||||
|
||||
## Foreign Exchange Rates
|
||||
|
||||
### USD/JPY (Dollar-Yen)
|
||||
- Greatest impact on Japanese economy
|
||||
- Key levels: 140, 145, 150, 155 yen
|
||||
- BOJ intervention alert line: Reference past intervention records
|
||||
|
||||
### EUR/JPY (Euro-Yen)
|
||||
- Related to European economy
|
||||
- Influenced by ECB policy
|
||||
|
||||
### CNY/JPY (Yuan-Yen)
|
||||
- Reflects Chinese economic trends
|
||||
- Indicator of Asian trade
|
||||
|
||||
## Volatility Indicators
|
||||
|
||||
### VIX Index (Fear Index)
|
||||
- Calculated from S&P 500 option prices
|
||||
- Quantifies market anxiety psychology
|
||||
- Interpretation:
|
||||
- 10-15: Low volatility, stable market
|
||||
- 15-20: Normal range
|
||||
- 20-30: Unstable, caution needed
|
||||
- 30+: High stress, panic selling
|
||||
|
||||
### Nikkei VI
|
||||
- Volatility indicator for Nikkei Average
|
||||
- Japanese version of VIX
|
||||
|
||||
## Commodities
|
||||
|
||||
### Crude Oil (WTI/Brent)
|
||||
- Important as inflation indicator
|
||||
- Reflects geopolitical risks
|
||||
- Key levels: 70, 80, 90, 100 dollars/barrel
|
||||
|
||||
### Gold
|
||||
- Representative safe asset
|
||||
- Tends to rise during dollar weakness/inflation
|
||||
- Key levels: 1,900, 2,000, 2,100 dollars/ounce
|
||||
|
||||
## Interest Rates & Bonds
|
||||
|
||||
### US 10-Year Treasury Yield
|
||||
- Most critical interest rate indicator
|
||||
- Direct impact on stock valuations
|
||||
- Key levels: 3.5%, 4.0%, 4.5%, 5.0%
|
||||
|
||||
### Japan 10-Year Government Bond Yield
|
||||
- Reflects BOJ policy
|
||||
- Watch YCC target range
|
||||
|
||||
## Sector-Specific Focus Points
|
||||
|
||||
### Technology
|
||||
- AI-related stock trends
|
||||
- Semiconductor cycle
|
||||
- Regulatory risks
|
||||
|
||||
### Financials
|
||||
- Heavily influenced by interest rate trends
|
||||
- Bank lending attitudes
|
||||
- Non-performing loan ratios
|
||||
|
||||
### Energy
|
||||
- Linked to crude oil prices
|
||||
- Impact of decarbonization policies
|
||||
- Renewable energy shift
|
||||
|
||||
### Consumer
|
||||
- Consumer confidence index
|
||||
- Retail sales
|
||||
- Inflation impact
|
||||
127
skills/market-environment-analysis/scripts/market_utils.py
Normal file
127
skills/market-environment-analysis/scripts/market_utils.py
Normal file
@@ -0,0 +1,127 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Market Analysis Utility Functions for Environment Report
|
||||
|
||||
This script provides common functions for market analysis report creation.
|
||||
"""
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
import json
|
||||
|
||||
|
||||
def get_market_session_times():
|
||||
"""Returns major market trading hours"""
|
||||
return {
|
||||
"Tokyo": {"open": "09:00 JST", "close": "15:00 JST", "lunch": "11:30-12:30"},
|
||||
"Shanghai": {"open": "09:30 CST", "close": "15:00 CST", "lunch": "11:30-13:00"},
|
||||
"Hong Kong": {"open": "09:30 HKT", "close": "16:00 HKT", "lunch": "12:00-13:00"},
|
||||
"Singapore": {"open": "09:00 SGT", "close": "17:00 SGT", "lunch": "12:00-13:00"},
|
||||
"London": {"open": "08:00 GMT", "close": "16:30 GMT", "lunch": None},
|
||||
"New York": {"open": "09:30 EST", "close": "16:00 EST", "lunch": None}
|
||||
}
|
||||
|
||||
|
||||
def format_market_report_header():
|
||||
"""Format report header"""
|
||||
now = datetime.now()
|
||||
weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
|
||||
return f"""
|
||||
=====================================
|
||||
📊 Daily Market Environment Report
|
||||
=====================================
|
||||
Created: {now.strftime('%Y-%m-%d')} ({weekdays[now.weekday()]}) {now.strftime('%H:%M')}
|
||||
=====================================
|
||||
"""
|
||||
|
||||
|
||||
def calculate_trading_days_to_event(event_date_str):
|
||||
"""Calculate trading days to event"""
|
||||
# Simple version: excludes weekends (doesn't consider holidays)
|
||||
event_date = datetime.strptime(event_date_str, "%Y-%m-%d")
|
||||
today = datetime.now().date()
|
||||
|
||||
trading_days = 0
|
||||
current = today
|
||||
|
||||
while current < event_date.date():
|
||||
if current.weekday() < 5: # Monday to Friday
|
||||
trading_days += 1
|
||||
current += timedelta(days=1)
|
||||
|
||||
return trading_days
|
||||
|
||||
|
||||
def format_percentage_change(value):
|
||||
"""Format percentage change"""
|
||||
if value >= 0:
|
||||
return f"📈 +{value:.2f}%"
|
||||
else:
|
||||
return f"📉 {value:.2f}%"
|
||||
|
||||
|
||||
def categorize_volatility(vix_value):
|
||||
"""Categorize volatility based on VIX level"""
|
||||
if vix_value < 12:
|
||||
return "Low & Stable 😌"
|
||||
elif vix_value < 20:
|
||||
return "Normal Range 📊"
|
||||
elif vix_value < 30:
|
||||
return "Elevated ⚠️"
|
||||
elif vix_value < 40:
|
||||
return "High Volatility 🔥"
|
||||
else:
|
||||
return "Extreme Volatility 🚨"
|
||||
|
||||
|
||||
def get_market_status():
|
||||
"""Determine current market status"""
|
||||
now = datetime.now()
|
||||
hour = now.hour
|
||||
|
||||
status = []
|
||||
|
||||
# Simple market open determination (timezone not considered)
|
||||
if 9 <= hour < 15:
|
||||
status.append("🟢 Tokyo Market: Trading")
|
||||
elif 15 <= hour < 18:
|
||||
status.append("🔴 Tokyo Market: Closed")
|
||||
else:
|
||||
status.append("⏰ Tokyo Market: After hours")
|
||||
|
||||
if 21 <= hour or hour < 4:
|
||||
status.append("🟢 US Market: Trading (previous day)")
|
||||
else:
|
||||
status.append("🔴 US Market: Closed")
|
||||
|
||||
return "\n".join(status)
|
||||
|
||||
|
||||
def generate_checklist():
|
||||
"""Generate market analysis checklist"""
|
||||
return """
|
||||
📋 Analysis Checklist
|
||||
--------------------
|
||||
□ US market status check
|
||||
□ Asian market status check
|
||||
□ European market status check
|
||||
□ Forex rates (USD/JPY, EUR/USD, CNY)
|
||||
□ Index futures movements
|
||||
□ VIX level check
|
||||
□ Oil & Gold prices
|
||||
□ Economic calendar
|
||||
□ Corporate earnings schedule
|
||||
□ Central bank news
|
||||
□ Geopolitical risks
|
||||
"""
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Market Analysis Utility - Test Run")
|
||||
print(format_market_report_header())
|
||||
print("\nCurrent Market Status:")
|
||||
print(get_market_status())
|
||||
print("\nTrading Hours:")
|
||||
for market, times in get_market_session_times().items():
|
||||
lunch = f" (Lunch break: {times['lunch']})" if times.get('lunch') else ""
|
||||
print(f" {market}: {times['open']} - {times['close']}{lunch}")
|
||||
print(generate_checklist())
|
||||
Reference in New Issue
Block a user