mcpField
T
trade-hypothesis-ideator

trade-hypothesis-ideator

github.com/tradermonty其他3.4k3.3k 次安装2 天前更新
代码仓库

关于 trade-hypothesis-ideator

Trade Hypothesis Ideator 是一项 Python 技能,可将结构化交易观察和证据转为排序后的可证伪假设卡片,适合设计策略实验的交易者。它还可选择将 pursue 评级的想法导出为策略和元数据文件。

主要功能

  1. 01规范化输入并提取证据
  2. 02生成 1 至 5 张假设卡片
  3. 03评议并排序假设
  4. 04包含实验设计和终止条件
  5. 05将 pursue 卡片导出为策略文件

适用场景

  1. 01将日志观察转成可测试想法
  2. 02在投入资金前设计实验
  3. 03排列候选交易假设
  4. 04为策略工作流导出选定想法

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/tradermonty/claude-trading-skills --skill trade-hypothesis-ideator

安装后在 Claude Code 中输入/trade-hypothesis-ideator确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

requirements.txt
examples/
example_input.json
example_output.json
sample_input.json
prompts/
critique_prompt_template.md
developer_prompt_template.md
system_prompt.md
references/
evidence_quality_guide.md
hypothesis_types.md
schemas/
hypothesis_card.schema.json
input_bundle.schema.json
output_bundle.schema.json
raw_hypotheses.schema.json
scripts/
run_hypothesis_ideator.py
scripts/pipeline/
__init__.py
evidence_extractor.py
format_output.py
normalize.py
ranking.py
strategy_exporter.py
scripts/tests/
conftest.py
test_evidence_extractor.py
test_format_output.py
test_guardrails.py
test_normalize.py
test_ranking.py
test_strategy_exporter.py

详细介绍

交易假设构思器

根据标准化的输入包生成 1–5 张结构化假设卡片,对其进行评估和排序,然后可选择将 pursue 卡片导出为 strategy.yaml + metadata.json 工件。

使用场景

  • 收集到可能表明存在潜在优势的交易记录、交易日志条目或市场观察之后
  • 已准备好包含证据片段的结构化输入包(JSON),并希望提出可证伪的假设时
  • 将定性观察转化为定量实验设计
  • 在投入资金验证新的策略构想之前,设定终止标准

前提条件

  • 输入 JSON 包含以下一项或多项:trade_log、journal_snippets、market_data、observations
  • 安装了 pyyaml 的 Python 3.9+
  • 无需外部 API 密钥(纯计算技能)

工作流

  1. 接收输入 JSON 包。
  2. 执行第一轮标准化和证据提取。
  3. 使用以下提示词生成假设:
    • prompts/system_prompt.md
    • prompts/developer_prompt_template.md(注入 {{evidence_summary}})
  4. 使用 prompts/critique_prompt_template.md 评估假设。
  5. 执行第二轮排序、输出格式化和防护检查。
  6. 可选择通过 Step H 策略导出器导出 pursue 假设。

脚本

  • 第一轮(证据摘要):
python3 skills/trade-hypothesis-ideator/scripts/run_hypothesis_ideator.py \
  --input skills/trade-hypothesis-ideator/examples/example_input.json \
  --output-dir reports/
  • 第二轮(排序 + 输出 + 可选导出):
python3 skills/trade-hypothesis-ideator/scripts/run_hypothesis_ideator.py \
  --input skills/trade-hypothesis-ideator/examples/example_input.json \
  --hypotheses reports/raw_hypotheses.json \
  --output-dir reports/ \
  --export-strategies

输出

  • hypothesis_cards_<date>.json — 排序后的假设卡片及其判定(pursue、revise、discard)
  • hypothesis_cards_<date>.md — 包含实验设计和终止标准的易读摘要
  • strategy_<hypothesis_id>.yaml — (可选)适用于 Edge-finder 的策略导出文件,包含 pursue 卡片
  • metadata_<hypothesis_id>.json — (可选)导出策略的来源元数据

资源

  • references/hypothesis_types.md — 假设模式分类(均值回归、动量、事件驱动等)
  • references/evidence_quality_guide.md — 证据强度评级标准和样本量要求

评论

支持 Markdown