Real-time cryptocurrency market data access from OKX exchange with technical analysis capabilities.
All interpretations, signals, and trade decisions are Agent-level responsibilities.
MUST load this Skill when:
text
crypto-skill/
├── SKILL.md # This file
├── requirements.txt # Python dependencies
│
├── scripts/
│ ├── cli.py # CLI implementation
│ ├── crypto_data.py # OKX API wrapper
│ └── technical_analysis.py # TA indicator engine
│
└── references/
├── INDICATORS.md # Technical indicator guide
└── STRATEGY.md # Trading strategy guidelines
Always refer to STRATEGY.md every time the user ask for a strategy. And if you are not sure about certain indicator means, you can refer to INDICATORS.md. Both these files are in the references folder.
bash
# Get K-line data
python scripts/cli.py candles BTC-USDT --bar 1H --limit 100
# Get funding rate
python scripts/cli.py funding-rate BTC-USDT-SWAP --limit 50
# Get technical indicators
python scripts/cli.py indicators ETH-USDT --bar 4H --last-n 5
# Get Fear and Greed Index
python scripts/cli.py fear-greed --days 30
bash
python scripts/cli.py candles <inst_id> [--bar BAR] [--limit LIMIT]
ParameterDefaultDescriptioninst_id(required)Trading pair, e.g., "BTC-USDT"--bar1HPeriod: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W--limit100Data count (max 100)
Returns: JSON array with datetime, open, high, low, close, vol
bash
python scripts/cli.py funding-rate <inst_id> [--limit LIMIT]
ParameterDefaultDescriptioninst_id(required)Perpetual contract, e.g., "BTC-USDT-SWAP"--limit100Data count (max 100)
Returns: JSON array with datetime, fundingRate, realizedRate, type
bash
python scripts/cli.py open-interest <inst_id> [--period PERIOD] [--limit LIMIT]
ParameterDefaultDescriptioninst_id(required)Perpetual contract, e.g., "BTC-USDT-SWAP"--period1HGranularity: 5m, 1H, 1D--limit100Data count (max 100)
Returns: JSON array with datetime, oiCcy, oiUsd, type
bash
python scripts/cli.py long-short-ratio <ccy> [--period PERIOD] [--limit LIMIT]
ParameterDefaultDescriptionccy(required)Currency, e.g., "BTC", "ETH"--period1HGranularity: 5m, 1H, 1D--limit100Data count (max 100)
bash
python scripts/cli.py liquidation <inst_id> [--state STATE] [--limit LIMIT]
ParameterDefaultDescriptioninst_id(required)Perpetual contract, e.g., "BTC-USDT-SWAP"--statefilledOrder state: "filled" or "unfilled"--limit100Data count (max 100)
Returns: datetime, side (sell=long liquidated, buy=short liquidated), bkPx, sz
Get the long/short position ratio of elite traders (top 5% by position value).
bash
python scripts/cli.py top-trader-ratio <inst_id> [--period PERIOD] [--limit LIMIT]
ParameterDefaultDescriptioninst_id(required)Perpetual contract, e.g., "BTC-USDT-SWAP"--period5mGranularity: 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D--limit100Data count (max 100)
Returns: JSON array with datetime, longShortPosRatio
Interpretation:
> 1: Top traders hold more long positions< 1: Top traders hold more short positions= 1: Equal long/short positionsbash
python scripts/cli.py option-ratio <ccy> [--period PERIOD] [--limit LIMIT]
ParameterDefaultDescriptionccy(required)Currency, e.g., "BTC", "ETH"--period8HGranularity: 8H or 1D--limit100Data count (max 100)
Returns: JSON array with datetime, oiRatio, volRatio
Interpretation:
oiRatio > 1: More call options held (bullish sentiment)oiRatio < 1: More put options held (bearish sentiment)bash
python scripts/cli.py fear-greed [--days DAYS]
ParameterDefaultDescription--days7Days of history
Returns: JSON array with date, value, value_classification
Interpretation:
0-24: Extreme Fear - Potential buying opportunity25-49: Fear50-74: Greed75-100: Extreme Greed - Potential selling signalGet all technical indicators for a trading pair.
bash
python scripts/cli.py indicators <inst_id> [--bar BAR] [--limit LIMIT] [--last-n N]
ParameterDefaultDescriptioninst_id(required)Trading pair, e.g., "BTC-USDT"--bar1DK-line period--limit100K-lines to fetch (max 100)--last-n10Return only latest N rows (0 = all)
Returns: JSON array with columns:
open, high, low, close, volumema5, ma10rsi14macd_dif, macd_dea, macd_histGet a quick summary of current price and key indicators.
bash
python scripts/cli.py summary <inst_id> [--bar BAR] [--limit LIMIT]
ParameterDefaultDescriptioninst_id(required)Trading pair--bar1DK-line period--limit100K-lines for calculation
Returns: JSON object with asset, indicators, data_summary
bash
python scripts/cli.py support-resistance <inst_id> [--bar BAR] [--limit LIMIT] [--window N]
ParameterDefaultDescriptioninst_id(required)Trading pair--bar1DK-line period--limit100K-lines--window5Window for finding extrema
Returns: JSON object with:
current_pricesupport_levelsresistance_levelsfibonacci_retracementprice_rangeCodeSpotPerpetual ContractBTCBTC-USDTBTC-USDT-SWAPETHETH-USDTETH-USDT-SWAPBNBBNB-USDTBNB-USDT-SWAPZECZEC-USDTZEC-USDT-SWAPSOLSOL-USDTSOL-USDT-SWAPXAU-XAU-USDT-SWAP
bash
# Get BTC 1-hour K-lines
python scripts/cli.py candles BTC-USDT --bar 1H --limit 100
# Get ETH funding rate
python scripts/cli.py funding-rate ETH-USDT-SWAP --limit 50
# Get BTC liquidation data
python scripts/cli.py liquidation BTC-USDT-SWAP --state filled --limit 100
# Get top trader position ratio
python scripts/cli.py top-trader-ratio BTC-USDT-SWAP --period 1H --limit 24
# Get option call/put ratio
python scripts/cli.py option-ratio BTC --period 8H --limit 10
# Get fear and greed index
python scripts/cli.py fear-greed --days 30
# Get technical indicators
python scripts/cli.py indicators BTC-USDT --bar 4H --last-n 5
# Get support and resistance levels
python scripts/cli.py support-resistance ETH-USDT --bar 1D
User SaysExtract As"BTC price", "Bitcoin"inst_id = "BTC-USDT""ETH technical analysis", "Ethereum"inst_id = "ETH-USDT""1-hour timeframe", "hourly chart"bar = "1H""4-hour", "4H"bar = "4H""daily chart", "daily level"bar = "1D""weekly chart"bar = "1W""funding rate", "funding"Use funding-rate with SWAP contract"open interest", "OI"Use open-interest with SWAP contract"long/short ratio"Use long-short-ratio with CCY"elite positions", "whale positions"Use top-trader-ratio with SWAP"option ratio", "call/put"Use option-ratio with CCY"fear and greed", "sentiment index"Use fear-greed
text
┌─────────────────────────────────────────────────────────────┐
│ SKILL.md (You Are Here) │
├─────────────────────────────────────────────────────────────┤
│ 1. scripts/cli.py → Fetch raw market data and caculate indicators│
│ 2. references/INDICATORS.md → Signal interpretation │
│ 3. references/STRATEGY.md → Trade decision policy │
└─────────────────────────────────────────────────────────────┘
Workflow:
python scripts/cli.py <command>indicators commandINDICATORS.md for signal meaningSTRATEGY.md for trade execution rules