Chuyển đến nội dung
Skillpedia
Phân tích và bảng tính37k · #7532

minute-analysis

Skill này làm gì

Skill này lấy các nến ngắn hạn, như nến 1 phút hoặc 5 phút, và chạy kiểm thử trong ngày trên chúng. Skill dành cho trader làm việc trong phạm vi một phiên giao dịch.

Khi nào nên dùng

  • ✓Khi bạn muốn xem các thanh giá 5 phút hoặc 1 giờ của một coin crypto hoặc cổ phiếu.
  • ✓Khi bạn muốn kiểm thử một chiến lược trong ngày trên dữ liệu phút quá khứ.
  • ✓Khi bạn cần các chỉ số trong ngày như VWAP hoặc TWAP cho một giao dịch.

Liên kết skill

https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/minute-analysis/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/minute-analysis/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Lấy dữ liệu nến Bitcoin 5 phút của hai tuần gần nhất và kiểm thử một chiến lược đơn giản.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill tải nến từ một nguồn dữ liệu và tính các chỉ báo trong ngày như VWAP. Các nến này cũng có thể đưa vào công cụ backtest khi bạn đặt khoảng thời gian ngắn trong cấu hình.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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 for 5m, and no more than 1 year for 1H

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 1m datasets 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
Câu hỏi thường gặp

Skill hỗ trợ những nguồn dữ liệu nào?

OKX cho crypto, Tushare cho cổ phiếu A của Trung Quốc, và yfinance cho cổ phiếu Hồng Kông và Mỹ.

Có giới hạn số lượng dữ liệu tôi có thể yêu cầu không?

Có. Skill gợi ý tối đa 7 ngày cho dữ liệu 1 phút và tối đa 30 ngày cho dữ liệu 5 phút.

Có cần khóa API không?

OKX và yfinance không cần khóa. Tushare cần một tài khoản có điểm tối thiểu 2000.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
37k
Vị trí xếp hạng
#7532
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự