본문으로 건너뛰기

지원 전략

config/strategies/equity/ 디렉토리에 정의된 11개 빌트인 전략입니다. 모든 전략은 YAML 정의 + StrategyAgent 평가 방식으로 동작하며, 사용자가 자체 전략을 추가할 수 있습니다.

카탈로그 (요약)

ID한글명영문명카테고리priority시장국면자산군
bull_trend默认多头趋势Bull Trendtrend10 (default)trending_upus / kr
ma_golden_cross均线金叉MA Golden Crosstrend20trending_upus / kr
volume_breakout放量突破Volume Breakouttrend30trending_upus / kr
shrink_pullback缩量回踩Shrink Pullbacktrend40 (default)trending_down/sidewaysus / kr
box_oscillation箱体震荡Box Oscillationframework50sidewaysus / kr
bottom_volume底部放量Bottom Volume Surgereversal60trending_downus / kr
chan_theory缠论Chan Theoryframework70volatileus / kr
wave_theory波浪理论Elliott Waveframework80volatileus / kr
dragon_head龙头策略Dragon Headtrend90sector_hotus / kr
emotion_cycle情绪周期Sentiment Cycleframework100sector_hotus / kr
one_yang_three_yin一阳夹三阴One Yang Three Yinpattern110us / kr

default_priority가 낮을수록 먼저 평가됩니다 (가장 신뢰도 높음).

카테고리

카테고리설명
trend추세 추종 (모멘텀, 상승 채널, 골든크로스 등)
reversal반전 (저점 매수, 패닉 셀링 후 회복)
framework거래 프레임워크 (전체적 시장 분석 — 缠论 / 波浪 / 박스 등)
patternK-line 패턴 (一阳三阴 등 형태 인식)

전략별 상세

1. bull_trend — 默认多头趋势 (Bull Trend)

기본 추세 추종 전략. MA 정배열 + 趋势上昇 + 회사 펀더멘털 검증.

  • Required tools: get_ohlcv, calc_ma
  • Core rules: 1 (推荐), 2 (趋势), 3 (效率)
  • 출력: 진입가, SL, TP, 신뢰도

2. ma_golden_cross — 均线金叉

MA5 > MA10 (또는 MA10 > MA20) 골든크로스 + 거래량 확인.

  • Required tools: get_ohlcv, calc_ma, detect_golden_cross
  • 신호 강도: MA5/MA10 (단기) < MA10/MA20 (장기)

3. volume_breakout — 放量突破

저항선 돌파 + 거래량 평소 대비 2배 이상.

  • Required tools: get_ohlcv, get_quote, calc_volume_profile

4. shrink_pullback — 缩量回踩

상승 추세 중 MA5/MA10에 거래량 축소되며 되돌림 → 진입.

  • Default router: true (자동 라우팅)
  • 시장 국면: trending_down 또는 sideways

5. box_oscillation — 箱体震荡

박스권 횡보. 박스 하단 매수 + 박스 상단 매도.

  • Required tools: get_ohlcv, get_quote, calc_volume_profile
  • 시장 국면: sideways

6. bottom_volume — 底部放量

장기 하락 후 저점에서 거래량 폭증 → 반전 후보.

  • 하락폭 조건: 20일 고점 대비 -15% 이상
  • 시장 국면: trending_down

7. chan_theory — 缠论 (Chan / Zen Channel Theory)

분형 → 笔 → 선분 → 中枢 → 추세의 5단계 분석.

  • 카테고리: framework (다른 전략과 결합 가능)

8. wave_theory — 波浪理论 (Elliott Wave)

5파 추진 + 3파 조정 구조 분석.

9. dragon_head — 龙头策略

섹터 로테이션 시 선도주 식별. 섹터 핫 시점에 활용.

  • 시장 국면: sector_hot

10. emotion_cycle — 情绪周期

시장 정서 (공포 → 비관 → 의심 → 희망 → 낙관 → 흥분 → 탐욕 → 광기) 사이클 기반 역정서 진입.

11. one_yang_three_yin — 一阳夹三阴

K-line 패턴: 큰 양봉 → 3개 작은 음봉/소형봉 → 양봉 돌파.

YAML 구조

name: ma_golden_cross
display_name: 均线金叉
display_name_en: MA Golden Cross
description: ...
category: trend
core_rules: [1, 2, 3] # 핵심 트레이딩 룰 ID
required_tools:
- get_ohlcv
- calc_ma
- detect_golden_cross
aliases: [均线金叉, 금차]
default_priority: 20
default_active: true # 자동 활성화 여부
default_router: false # 자동 라우팅 여부
market_regimes: [trending_up]
applicable_asset_classes:
- us_equity
- kr_equity

instructions: |
자세한 평가 로직 (LLM 프롬프트로 사용)

출력 스키마 (StrategyAgent 공통)

{
"signal": "buy",
"confidence": 0.72,
"reasoning": "MA5/MA10 골든크로스 + 거래량 1.4x...",
"entry_price": 188.20,
"stop_loss": 179.00,
"take_profit": 205.00,
"qty_suggestion": 5,
"currency": "USD",
"raw": { /* 전체 LLM 출력 */ }
}

각 전략은 동일한 스키마로 출력하며, 결정 에이전트 (DecisionAgent)가 가중 평균으로 최종 결정 (decision_output)을 합성합니다.

자체 전략 추가

config/strategies/equity/ 디렉토리에 YAML 한 개 추가하면 자동 로드됩니다.

자세한 흐름은 튜토리얼: 자체 전략 추가 참조.

백테스트

전략을 백테스트로 검증:

curl -X POST http://localhost:8000/api/equity/backtest \
-H "Authorization: Bearer $JWT" \
-d '{
"asset_class": "us_equity",
"symbol": "AAPL",
"strategy_name": "ma_golden_cross",
"start_date": "2023-01-01",
"end_date": "2024-12-31",
"initial_capital": 10000.0
}'

자세한 내용은 API: equity-backtest 참조.

RL 전략

RL (Stable-Baselines3 PPO/DQN) 전략은 별도 트랙. models/에 저장된 체크포인트를 로드하며, YAML 전략과 결합해 ensemble 가능합니다 (Phase 7+).