Agent skill

Volatility Percentile Strategy

by HKUDS in HKUDS/Vibe-Trading

Mean-reversion signal engine that ranks historical volatility against its own recent history, going long in quiet regimes and exiting or shorting when volatility is high.

MITAuto-check passedBusiness, Finance & HR

Install Volatility Percentile Strategy

skills CLI
$ npx skills add HKUDS/Vibe-Trading --skill volatility -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HKUDS/Vibe-Trading volatility --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/volatility .claude/skills/volatility && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
volatility
GitHub stars
35k
Token cost
~528 tokens
SKILL.md length
222 words
Files
2
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Mean-reversion signal engine that ranks historical volatility against its own recent history, going long in quiet regimes and exiting or shorting when volatility is high.

  • Works in 3 steps: Compute HV: annualized standard… → Percentile ranking: percentile position… → Signal generation
  • Backtesting a volatility mean-reversion strategy on OHLCV data
  • SKILL.md covers Purpose, Signal Logic, Key Implementation Details and Parameters, plus 3 more sections
  • Runs Python scripts from its folder; calls pip

What it does

This skill computes historical volatility as the annualized standard deviation of returns over a rolling window, then ranks it as a percentile of its own recent history. When the percentile falls below a low threshold the signal is long, expecting volatility to expand. Above a high threshold it exits or goes short, expecting contraction, and in between it keeps the current position.

Parameters have defaults: a 20-day volatility window, a 120-day lookback for the percentile, low and high percentile thresholds of 20.0 and 80.0 and an annualization factor of 252, with 365 for cryptocurrencies that trade around the clock. Until the lookback fills, the signal stays at 0. The notes remind you that low volatility says nothing about direction. Signals are 1, -1 or 0, and an example signal engine is included.

When your agent uses it

  • Backtesting a volatility mean-reversion strategy on OHLCV data
  • Turning historical volatility percentiles into long or flat signals
  • Adjusting the annualization factor for a crypto instrument

Example prompts

  • “Backtest the volatility percentile strategy on data/spy_daily.csv with the default settings.”
  • “Use a 365-day annualization for my BTC data and rerun the volatility signals.”
  • “Why does the signal stay at zero for the first part of the series?”

Requirements

  • Python with `pandas` and `numpy`

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Compute HV: annualized standard deviation of returns over the past hv_window days
  2. Percentile ranking: percentile position of HV within the past lookback days (0-100)
  3. Signal generation

What it can do on your machine

Read from SKILL.md and the folder at commit 7f6908b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Volatility Percentile Strategy loads about 528 tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 222 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~35
When it runs · the whole SKILL.md, loaded when a task matches
~528

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HKUDS/Vibe-Trading at commit 7f6908b, republished under its MIT licence (© HKUDS). 222 words, ~528 tokens.

Download SKILL.mdSave it as .claude/skills/volatility/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
volatility
description
Volatility strategy. Trades mean reversion based on percentile ranking of historical volatility (HV). Suitable for any OHLCV data.
category
strategy

Volatility Strategy

Purpose

Uses percentile ranking of historical volatility (HV) to capture volatility mean reversion: build positions in low-volatility regimes while waiting for volatility expansion, and exit or short in high-volatility regimes to capture contraction.

Signal Logic

  1. Compute HV: annualized standard deviation of returns over the past hv_window days
  2. Percentile ranking: percentile position of HV within the past lookback days (0-100)
  3. Signal generation:
    • Percentile < low_pct → go long (volatility is low, waiting for expansion)
    • Percentile > high_pct → exit / go short (volatility is high, waiting for contraction)
    • Middle region → keep the current position

Key Implementation Details

  • HV = returns.rolling(hv_window).std() * sqrt(252) (annualized)
  • Percentile = hv.rolling(lookback).rank(pct=True) * 100
  • For cryptocurrencies, use 365 instead of 252 as the annualization factor

Parameters

ParameterDefaultDescription
hv_window20Historical volatility calculation window
lookback120Lookback period for percentile ranking
low_pct20.0Low-volatility threshold (percentile)
high_pct80.0High-volatility threshold (percentile)
annualize252Annualization factor (252 for China A-shares, 365 for crypto)

Common Pitfalls

  • Before the lookback window is filled, there is not enough data to compute percentiles, so the signal should be 0 (fillna)
  • Volatility is not direction. Going long in low-volatility regimes does not guarantee price appreciation; it only means volatility expansion is statistically more likely
  • Cryptocurrencies trade 7x24, so annualize should be set to 365

Dependencies

bash
pip install pandas numpy

Signal Convention

  • 1 = long (low-volatility regime), -1 = short (high-volatility regime), 0 = stand aside

© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in agent/src/skills/volatility of HKUDS/Vibe-Trading.

  • SKILL.md
  • example_signal_engine.py

Open the folder on GitHubat commit 7f6908b

Compare with similar skills

Volatility Percentile Strategy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Volatility Percentile Strategy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Volatility Percentile Strategy this skillHKUDS/Vibe-Trading35k—~528Automated safety check: PassMIT
Tushare Datazillionare/zillionare3182 repos~2.3kAutomated safety check: PassNone
Quant Blog Writingzillionare/zillionare318—~895Automated safety check: PassNone
Vectorbtagiprolabs/claude-trading-skills410—~2.6kAutomated safety check: PassMIT
Quant Analystmajiayu000/claude-skill-registry6661 repos~964Automated safety check: PassMIT
Backtestinggauss314/skills245—~2.4kAutomated safety check: PassMIT

Similar skills

  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    318 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Quant Blog Writing

    zillionare/zillionare

    撰写文笔精炼、富有深度的量化交易博文,论点清晰、证据确凿、叙事层次更加丰富。适用于量化交易博文、因子研究、回测复盘、数据源排查、市场微观结构、策略原理、风险控制、职业观察、量化人物故事等选题。文章将聚焦具体角度,提供详实的大纲、证据规划及成稿,力求内容兼具思想深度与诚实性,而非单纯口号式宣传;同时,通过人物经历、引言、贡献及行业背景的融入,让文章更具可读性和吸引力。

    318 GitHub stars~895 tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Vectorbt

    agiprolabs/claude-trading-skills

    High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics

    410 GitHub stars~2.6k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Quant Analyst

    majiayu000/claude-skill-registry

    Expert in quantitative finance, algorithmic trading, and financial data analysis using Python (Pandas/NumPy), statistical modeling, and machine learning.

    666 GitHub starsUsed in 1 repo~964 tokens
    Data & AnalyticsAuto-check passed
  • Backtesting

    gauss314/skills

    Academic backtesting framework for quantitative research. An agent skill from gauss314/skills.

    245 GitHub stars~2.4k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed
  • Option Pricing

    gauss314/skills

    Pricing completo de opciones europeas y americanas. An agent skill from gauss314/skills.

    245 GitHub stars~4.7k tokensUpdated 3 mo ago
    Business, Finance & HRAuto-check passed

More from HKUDS/Vibe-Trading

All 89 skills in this repo
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • OKX Market Data

    HKUDS/Vibe-Trading

    Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.

    35k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • SEC EDGAR Filings Fetcher

    HKUDS/Vibe-Trading

    Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.

    35k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • A-Share ST Risk Screener

    HKUDS/Vibe-Trading

    Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.

    35k GitHub stars~4.9k tokensUpdated yesterday
    Auto-check passed
  • Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.

    35k GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.

    35k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Volatility Percentile Strategy

What does Volatility Percentile Strategy do?

Mean-reversion signal engine that ranks historical volatility against its own recent history, going long in quiet regimes and exiting or shorting when volatility is high. This skill computes historical volatility as the annualized standard deviation of returns over a rolling window, then ranks it as a percentile of its own recent history. When the percentile falls below a low threshold the signal is long, expecting volatility to expand.

When should I use Volatility Percentile Strategy?

Volatility Percentile Strategy fits situations like: backtesting a volatility mean-reversion strategy on OHLCV data; turning historical volatility percentiles into long or flat signals; adjusting the annualization factor for a crypto instrument.

How do I install Volatility Percentile Strategy in Claude Code?

Run `npx skills add HKUDS/Vibe-Trading --skill volatility -a claude-code`. Or copy the skill folder (agent/src/skills/volatility in HKUDS/Vibe-Trading) into .claude/skills/volatility in your project. Claude Code loads it when a task matches its description.

How do I install Volatility Percentile Strategy in Codex?

Run `npx skills add HKUDS/Vibe-Trading --skill volatility -a codex`. Or copy the skill folder (agent/src/skills/volatility in HKUDS/Vibe-Trading) into .agents/skills/volatility in your project. Codex loads it when a task matches its description.

Can I use Volatility Percentile Strategy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill volatility -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/volatility, .gemini/skills/volatility, .github/skills/volatility and .opencode/skills/volatility in your project.

What does Volatility Percentile Strategy need to run?

Going by SKILL.md and its folder, Volatility Percentile Strategy needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: Python with `pandas` and `numpy`.

Does Volatility Percentile Strategy access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Volatility Percentile Strategy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Volatility Percentile Strategy use?

Volatility Percentile Strategy is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Volatility Percentile Strategy use?

About 528 tokens (SKILL.md is roughly 2.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Volatility Percentile Strategy?

Skills that share tags, products or a category with Volatility Percentile Strategy: Tushare Data (zillionare/zillionare, 318 stars), Quant Blog Writing (zillionare/zillionare, 318 stars), Vectorbt (agiprolabs/claude-trading-skills, 410 stars) and Quant Analyst (majiayu000/claude-skill-registry, 666 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Volatility Percentile Strategy?

HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 34,884 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 6, 2026.

Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.