strategy-generate
하는 일
이 스킬은 평범한 거래 아이디어를 작동하는 전략으로 바꾸고 과거 데이터로 시험합니다. 백테스트 엔진을 직접 만들지 않고 아이디어를 시험하려는 트레이더를 위한 스킬입니다.
사용하는 경우
- ✓거래 아이디어를 설명하면 시험 가능한 전략으로 바꾸고 싶을 때.
- ✓기존 전략을 바꾸고 결과가 어떻게 달라지는지 보고 싶을 때.
- ✓명확한 지표와 결과에 대한 솔직한 검토가 담긴 백테스트를 원하는 경우.
스킬 링크
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/strategy-generate/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“20일 이동평균이 60일 이동평균을 상향 돌파하면 매수하는 전략을 만들고 Apple에 대해 백테스트해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 전략 설정 파일과 신호 스크립트를 작성하고, 코드의 오류를 점검한 뒤 내장 백테스트를 실행합니다. 그다음 지표를 검토하고, 나쁜 결과도 포함해 결과를 있는 그대로 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Workflow
- Requirements parsing: parse user intent, extract instrument codes, time range, and strategy logic, then write
config.json - Strategy design: think through the 5 questions of data / signal / position sizing / backtest / validation
- Strategy coding: write
code/signal_engine.py(following theSignalEnginecontract) - Syntax check:
bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"") - Run backtest: call the
backtesttool (built into the engine; no need to writerun_backtest.py) - Evaluate results: use the backtest tool's structured metrics, validation and artifact summary. Read
artifacts/metrics.csvor targeted rows withread_run_artifactonly when the requested evidence is missing from that summary. Judge by the review criteria and report failures honestly. - Fix implementation errors: repair code/contract errors and rerun to verify. Poor returns in a correctly implemented strategy are a valid result: report them and stop. Change the strategy or test additional candidates only when the user requested optimization or comparison, within their specified scope. Deeper attribution and robustness research are performed when requested, not added to every backtest.
You only need to write signal_engine.py and config.json. The backtest tool automatically handles data loading and backtest execution.
Adapting a registered strategy
- Read
get_strategy_evidence(strategy_id="sdm:...")for the parent's description and computed regime definitions. A stale, disabled, decayed or inadequately evidenced parent cannot be adapted. - Call
adapt_strategy(strategy_id=..., name=..., universe=..., config=...)with explicit codes and date window. Only name, universe and optional position sizing may change. Signal definition, entry and exit rules remain the parent's. Missing inputs require a question, never a fabricated metric or threshold. - Use the returned assigned
run_dirand seededconfig.json. Generate the child'scode/signal_engine.pyfrom its description using the contract below; never copy a parent run's metrics. Preserve the bound codes, dates andstrategy_adaptationmetadata. Record model provenance through the normal write tool. - Call
backtest(run_dir=...), inspect its artifacts, thenrefresh_strategy_evidence(runs=[{"strategy_id": "sdm:<child>", "run_dir": "<assigned>"}], scope="strategies"). This updates only successful named strategies and preserves the parent's evidence. Refresh refuses a different run or changed config/code/results against the run card. - Read the child's evidence and report its actual quality, cost and decay warnings. A successful backtest is not adequate regime evidence or independent approval. An unchanged mathematical signal can legitimately generate identical code for another universe; hashes establish provenance, not semantic correctness of generated Python.
Requirements Parsing
Extract the following from the user's description:
- Instrument codes: process them according to the normalization rules below
- Time range: if the user does not specify dates, default to 10 years back from today (for example, if today is
2026-03-18, thenstart_date=2016-03-18,end_date=2026-03-18) - Indicator warm-up: a long lookback (MA200, a 252-day z-score) needs bars from before the requested period. Move
start_dateback to load them and declare the boundary withwarmup_bars— the requested period is what gets graded, and undeclared warm-up bars are graded too. Silently backdatingstart_dateby a year turns a 10-year backtest into an 11-year one that still calls itself 10 years: the extra year's trades, CAGR and benchmark all enter the report, the run succeeds, and the numbers look internally consistent - Strategy logic: entry / exit conditions and indicator parameters
If critical information is missing, you must ask the user instead of guessing:
- Instrument not specified → ask which instrument they want to backtest (offer several popular suggestions)
- Strategy description is vague (for example, "help me build a strategy") → provide 2-3 strategy directions for the user to choose from
- Mixed markets but not clearly specified → confirm the data source
Write config.json first, then write code. config.json must be placed in the root of run_dir.
Strategy Design
Before writing code, think through these 5 questions:
- **Data
자주 묻는 질문
백테스트 코드를 직접 써야 하나요?
아닙니다. 스킬은 신호 로직과 설정만 작성하고, 나머지는 백테스트 도구가 처리합니다.
전략이 손실을 내면 어떻게 되나요?
스킬은 이를 솔직하게 보고합니다. 올바르게 만든 전략의 나쁜 수익도 유효한 결과이기 때문입니다.
전략을 최적화할 수 있나요?
가능하지만, 최적화나 비교를 요청했을 때만 그리고 사용자가 정한 범위 안에서만 합니다.
상세 정보
작성자의 원본 설명
Create, modify, and optimize quantitative trading strategies, then backtest and evaluate them.
repo: HKUDS/Vibe-Trading
인기도
- GitHub 스타
- 37k
- 순위
- #7558
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
vibe-trading
37k에이전트에게 백테스트, 팩터 분석, 옵션 가격 결정, 여러 시장의 시장 데이터를 포함하는 완전한 금융 연구 도구 모음을 제공합니다.
adr-hshare
37k에이전트에게 미국 ADR과 홍콩 주식처럼 여러 시장에 상장된 중국 기업의 가격을 비교하는 방법을 보여 줍니다.
akshare
37k에이전트가 API 키 없이 중국과 해외 주식, 선물, 외환, 경제 지표의 무료 시장 데이터를 가져오도록 돕습니다.
alpha-zoo
37k에이전트가 만들어진 주식 팩터 라이브러리를 둘러보고, 선택한 시장에서 팩터 묶음이 수익률을 얼마나 잘 예측하는지 시험하도록 돕습니다.
비슷한 스킬
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
slacrawl
394k에이전트가 로컬 Slack 보관본에서 메시지를 검색하고 개수를 세며, 보관본이 얼마나 최신인지 확인하고 필요할 때 새로 고치도록 돕습니다.
goplaces
394k에이전트가 Google Places로 장소를 검색하고, 세부 정보와 리뷰를 가져오고, 장소 이름을 확인하며, 스크립트용 JSON을 출력하도록 돕습니다.