minute-analysis
できること
このスキルは、1分足や5分足などの短い間隔のローソク足を取得し、日中のテストを行います。1日の中で取引するトレーダー向けです。
使う場面
- ✓暗号資産や株式の5分足や1時間足の価格バーを見たいとき。
- ✓過去の分足データで、日中の戦略をテストしたいとき。
- ✓取引のためにVWAPやTWAPなどの日中の指標が必要なとき。
スキルのリンク
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/minute-analysis/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“ビットコインの5分足のローソク足を直近2週間分取得し、単純な戦略をテストしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、データソースからローソク足を取得し、VWAPなどの日中の指標を計算します。設定で短い間隔を指定すると、そのローソク足をバックテストのエンジンに渡すこともできます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Minute-Level Data Analysis and Backtesting
Purpose
Retrieve minute-level candlestick data through data-source APIs and calculate intraday indicators (VWAP, TWAP, volume distribution, and more).
Supports minute-level backtesting: set "interval": "5m" in config.json and use the backtest tool to run intraday strategies.
Backtest Configuration
For minute-level backtests, simply add the interval field in config.json:
{
"source": "okx",
"codes": ["BTC-USDT"],
"start_date": "2026-03-01",
"end_date": "2026-03-15",
"interval": "5m",
"initial_cash": 1000000,
"commission": 0.0005
}
- The annualization factor is inferred automatically from
source + interval(OKX 5m = 365 x 288 = 105120) - Minute-level datasets are large. Recommended time limits: no more than 7 days for
1m, no more than 30 days for5m, and no more than 1 year for1H
Supported Data Sources and Intervals
| Data Source | Supported Intervals | Notes |
|---|---|---|
| OKX | 1m/5m/15m/30m/1H/4H | Cryptocurrency, trades 7x24 |
| Tushare | 1m/5m/15m/30m/1H | China A-shares, requires score >= 2000 |
| yfinance | 1m/5m/15m/30m/1H | Hong Kong / US equities (free, no key required) |
OKX Minute Candlestick API
import requests
import pandas as pd
resp = requests.get("https://www.okx.com/api/v5/market/candles", params={
"instId": "BTC-USDT",
"bar": "1m", # 1m/5m/15m/30m/1H/4H
"limit": "300", # At most 300 rows per request
})
data = resp.json()["data"]
columns = ["ts", "open", "high", "low", "close", "vol", "volCcy", "volCcyQuote", "confirm"]
df = pd.DataFrame(reversed(data), columns=columns)
df["ts"] = pd.to_datetime(df["ts"].astype("int64"), unit="ms")
for col in ["open", "high", "low", "close", "vol"]:
df[col] = df[col].astype(float)
Indicator Calculation Templates
VWAP (Volume-Weighted Average Price)
typical_price = (df["high"] + df["low"] + df["close"]) / 3
df["vwap"] = (typical_price * df["vol"]).cumsum() / df["vol"].cumsum()
TWAP (Time-Weighted Average Price)
df["twap"] = df["close"].expanding().mean()
Volume Distribution
df["vol_pct"] = df["vol"] / df["vol"].sum() * 100
hourly_vol = df.set_index("ts").resample("1h")["vol"].sum()
Parameters
| Parameter | Description |
|---|---|
| inst_id | Trading pair, such as "BTC-USDT" |
| bar / interval | Candlestick interval: 1m/5m/15m/30m/1H/4H |
| limit | Number of records to retrieve (OKX returns at most 300 per request) |
Common Pitfalls
- OKX returns at most 300 rows per request. The loader paginates automatically, but
1mdatasets are still very large - The time range for minute-level backtests should not be too long, otherwise both data retrieval and backtesting will become slow or time out
- Tushare minute endpoints require a score >= 2000. If the score is insufficient, the API returns empty data
- Timestamps are Unix timestamps in milliseconds and should be converted with
unit="ms" - Transaction costs for minute strategies should be set lower (for example 0.05% instead of 0.1%) because intraday trading is frequent
Dependencies
pip install pandas numpy requests
よくある質問
どのデータソースに対応していますか?
暗号資産はOKX、中国A株はTushare、香港株と米国株はyfinanceに対応しています。
一度に要求できるデータ量に制限はありますか?
はい。このスキルは、1分足は最大7日、5分足は最大30日を推奨しています。
APIキーが必要ですか?
OKXとyfinanceはキーが不要です。Tushareは、2000以上のスコアを持つアカウントが必要です。
詳細
作者による元の説明
Minute-level data analysis and backtesting. Retrieves minute candlesticks through OKX/Tushare/yfinance and can be used both for analysis and as input to the backtest engine.
repo: HKUDS/Vibe-Trading
人気
- GitHubのスター
- 37k
- ランキング
- #7532
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
vibe-trading
37kバックテスト、ファクター分析、オプション価格、多くの市場にまたがる市場データを含む、金融リサーチの完全なツールキットをエージェントに与えます。
adr-hshare
37k中国企業が複数の市場に上場している価格差、例えば米国のADRと香港株の差を比べる方法をエージェントに示します。
akshare
37kエージェントが、APIキーなしで、中国と世界の株式、先物、外国為替、経済指標の無料の市場データを取得できるよう支援します。
alpha-zoo
37k既製のストックファクターのライブラリを閲覧し、選んだ市場で一群のファクターがリターンをどれだけ予測するかを検証できるよう支援します。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。