🤖 Quant Trading Machine Bot
한국투자증권 API 기반 지능형 자동매매 시스템
🌟 한국어 소개
🎯 프로그램 특징
정밀한 호가 기반 거래 시스템
- KRX 정규장(09:00-15:20)과 NXT 애프터마켓(15:30-20:00) 시간대별 최적화
- 실시간 10단계 호가창 분석으로 최적의 진입/청산 타이밍 포착
- 3호가 이내 조건부 주문, 6호가 이탈 시 자동 취소 등 정교한 거래 규칙
지능형 손절 시스템
- 목표 손절가 위쪽 2호가 이내 위험구간 실시간 모니터링
- 호가잔량이 보유수량의 2배 이하 시 즉시 시장가 매도
- 5단계 위험도 분석으로 선제적 리스크 관리
텔레그램 통합 관제 시스템
- 실시간 매수/매도/손절 알림
- 포트폴리오 현황 및 수익률 모니터링
- 간단한 명령어로 거래 시작/수정/종료 제어
🛠 기반 기술
Backend Architecture
- Go 1.24.3 - 고성능 동시성 처리
- Oracle Autonomous Database - 안정적인 거래 데이터 관리
- 한국투자증권 OpenAPI - 실시간 주식 거래 및 시세 조회
핵심 기술 스택
- 고루틴 기반 멀티스레딩으로 실시간 모니터링
- JWT 토큰 자동 갱신 및 영속화
- API 호출 에러 복구 및 재시도 로직
- 메모리 캐시와 DB 동기화를 통한 데이터 일관성
📱 텔레그램 명령어 예시
💬 거래 시작
/start 005930 70000 65000 75000
→ 삼성전자를 70,000원에 매수, 65,000원 손절, 75,000원 매도
💬 실시간 현황 조회
/status
→ 현재 보유 종목, 수익률, 미체결 주문 상태 확인
💬 종목 상세 분석
/analysis 005930
→ 호가창 분석, 매수/매도 조건, 손절 위험도 실시간 확인
💬 거래 조건 수정
/modify 005930 71000 66000 76000
→ 기존 거래의 목표가 즉시 변경
💬 거래 종료
/end 005930
→ 보유 주식 시장가 매도 후 거래 완전 종료
🎉 실제 거래 알림 예시
📈 매수주문
005930 삼성전자
주문수량: 10주
매수가: 70,000원
✅ 매수완료
005930 삼성전자
매수수량: 10주
금액: 700,000원
평균가: 70,000원
📉 매도주문
005930 삼성전자
주문수량: 10주
매도가: 75,000원
✅ 매도완료
005930 삼성전자
매도수량: 10주
금액: 750,000원
📈(7.14%)
🌟 English Introduction
🎯 Key Features
Precision Quote-Based Trading System
- Optimized for KRX regular hours (09:00-15:20) and NXT after-market (15:30-20:00)
- Real-time 10-level order book analysis for optimal entry/exit timing
- Sophisticated trading rules: conditional orders within 3 ticks, auto-cancel beyond 6 ticks
Intelligent Stop-Loss System
- Real-time monitoring of danger zone within 2 ticks above target stop-loss
- Immediate market sell when order book quantity ≤ 2x holding quantity
- 5-level risk analysis for proactive risk management
Telegram Integrated Control Center
- Real-time buy/sell/stop-loss notifications
- Portfolio status and P&L monitoring
- Simple commands for trade start/modify/end control
🛠 Technology Stack
Backend Architecture
- Go 1.24.3 - High-performance concurrent processing
- Oracle Autonomous Database - Reliable trading data management
- Korea Investment Securities OpenAPI - Real-time stock trading and market data
Core Technologies
- Goroutine-based multithreading for real-time monitoring
- JWT token auto-renewal and persistence
- API call error recovery and retry logic
- Memory cache and DB synchronization for data consistency
📱 Telegram Command Examples
💬 Start Trading
/start 005930 70000 65000 75000
→ Buy Samsung Electronics at ₩70,000, stop-loss ₩65,000, sell ₩75,000
💬 Real-time Status
/status
→ Check current holdings, P&L, pending orders
💬 Detailed Analysis
/analysis 005930
→ Real-time order book analysis, buy/sell conditions, stop-loss risk
💬 Modify Trading Conditions
/modify 005930 71000 66000 76000
→ Instantly update target prices for existing trade
💬 End Trading
/end 005930
→ Market sell holdings and completely close position
🎉 Live Trading Notification Examples
📈 Buy Order
005930 Samsung Electronics
Order Quantity: 10 shares
Buy Price: ₩70,000
✅ Buy Completed
005930 Samsung Electronics
Bought: 10 shares
Amount: ₩700,000
Average Price: ₩70,000
📉 Sell Order
005930 Samsung Electronics
Order Quantity: 10 shares
Sell Price: ₩75,000
✅ Sell Completed
005930 Samsung Electronics
Sold: 10 shares
Amount: ₩750,000
📈(+7.14% profit)
🎥 데모 영상 / Demo Video
실제 거래 화면을 확인해보세요!
👉 YouTube 데모 영상 보기
See the actual trading interface in action!
👉 Watch YouTube Demo
🚀 핵심 경쟁력 / Competitive Advantages
한국어
- 실전 검증된 로직: 한국 주식시장의 특성을 반영한 호가 기반 거래 알고리즘
- 완전 자동화: 설정 후 사용자 개입 없이 24시간 무인 거래
- 리스크 관리: 정교한 손절 시스템으로 손실 최소화
- 사용자 친화적: 복잡한 설정 없이 텔레그램으로 간단 제어
English
- Market-Tested Logic: Quote-based trading algorithms tailored for Korean stock market
- Full Automation: 24/7 unattended trading after initial setup
- Risk Management: Sophisticated stop-loss system minimizes losses
- User-Friendly: Simple Telegram control without complex configurations
⚠️ 면책사항 / Disclaimer
본 프로그램은 교육 및 연구 목적으로 제작되었습니다. 실제 투자 시 발생하는 손실에 대해서는 사용자가 전적으로 책임을 지며, 개발자는 어떠한 책임도 지지 않습니다.
This program is created for educational and research purposes. Users are solely responsible for any losses incurred during actual trading, and the developer assumes no liability.