Cold Start Handling For Newly Listed Instruments 标志

Cold Start Handling For Newly Listed Instruments

社区
HimanshuJ16
cold-start-handling-for-newly-listed-instruments

当某个金融工具的价格历史数据太少、无法据此估算风险时使用,例如 IPO、分拆上市或新代币。此时,滚动波动率窗口可能返回 NaN 或无意义的数值,进而影响头寸规模。

Add to TypingMind

概览

发布者HimanshuJ16
代码仓库Algo-Trading-Skills
技能名称cold-start-handling-for-newly-listed-instruments
星标数
50
复刻数
7
附带文件
5
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 5 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 HimanshuJ16 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Cold Start Handling For Newly Listed Instruments AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/cold-start-handling-for-newly-listed-instruments
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/cold-start-handling-for-newly-listed-instruments .claude/skills/cold-start-handling-for-newly-listed-instruments
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Cold Start Handling For Newly Listed Instruments,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Cold Start Handling For Newly Listed Instruments。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Cold Start Handling For Newly Listed Instruments 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

When to Use

Invoke this skill when an instrument must be sized and risk-managed before it has enough history to estimate from: a recent IPO or direct listing, a spin-off, a newly listed token, a new futures contract month, or a symbol that has just re-listed. A 30-day rolling volatility over 5 observations is not a small-sample estimate of volatility — for i.i.d. normal returns the sample variance from nu = n - 1 degrees of freedom has relative variance 2 / nu, so five days give a variance estimate with roughly 70% relative standard error. Fed to a volatility-scaled or Kelly-style sizer, that noise becomes leverage.

ColdStartHandler answers two questions that are deliberately kept apart:

  1. What volatility should I use? The sample variance is blended toward a peer-group prior with the conjugate weight w = nu / (nu + nu_0), applied to variances. nu_0 ("prior strength") is the prior's weight in units of this instrument's own days.
  2. How much capital may it take? A separate linear ramp, min(1, n_obs / warmup), times your base allocation. This is a risk-appetite policy, not an estimator.

When NOT to Use

  • As a pre-trade risk control. This is a strategy-side sizing input that trusts its own configuration. Where SEC Rule 15c3-5 or an equivalent applies, the hard limits must sit in the broker-dealer's automated pre-trade layer; put this in front of that, never instead of it. See sec-rule-15c3-5-risk-controls-us.
  • When no defensible peer group exists. Shrinking toward an arbitrary prior is worse than declining to trade the name: the output looks confident and is not. A newly listed token with no comparable, or a first-of-its-kind structure, has no prior worth using.
  • When the short history is not the binding constraint. If the instrument cannot be borrowed, has no locate (us-reg-sho-short-sale-locate-requirements), trades in a 10-lot a day, or is still inside its first-day auction, sizing is the wrong lever. See liquidity-adjusted-position-sizing.
  • For the model's features, not its risk inputs. Cold-starting a learned signal for a new symbol is a different problem — see categorical-feature-encoding-for-instrument-identity for identity encoding and transfer-learning-across-correlated-instruments for borrowing a correlated instrument's fitted structure.
  • When the sample is short for a reason other than newness. A halted, suspended, or thinly traded old instrument has a short usable sample but not a cold start; treat stale data as stale, not as young.

Prerequisites

  • A count of usable return observations, not a calendar difference. Listing date minus today over-counts: halts, no-trade sessions and missing bars are not observations. See references/workflows.md.
  • A peer prior that is a single-name volatility, not a sector-ETF volatility. An ETF is diversified; its volatility is systematically below that of its constituents, so using it as the prior shrinks a new listing toward a number no single stock realizes. Use the median (not mean) realized volatility of comparable single names.
  • Sample volatility and prior in the same units — both annualized, or neither. The module cannot detect a units mismatch; it will happily blend a daily sigma with an annualized one.
  • A nu_0 chosen from the prior's own uncertainty, not by feel: for a prior whose estimate of sigma**2 has relative variance v, nu_0 = 2 / v.
  • A warmup window justified by something. Market-structure anchors beat round numbers: IPO lock-up expiry (typically 180 days, contractual), index seasoning (S&P U.S. indices: 12 months on an eligible exchange). See references/standards.md.

Workflow

  1. Count usable observations. Count bars actually present with valid prices. Exclude sessions the instrument was halted for the whole of, and exclude the listing auction itself — the IPO cross is a price discovery event, not a return.
  2. Select the peer group before you need it. Same sector, comparable size, comparable float, and — where relevant — same recency-of-listing cohort. Freeze the selection rule; picking the peer group after seeing the instrument's early prints is a decision made on the data you are trying to shrink.
  3. Refuse rather than default. If no prior is available, do not substitute zero and do not substitute the index. process_instrument raises on a missing or non-positive prior deliberately: a zero prior asserts a riskless instrument, and any volatility-scaled sizer divides by it.
  4. Estimate with process_instrument(symbol, n_obs, observed_volatility, peer_prior_volatility). Below two observations there is no sample variance at all; the observed value is ignored (including if it arrives as NaN) and the prior is returned unchanged, with used_observed_volatility=False recording that.
  5. Size against estimated_volatility, cap against max_position_cap_pct. They are independent controls. Note that the cap is a ceiling, not a target: a volatility-scaled sizer will usually ask for less during probation anyway, and the cap only binds when it does not.
  6. Do not treat graduation as certainty. is_probationary going False means the size cap has reached the base allocation. It does not mean the volatility estimate is unshrunk — with nu_0 = 10, an instrument with 250 observations still carries about 4% prior weight, and that is correct. If you want the prior gone, lower nu_0.
  7. Re-evaluate on every rebalance, not once at onboarding. Both outputs move with n_obs; a cached day-one decision keeps a stale cap for the rest of the ramp.
  8. Watch for the events that reset the argument. Lock-up expiry, index addition, and the first earnings report all change the float and the volatility regime after the instrument has technically graduated. A 30-day warmup that ends before the first lock-up tranche unlocks has measured a float that no longer exists.

Full procedure: see references/workflows.md. Standards and sources: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Blending standard deviations instead of variances. w * sigma_obs + (1 - w) * sigma_peer is not the conjugate posterior and, because the square root is concave, it understates volatility whenever the sample and prior disagree. For a 5-day IPO at sigma_obs = 0.80 against a 0.20 prior, at the same weight w = 4/14, the standard-deviation blend returns 0.37 where the variance blend returns 0.46; the pre-2.0 module returned 0.30, lower still because it also weighted the sample by n / warmup. A risk control should not be biased toward the low side. The standard-deviation blend remains reachable via shrink_in_variance_space=False, for comparison during migration only.
  • 0.0 * float("nan") is nan, not 0.0. The natural "weight the sample by zero when there is no sample" implementation emits NaN into the sizer for exactly the instrument the skill exists for. Absence of a sample has to be a branch, not a weight.
  • Using a sector ETF as the single-name prior. Diversification makes the ETF's volatility structurally lower; every new listing is then shrunk toward a number no constituent realizes, and probation systematically over-sizes.
  • Letting shrinkage end abruptly at the warmup boundary. A weight of n / N says a 29-day estimate is 97% trustworthy and a 30-day estimate is exact. Neither is true, and the jump puts a discontinuity in the sizing of every instrument on its graduation day.
  • Counting calendar days as observations. IPOs halt — LULD trading pauses in the first sessions are routine — and a halted session contributes no return. Calendar counting graduates the instrument early on data it does not have.
  • Treating the first-day price range as volatility. The IPO cross and the first session's price discovery are not draws from the return distribution you are trying to estimate; including them inflates the sample and, once weighted, the blend.
  • Dropping newly listed names entirely for 60 days. The opposite failure: a hard exclusion forgoes post-IPO drift and liquidity-driven opportunity and, worse, hides the onboarding path from testing until the day it silently switches on. Use probation_floor_pct to throttle rather than exclude.
  • Forgetting the borrow side. A newly listed name is frequently hard or impossible to borrow; a shrunk volatility says nothing about whether the short leg is executable.

Verification

  • Run python -m unittest discover -s skills/cold-start-handling-for-newly-listed-instruments/scripts (29 tests), or python tools/run_all_tests.py for the whole repo.
  • Documented example: ColdStartHandler(warmup_period_days=30, prior_strength_days=10.0) with n_obs=5, observed_volatility=0.80, peer_prior_volatility=0.20 returns confidence_weight = 4/14 = 0.2857, estimated_volatility = sqrt((10*0.04 + 4*0.64) / 14) = 0.4598, and max_position_cap_pct = 5/30 = 0.1667.
  • Feed n_obs=0 with observed_volatility=float("nan") and confirm the returned volatility is exactly the peer prior and used_observed_volatility is False.
  • Sweep n_obs from 0 upward and confirm max_position_cap_pct is non-decreasing, never exceeds the base allocation, and reaches it exactly at warmup_period_days.
  • Confirm a zero or NaN peer prior raises rather than returning a zero or NaN volatility.

Related Skills

  • categorical-feature-encoding-for-instrument-identity
  • transfer-learning-across-correlated-instruments
  • dynamic-position-sizing-based-on-realized-volatility
  • liquidity-adjusted-position-sizing
  • instrument-universe-change-detection-and-alerting
  • point-in-time-index-constituent-tracking
  • us-reg-sho-short-sale-locate-requirements
  • new-strategy-onboarding-checklist

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Cold Start Handling For Newly Listed Instruments AI 技能有什么作用?

当某个金融工具的价格历史数据太少、无法据此估算风险时使用,例如 IPO、分拆上市或新代币。此时,滚动波动率窗口可能返回 NaN 或无意义的数值,进而影响头寸规模。

为什么在 TypingMind 中使用 Cold Start Handling For Newly Listed Instruments?

因为您只需安装一次,就能搭配任何模型使用。Cold Start Handling For Newly Listed Instruments 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Cold Start Handling For Newly Listed Instruments?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/cold-start-handling-for-newly-listed-instruments。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Cold Start Handling For Newly Listed Instruments?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Cold Start Handling For Newly Listed Instruments 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Cold Start Handling For Newly Listed Instruments 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Cold Start Handling For Newly Listed Instruments AI 技能免费吗?

是的。HimanshuJ16 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇