Market Analyst
by @eddieluong
Global asset investment analysis and advisory — VN & US stocks, forex, gold, oil, crypto, ETF, DCA. Combines real-time technical analysis (RSI, MACD, EMA, Bo...
clawhub install market-analyst📖 About This Skill
name: global-market-analyst description: "Global asset investment analysis and advisory — VN & US stocks, forex, gold, oil, crypto, ETF, DCA. Combines real-time technical analysis (RSI, MACD, EMA, Bollinger Bands) from TradingView with fundamental analysis (P/E, ROE, Sharpe, CAGR, sector valuation). Use when: (1) user asks about VN or global stock prices, (2) user wants to know which assets to buy, (3) user asks about portfolio management, (4) user wants to calculate monthly DCA accumulation, (5) user asks how much to invest per month, (6) user wants to estimate returns over time, (7) user wants to compare global asset classes, (8) user asks about gold, crypto, S&P 500, ETF, (9) user asks about swing trading, scalping, day trading VN, (10) user asks about forex EUR/USD, USD/JPY, (11) user asks about commodities oil WTI, silver, (12) user asks about US stocks AAPL, NVDA, TSLA, MSFT, (13) user wants to analyze/rebalance an existing portfolio, (14) user wants to scan markets for a new optimal portfolio, (15) user asks about portfolio optimization, Markowitz, asset allocation."
Global Market Analyst
Global asset analysis — VN stocks, US equities, Forex, Commodities, Crypto, ETF — real-time technical + fundamental + valuation + return estimation.
⚠️ Most Important Principle
Historical CAGR ≠ expectation from current price. Always ask: *"If buying TODAY at this price, what is the P/E? Is it still cheap?"*
Example: MCH CAGR 73%/year from the 30k bottom → but at current price 161k, P/E ~37x is expensive. Sharpe 2.19 is historical from low price zone — does not apply to buyers today.
Step 0: Understand Requirements & Check Macro
Before analyzing any asset, always check:
🇻🇳 Macro Việt Nam
Current macro context (updated 23/03/2026):🇺🇸 Macro Mỹ
🌍 Global Macro
Portfolio impact:
See details: references/macro-update-2026-03.md, references/crypto-analysis.md, references/gold-analysis.md.
Determine:
Step 1: Real-time Data (TradingView Scanner)
TradingView scanner works WITHOUT auth:
🇻🇳 VN Stocks
# Scan all HOSE for oversold stocks
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_market.py --rsi 40 --exchange HOSEDeep technical analysis for a single VN stock
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/analyze_stock.py FPT HOSE
🇺🇸 US Stocks
# Scan NASDAQ oversold (large-cap > $2B)
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_market.py --rsi 40 --exchange NASDAQScan NYSE
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_market.py --rsi 35 --exchange NYSE
🌍 Global Markets (Crypto, Forex, Commodities)
# Scan US equities (large-cap > $10B)
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_global.py --market us --rsi 40Scan crypto
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_global.py --market crypto --rsi 35Scan forex major pairs
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_global.py --market forexScan commodities (gold, oil, silver)
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_global.py --market commoditiesScan all markets
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_global.py --market all --rsi 40
Manually fetch multiple tickers (any market):
import urllib.request, jsonVN stocks
payload = {
"symbols": {"tickers": ["HOSE:MBB","HOSE:TCB","HOSE:FPT"]},
"columns": ["name","close","change","volume","RSI","EMA20","EMA50","EMA200",
"MACD.macd","MACD.signal","BB.upper","BB.lower",
"price_52_week_high","price_52_week_low","Stoch.K","Stoch.D"]
}
req = urllib.request.Request(
"https://scanner.tradingview.com/vietnam/scan",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json", "User-Agent": "Mozilla/5.0"},
method="POST"
)US stocks → "https://scanner.tradingview.com/america/scan"
Crypto → "https://scanner.tradingview.com/crypto/scan"
Forex → "https://scanner.tradingview.com/forex/scan"
Commodities → "https://scanner.tradingview.com/cfd/scan"
Step 2: Technical Analysis (Applies to ALL asset classes)
Read each indicator in priority order:
1. EMA200 — Check FIRST
close > EMA200 ✅ → Long-term uptrend intact → consider buyingclose < EMA200 ❌ → Long-term downtrend → be cautious, buy only with a clear catalyst⚠️ Do NOT buy oversold assets below EMA200 (unless there is a clear catalyst)
2. RSI(14)
| RSI | Signal | Action | |---|---|---| | < 30 | 🟢🟢 Extreme oversold | Consider strong buy if above EMA200 | | 30–40 | 🟢 Oversold | DCA if above EMA200 | | 40–60 | 🟡 Neutral | Hold / wait | | 60–70 | 🔴 Near overbought | Do not add positions | | > 70 | 🔴🔴 Overbought | Consider taking profit |3. MACD
macd > signal → 🟢 Bullish momentummacd < signal → 🔴 Bearish momentum4. Bollinger Bands
close ≤ BB.lower → Near lower band → potential bounce5. Stochastic K/D
6. 52W Position
pos52 = (close - low52w) / (high52w - low52w) × 100
🎯 Buy Zone Score (composite)
score = 0
if rsi < 30: score += 3
elif rsi < 40: score += 2
if close > ema200: score += 2
if pe_discount > 20%: score += 3 # P/E < Fair P/E - 20%
elif pe_discount > 0: score += 2
if pos52 < 20: score += 2
elif pos52 < 40: score += 1
if close <= bb_lower * 1.02: score += 2
if macd > macd_signal: score += 1
Max: 15 điểm
≥ 10: Mua mạnh | 7-9: DCA | 4-6: Theo dõi | < 4: Bỏ qua
Step 3: Valuation Analysis — MANDATORY (Stocks & ETF)
Do NOT recommend BUY without checking valuation.
P/E Analysis
Upside = (Fair P/E - Current P/E) / Fair P/E × 100%
| Upside | Assessment | |---|---| | > 25% | 🟢 Very cheap — buy | | 10–25% | 🟡 Slightly cheap — accumulate | | 0–10% | 🟡 Fair — OK | | < 0% | 🔴 Expensive — wait for correction | | < -15% | 🔴🔴 Very expensive — avoid |
Fair P/E by VN sector:
Fair P/E by US sector: (Xem chi tiết references/us-equities.md)
See details in references/sector-fundamentals.md (VN) và references/us-equities.md (US)
Other Fundamental Metrics
See full framework in references/financial-analysis-knowledge.md
Step 4: Sector & Catalyst Analysis
🇻🇳 VN Sectors
Referencereferences/sector-fundamentals.md và references/sector-update-2026.md.Catalyst VN 2026-2028:
🇺🇸 US Sectors
Referencereferences/us-equities.md.Catalyst US 2026-2028:
Always answer: 1. Where is the sector in the cycle? (growth / peak / recession / bottom) 2. What are the catalysts for the next 1-3 years? 3. What are the main risks?
Step 5: US Equities Analysis
When user asks about US stocks (AAPL, NVDA, TSLA, MSFT, GOOG, META, AMZN, v.v.):
Workflow:
1. Scan data:scan_global.py --market us hoặc fetch trực tiếp
2. Technical: Áp dụng Step 2 (EMA200, RSI, MACD, BB)
3. Valuation: Forward P/E vs sector average, PEG ratio
4. Earnings: Check earnings calendar — KHÔNG mua ngay trước earnings
5. Macro: FED rate path, US 10Y yield, DXY ảnh hưởngKey Metrics for US Stocks:
US vs VN Differences:
See details: references/us-equities.md
Step 6: Forex Analysis
When user asks about forex (EUR/USD, USD/JPY, GBP/USD, v.v.):
Workflow:
1. Scan:scan_global.py --market forex
2. Macro check: Interest rate differential giữa 2 đồng tiền
3. Technical: EMA, RSI, Fibonacci, pivot points
4. Session timing: Asian/European/US session
5. Risk: Swap rates, leverage managementKey Pairs & Factors:
| Cặp | Key Factors | |-----|--------------| | EUR/USD | FED vs ECB rates, trade balance EU-US | | USD/JPY | FED vs BOJ, risk sentiment, carry trade | | GBP/USD | BOE rate, Brexit effects, UK economy | | AUD/USD | RBA rate, commodities (iron ore), China demand | | USD/VND | SBV policy, trade balance VN, FDI flows |Session Times (VN time):
Risk Management Forex:
See details: references/forex-guide.md
Step 7: Commodities Analysis (Gold, Oil, Silver)
When user asks about gold (XAUUSD), oil (WTI/Brent), silver (XAGUSD):
Workflow:
1. Scan:scan_global.py --market commodities
2. Macro: Real rates (US 10Y - CPI), DXY, geopolitics
3. Technical: EMA200, RSI, Fibonacci retracement
4. Specific factors: (xem bên dưới)🥇 Gold (XAUUSD):
references/gold-analysis.md🛢️ Oil (WTI / Brent):
🥈 Silver (XAGUSD):
Step 8: Global ETF Analysis
When user asks about ETF (VOO, QQQ, VNM, v.v.):
Workflow:
1. Identify need: Core portfolio? Sector bet? Country exposure? 2. Compare: Expense ratio, tracking error, AUM, liquidity 3. Technical: Áp dụng EMA200, RSI cho ETF chart 4. DCA plan: Phân bổ theo risk profileQuick ETF Recommendations:
| Purpose | ETF | Expense | Notes | |----------|-----|---------|---------| | Core US | VOO / IVV | 0.03% | S&P 500, portfolio foundation | | Tech/Growth | QQQ / QQQM | 0.15-0.20% | NASDAQ 100, AI exposure | | VN Exposure | VNM | 0.66% | VanEck Vietnam ETF | | Emerging Markets | VWO / IEMG | 0.08-0.09% | Broad EM | | Bonds | BND / AGG | 0.03% | US total bond | | Gold | GLD / IAU | 0.25-0.40% | Physical gold ETF | | All-World | VT | 0.07% | Toàn cầu, lazy portfolio |DCA Portfolios:
Conservative: VOO 40% + BND 30% + VWO 15% + GLD 15% Balanced: VOO 45% + QQQ 20% + VWO 15% + BND 10% + GLD 10% Aggressive: QQQ 35% + VOO 25% + VWO/VNM 20% + ARKK/SOXX 10% + GLD 10%
See details: references/global-etf.md
Step 9: Portfolio Management
When user asks about portfolio management, rebalancing, asset allocation, or building a new portfolio:
Option 1: Analyze Existing Portfolio → Rebalance
# Analyze & recommend rebalancing for current portfolio
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/portfolio_optimizer.py \
--portfolio "MBB:30,FPT:25,GOLD:20,BNB:15,CASH:10" \
--capital 500000000 \
--risk balanced
Input:
--portfolio : Current portfolio dạng "MÃ:tỷ_trọng%,..." --capital : Total capital (VND)--risk : conservative | balanced | aggressiveOutput:
Supported asset classes: VN stocks, US stocks, ETF, crypto (BTC/ETH/BNB/SOL...), gold (GOLD/XAUUSD), forex, bonds (BOND), cash (CASH)
Option 2: Scan Market → Recommend New Portfolio
# Scan & recommend new optimal portfolio
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/portfolio_screener.py \
--capital 500000000 \
--risk balanced \
--markets vn,us,crypto,gold \
--horizon medium
Input:
--capital : Total capital (VND)--risk : conservative | balanced | aggressive--markets : vn,us,crypto,gold (chọn thị trường)--horizon : short (< 3 tháng) | medium (3-12 tháng) | long (> 1 năm)Output:
Risk Profiles:
| Profile | Max single | Max equity | Max crypto | Min safe assets | Target Vol | |---------|-----------|-----------|-----------|----------------|-----------| | Conservative | 25% | 40% | 5% | 35% | 12% | | Balanced | 30% | 60% | 15% | 20% | 18% | | Aggressive | 35% | 80% | 25% | 5% | 25% |Step 10: Return Estimation
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/estimate_returns.py [TICKER] [--capital X] [--years N]
Script calculates from historical data:
⚠️ Always remind user:
See full methodology in references/return-estimation.md
Step 11: Portfolio Allocation (Global)
When user asks how to allocate capital:
Sizing by Sharpe
| Sharpe | Max allocation | |---|---| | > 1.5 | 35% | | 1.0–1.5 | 25% | | 0.5–1.0 | 15% | | < 0.5 | 10% |Sizing by Max Drawdown
| Max DD | Max allocation | |---|---| | < 30% | 30% | | 30–50% | 20% | | 50–70% | 10% | | > 70% | 5% |Global Portfolio Framework:
| Asset Class | Conservative | Balanced | Aggressive | |-------------|-------------|----------|------------| | VN Stocks | 20% | 25% | 30% | | US Stocks/ETF | 30% | 35% | 35% | | Bonds/Cash | 25% | 10% | 5% | | Gold | 15% | 15% | 10% | | Crypto | 0% | 5% | 10% | | Forex/Commodities | 0% | 5% | 10% | | EM ETF | 10% | 5% | 0% |DCA Strategy
Step 12: Output Formats
📊 VN Stock Output
## 📊 [TICKER] — [Tên công ty]
Price: X,XXX VND | Today: +/-X.XX% | Volume: XMTechnical
RSI: XX.X [tín hiệu]
EMA200: X,XXX [▲ Trên / ▼ Dưới] — [Uptrend / Downtrend]
MACD: [🟢 Bullish / 🔴 Bearish]
Bollinger: [vị trí]
52W: High X,XXX | Low X,XXX | Vị trí: XX%
Score: X/15 Valuation
P/E hiện tại: XX.Xx (Fair: XX-XXx)
Upside định giá: +/-XX%
ROE: XX% | D/E: XX Conclusion
[🟢 MUA / 🟡 THEO DÕI / ⏳ CHỜ / 🔴 TRÁNH]
Reason: [1-2 câu]
Ideal buy zone: [X,XXX – X,XXX VND]
🇺🇸 US Stock Output
## 🇺🇸 [TICKER] — [Company Name]
Price: $XXX.XX | Today: +/-X.XX% | Volume: XM | Market Cap: $X.XBTechnical
RSI: XX.X [signal]
EMA200: $XXX [▲ Above / ▼ Below]
MACD: [🟢 Bullish / 🔴 Bearish]
52W: High $XXX | Low $XXX | Position: XX% Valuation
Forward P/E: XX.Xx (Sector avg: XX-XXx)
PEG Ratio: X.XX
FCF Yield: X.X%
Next Earnings: [Date] Conclusion
[🟢 MUA / 🟡 THEO DÕI / ⏳ CHỜ / 🔴 TRÁNH]
Reason: [1-2 câu]
Entry zone: $XXX – $XXX
💱 Forex Output
## 💱 [PAIR] — Forex Analysis
Price: X.XXXX | Today: +/-X.XX% | Session: [Asian/European/US]Technical
RSI: XX.X | EMA200: X.XXXX [▲/▼]
MACD: [🟢/🔴] | Fibonacci: [key level]
Support: X.XXXX | Resistance: X.XXXX Macro
Rate differential: [FED X.XX% vs ECB/BOJ X.XX%]
DXY: XXX.X [trend]
Key data upcoming: [event + date] Trade Setup
Direction: [🟢 LONG / 🔴 SHORT / 🟡 NEUTRAL]
Entry: X.XXXX | SL: X.XXXX (-XX pips) | TP: X.XXXX (+XX pips)
R:R: 1:X | Lot size (2% risk, $5K account): X.XX lots
🏆 Commodity Output
## 🏆 [COMMODITY] — Analysis
Price: $X,XXX | Today: +/-X.XX%Technical
RSI: XX.X | EMA200: $X,XXX [▲/▼]
Key S/R: $X,XXX / $X,XXX Drivers
[Factor 1: impact]
[Factor 2: impact] Conclusion
[🟢 MUA / 🟡 TRUNG LẬP / 🔴 TRÁNH]
Buy zone: $X,XXX – $X,XXX
📈 ETF Output
## 📈 [ETF] — [Name]
Price: $XXX.XX | YTD: +/-X.XX% | Expense: X.XX% | Yield: X.X%Technical
RSI: XX.X | EMA200: $XXX [▲/▼]
Drawdown từ ATH: -X.X% So sánh
vs S&P 500: [outperform/underperform] XX%
vs category: [ranking] DCA Estimate ($XXX/tháng)
5 năm: ~$XX,XXX (gốc $XX,XXX, lãi ~$XX,XXX)
10 năm: ~$XX,XXX Conclusion
[🟢 DCA / 🟡 CHỜ / 🔴 TRÁNH]
Step 13: Swing Trading (VN)
When user asks about swing trading, scalping, day trading, or short-term trading (2-10 days):
Full reference: references/swing-trading-vn.md
Quick Workflow
1. Screening: Chạy swing screener tìm mã phù hợp
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/scan_market.py --rsi 45 --exchange HOSE
2. Technical check (swing-specific): - RSI divergence (bullish/bearish) trên D1 - MACD crossover position (vùng âm = mua mạnh) - Bollinger squeeze → chờ breakout - ADX > 25 → trend đủ mạnh để swing
3. Entry criteria: - R:R tối thiểu 1:2 (KHÔNG trade nếu < 1:2) - Volume xác nhận (> 1.5x avg 20 phiên) - Stop loss xác định TRƯỚC khi vào lệnh
4. Position sizing: - 2% rule: Max risk 2% vốn per trade - Max 3-5 vị thế swing cùng lúc
Output Format (Swing)
## 🏄 [TICKER] — Swing Analysis
Setup: [RSI Divergence / BB Squeeze / MACD Cross / ...]
Entry: X,XXX VND | Stop Loss: X,XXX (-X%) | Target: X,XXX (+X%)
R:R: 1:X | Position Size: X% vốn (XX CP)
Timeframe: X-X ngày
⚡ Confidence: [Cao/Trung bình/Thấp]
References
VN Market
references/sector-fundamentals.md — Standard P/E, catalyst, risk per VN sectorreferences/sector-update-2026.md — Sector update Q1/2026references/swing-trading-vn.md — Swing trading, scalping VNUS & Global
references/us-equities.md — Top 20 S&P 500, US sector breakdown, P/E benchmarks, ADR/OTCreferences/forex-guide.md — Major/cross pairs, factors, sessions, swap ratesreferences/global-etf.md — VOO/QQQ/SPY comparison, VNM ETF, EM ETFs, Bond ETFs, DCA strategyMacro & Asset-specific
references/macro-update-2026-03.md — Macro context 03/2026: FED, VN-Index, Iran Warreferences/crypto-analysis.md — Crypto/BNB analysis frameworkreferences/gold-analysis.md — Gold XAUUSD analysis frameworkKnowledge Base
references/financial-analysis-knowledge.md — RSI, MACD, P/E, Sharpe, DCA, Global portfolioreferences/advanced-ta.md — Fibonacci, Elliott Wave, Volume Profilereferences/return-estimation.md — Return estimation methodologyScripts
scripts/scan_market.py — Scan VN + US exchanges (HOSE, HNX, NASDAQ, NYSE)scripts/scan_global.py — Scan global markets (US, crypto, forex, commodities)scripts/analyze_stock.py — Deep technical analysis for a single tickerscripts/estimate_returns.py — Estimate returns from historical datascripts/dca_calculator.py — Calculate monthly DCA accumulationscripts/portfolio_optimizer.py — Analyze existing portfolio → rebalance recommendation (Markowitz)scripts/portfolio_screener.py — Scan market → recommend new optimal portfolioDCA Calculator:
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/dca_calculator.py [monthly_vnd] [years]
Example: 2 million VND/month, 10 years
python3 ~/.openclaw/workspace/skills/market-analyst/scripts/dca_calculator.py 2000000 10
*⚠️ Analysis is for reference only, not investment advice. DYOR.*