Fetch and analyze market data using Alpaca API or MCP server. Use when downloading historical data, checking quotes, working with OHLCV candles, or debugging data issues.
78%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/market-data/SKILL.mdThis skill provides patterns for fetching and managing market data in the wicktrade system.
The Alpaca MCP server is configured and provides direct access to market data tools:
Available MCP Tools:
get_stock_bars - Historical OHLCV dataget_stock_quotes - Real-time quotesget_stock_snapshot - Current market snapshotget_stock_trades - Trade-level dataget_crypto_bars - Crypto historical dataget_crypto_quotes - Crypto quotesis_market_open - Check market statusget_calendar - Trading calendarExample MCP Usage:
Use get_stock_bars to fetch SPY data for the last 30 days at 15Min timeframefrom wicktrade.core.data_manager import DataManager
from datetime import datetime, timedelta
dm = DataManager()
candles = dm.get_candles(
symbol="SPY",
timeframe="15Min",
start=datetime.now() - timedelta(days=30),
)| Timeframe | MCP Arg | Python Arg |
|---|---|---|
| 1 minute | 1Min | "1Min" |
| 5 minutes | 5Min | "5Min" |
| 15 minutes | 15Min | "15Min" |
| 30 minutes | 30Min | "30Min" |
| 1 hour | 1Hour | "1Hour" |
| 4 hours | 4Hour | "4Hour" |
| 1 day | 1Day | "1Day" |
Use get_stock_bars for AAPL with:
- timeframe: 15Min
- start: 2024-01-01
- limit: 1000Use get_stock_quotes for SPY to get current bid/askUse is_market_open to check if trading is availableUse get_calendar to see upcoming market hoursdm = DataManager()
symbols = ["SPY", "QQQ", "AAPL", "MSFT"]
results = dm.download_symbols(symbols, timeframe="15Min")cache_info = dm.get_cache_info()
for info in cache_info:
print(f"{info['symbol']} {info['timeframe']}: {info['rows']} bars")dm.clear_cache(symbol="SPY") # Specific symbol
dm.clear_cache() # All cached data# Check for gaps in data
candles = dm.get_candles("SPY", "15Min")
for i in range(1, len(candles)):
gap = (candles[i].timestamp - candles[i-1].timestamp).total_seconds()
expected = 15 * 60
if gap > expected * 2:
print(f"Gap detected at {candles[i].timestamp}")| Use Case | Recommended Method |
|---|---|
| Quick data check | MCP Server |
| Backtesting | Python DataManager |
| Real-time quotes | MCP Server |
| Bulk historical download | Python DataManager |
| Market status check | MCP Server |
| Cached data access | Python DataManager |
Gillinghammer/wicktrade
17cfc8c
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.