本文へ移動
cccskills
無料GitHub で公開

minute-analysis

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.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md3.4 KB
  • example_signal_engine.py4.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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 SourceSupported IntervalsNotes
OKX1m/5m/15m/30m/1H/4HCryptocurrency, trades 7x24
Tushare1m/5m/15m/30m/1HChina A-shares, requires score >= 2000
yfinance1m/5m/15m/30m/1HHong 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

ParameterDescription
inst_idTrading pair, such as "BTC-USDT"
bar / intervalCandlestick interval: 1m/5m/15m/30m/1H/4H
limitNumber 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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

akshare

無料

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

alpha-zoo

無料

Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

A 股 ST/*ST 风险预测框架 — 基于最新中报/三季报或业绩预告/快报,预测下一财年是否会因营收、利润、净资产、分红不达标而被风险警示,并将新浪监管处罚记录作为独立证据面纳入风险等级。仅适用于 A 股,不预测财务造假。

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 5 optimizers and rebalancing rules.

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

日本語の概要は準備中です。原文の説明を表示しています。

HKUDS/Vibe-Trading3.5万2026年10月12日 更新

HKUDS のスキルをすべて見る

このスキルの問題を報告する