[feat] #80 Multi-Timeframe 서비스 레이어 및 HTF 캔들/조합/추세 전략 추가#86
Merged
fray-cloud merged 25 commits intodevfrom Apr 2, 2026
Merged
Conversation
- Prisma: Flow, Backtest, BacktestTrace 모델 추가 - Kafka: FLOW_BACKTEST_REQUESTED/COMPLETED 토픽 + 이벤트 - Types: FlowDefinition, NodeTypeRegistry, Zod-free 검증 스키마 - FlowCompiler: Kahn's algorithm DAG 검증, 위상 정렬, 캔들별 실행 - Nodes: CandleStream, RSI, Threshold, MarketOrder (4개 초기 구현) - Tests: 33개 전체 통과 (컴파일러 검증 14 + 노드 19) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 2: API Server CQRS - Flow CRUD + Toggle + Backtest 요청 9개 REST 엔드포인트 - FlowsKafkaProducer/Consumer — backtest 이벤트 Kafka 연동 - WebSocket backtest:completed 실시간 이벤트 Phase 3: React Flow UI - @xyflow/react 기반 노드 빌더 (드래그&드롭, 포트 타입 검증) - 4종 커스텀 노드 (data/indicator/condition/order) 색상별 구분 - NodePalette, NodeInspector, FlowToolbar, TimelineSlider - Zustand flow store + React Query hooks - /flows 목록 + /flows/[id] 빌더 페이지 Phase 4: Backtest Engine + Timeline Debugger - BacktestService — Kafka consumer, 캔들 페치, flow 실행, trace 저장 - 노드 Glow 효과 (녹색=fired, 빨간색=blocked) - WebSocket 백테스트 완료 리스너 + 자동 trace 로딩 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ariables All flow builder components now use theme-aware CSS variables (bg-card, border-border, text-foreground, text-muted-foreground) instead of hardcoded hex colors (#0f1117, #1a1a24, zinc-*). This fixes light mode rendering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ility Trace state now shows CheckCircle2/XCircle icons alongside green/red glow effects, so color-blind users can distinguish fired vs blocked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…vigation All interactive elements in flow builder now show focus rings for keyboard navigation (WCAG AA compliance). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All flow builder components now use useTranslations('flows')
instead of hardcoded Korean strings. Added 26 new translation
keys to ko.json and en.json.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pace
t('loading', { ns: 'common' }) is not valid next-intl syntax.
Use useTranslations('common') separately. Also add onNodeDoubleClick
handler to prevent unhandled events.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
useFlowStore(backtestStatus) was called after early return, violating React hooks rules. Moved all hooks before conditional return to ensure consistent call order. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Failed backtests store { error: "..." } in summary, not the full
BacktestSummary. Guard winRate/realizedPnl access with null check.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- indicator-macd.node: MACD (macd/signal/histogram 출력) - indicator-bollinger.node: Bollinger Bands (upper/middle/lower 출력) - indicator-ema.node: EMA 지수 이동평균 - condition-crossover.node: 크로스오버 감지 (state 기반, above/below 방향) - condition-and-or.node: AND/OR 로직 조합 노드 - order-alert.node: 알림 전용 터미널 노드 - NODE_REGISTRY에 모든 신규 노드 등록 - determineFired 함수 수정: 다중 출력 인디케이터(MACD, Bollinger) 지원 - FlowsService: 활성 Flow 실시간 평가 루프 (StrategiesService 패턴 적용) - 30초 폴링으로 활성 Flow 동기화 - 캔들 인터벌 기반 평가 주기 자동 설정 - FlowOrderAction → DB Order 생성 → Kafka TRADING_ORDER_REQUESTED 발행 - RiskService 연동 (stopLoss, dailyMaxLoss, maxPositionSize) - 연속 동일 side 주문 중복 방지 - FlowsModule 생성 및 AppModule 등록 - nodes.test.ts: 신규 노드 38개 테스트 케이스 추가 (총 52개 통과) Co-Authored-By: Paperclip <noreply@paperclip.ing>
Replace horizontal-scroll table on mobile (<md) with a card-based layout. Each card shows symbol, direction (buy/sell), qty, price, and status. Two tabs split orders into Open (pending/placed) and Completed. Desktop table (≥md) is unchanged. Adds openOrders / closedOrders translation keys to en.json and ko.json. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Add VaR/CVaR, dynamic drawdown limits, ATR-based volatility sizing, Kelly Criterion position sizing, tail risk monitoring, and cross-symbol correlation matrix to RiskService. - Extend RiskConfig and RiskCheckResult with new fields - Add checkDrawdownLimit: pause strategy after X% drawdown from peak - Add checkVarAndCVar: historical simulation VaR/CVaR checks - Add applyAtrSizing: scale down position size when ATR > baseline - Add applyKellySizing: win-rate-based half-Kelly position sizing - Add getCorrelationMatrix: Pearson correlation across symbols - Propagate adjustedQuantity through AutoTradeSaga RiskCheckStep - 30 unit tests covering all new risk checks (all passing) Co-Authored-By: Paperclip <noreply@paperclip.ing>
Add card view to the Portfolio assets section showing coin, current price, holdings, valuation, and P&L with % color-coded. Toggle between card/table view with LayoutGrid/LayoutList buttons. Card view is the default. Co-Authored-By: Paperclip <noreply@paperclip.ing>
BacktestingModule was imported in app.module.ts but the source files were never committed, causing TS2307 build errors in CI. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Migration 20260401000000_add_candle_table created the table but the model definition was never added to schema.prisma. Adds Candle model with all fields matching the migration, fixing TS2339 errors in backtesting/data.service.ts. Co-Authored-By: Paperclip <noreply@paperclip.ing>
… onboarding, risk dialog - Add CSS @Keyframes flash-up/flash-down animations to globals.css - Refactor TickerTable to use TickerRow component with per-row price flash animation on WebSocket updates; add onRowClick prop - Wire QuickOrderPanel into Markets page — clicking a ticker row opens the slide-in order panel - Add OnboardingWizard to root layout so new users see the 5-step wizard on first login - Add real-trading risk confirmation dialog (Dialog component) to QuickOrderPanel and OrderForm when switching from paper to real mode - Add i18n keys (en/ko) for the confirmation dialog Closes PRO-38 P1 items Co-Authored-By: Paperclip <noreply@paperclip.ing>
…feed RT, tooltip + terminology - Strategy card: add live status badge (대기/신호감지/주문실행/리스크차단/오류) and realized PnL using new useStrategyRuntime hook (polls last log + performance API at 30s/60s) - Notification feed: pipe WebSocket notification:received events to feed store so the bell panel populates in real time (previously only toasts were shown) - Tooltip component: new /ui/tooltip.tsx — CSS-only hover tooltip, no new deps - Terminology: en.json updated with plain-language labels (Signal-only, Auto-execute, Simulation, Live Trading) + tooltip copy; strategy card now renders these via i18n with cursor-help tooltips on mode/tradingMode badges Co-Authored-By: Paperclip <noreply@paperclip.ing>
… rules - Add GitHub Issue/Milestone sync rules per board direction (PRO-56) - Clarify that feature PRs must be opened by developers, not team leads - Document Paperclip Approval flow for dev → main release PRs Co-Authored-By: Paperclip <noreply@paperclip.ing>
…ion-feed, and .gitignore update (PRO-69) These files were present on disk but never tracked — discovered during feat/#53 branch cleanup. - apps/worker-service: add combination, multi-timeframe, and trend-regime indicator strategies with tests - packages/database/prisma/migrations/20260401000000_add_candle_table: add migration for Candle table (pairs with existing schema.prisma Candle model fix) - apps/web: add notification-feed component and use-notification-feed-store (referenced in feat(web) P2 sprint commit but not staged) - .gitignore: broaden tmp/ rule from tmp/test-results/ to tmp/ to suppress screenshot artifacts Co-Authored-By: Paperclip <noreply@paperclip.ing>
…gister combination/trend-regime strategies (PRO-72) - strategy.interface.ts: add CandleOHLCV and MultiTimeframeData types - ITradingStrategy.evaluate(): add optional candles? and multiTimeframe? params - strategies.service.ts: register CombinationStrategy and TrendRegimeStrategy in strategyMap Co-Authored-By: Paperclip <noreply@paperclip.ing>
…eStrategy + HTF candle fetch (PRO-73) - Register MultiTimeframeStrategy in strategyMap - Add getCandleOHLCV() to fetch full OHLCV data (needed for volume/ATR) - evaluateStrategy fetches htf1/htf2 close prices and primary OHLCV for multi-timeframe type - HTF intervals configurable via strategy.config.htf1Interval/htf2Interval (defaults: 4h/1d) - Redis caching reused for HTF candles using existing CANDLE_CACHE_TTL (4h→1800s, 1d→3600s) - DB migration (add_candle_table) already present in feat/#48 Co-Authored-By: Paperclip <noreply@paperclip.ing>
…mbiguity - Add vi.mock for next-intl useTranslations (missing context error) - Add vi.mock for useStrategyRuntime with correct StrategyRuntime shape (realizedPnl: null) - Add vi.mock for @/components/icons to avoid icon rendering issues - Fix 'displays exchange/symbol' assertion to use getAllByText (multiple matches) All 49 web unit tests now pass. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Contributor
There was a problem hiding this comment.
Sorry @fray-cloud, your pull request is larger than the review limit of 150000 diff characters
…l UI/type files All conflicts involved frontend flow builder files and shared types where dev has newer, more complete versions. feat/#73's core Multi-TF backend work (MultiTimeframeStrategyService, HTF candle fetch) has no conflicts. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
MultiTimeframeStrategyService등록 및 HTF 캔들 fetch 로직 구현 (PRO-73)CandleOHLCV/MultiTimeframeData타입 정의CombinationStrategy,TrendRegimeStrategy등록 (PRO-72)strategy-card테스트 픽스 — 누락 mock 및 getByText 모호성 해결관련 이슈
Closes #80
테스트 방법
cd apps/worker-service && pnpm test실행 후 MultiTimeframe 관련 테스트 통과 확인참고
Co-Authored-By: Paperclip noreply@paperclip.ing