WLD DeepCoin 단계별 구조 재편 및 설정·문서 통합
로고스/루트 레거시를 제거하고 deepcoin 패키지·scripts 01~05 CLI·docs/reference로 데이터·GT·분석·매칭·운영 단계를 정리했다. config와 .env 기반 설정, trade_anaysis.html 동기화 포함. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
104
README.md
104
README.md
@@ -1,64 +1,86 @@
|
||||
# DeepCoin — WLD 전봉 BB·일목 조합 매매
|
||||
# DeepCoin — WLD MTF 분석·정답·운영
|
||||
|
||||
빗썸 KRW-WLD 현물. **1, 3, 5, 10, 15, 30, 60, 240, 1440분** 모든 봉에서
|
||||
볼린저 밴드·일목균형표 **캔들 위치**를 분석하고, 봉 조합으로 매수·매도 규칙을 탐색합니다.
|
||||
빗썸 KRW-WLD. **1, 3, 5, 10, 15, 30, 60, 240, 1440분** 봉을 적재하고,
|
||||
Ground Truth·기술적 분석·(예정) 규칙 매칭·1분 모니터까지 **단계별 폴더**로 관리합니다.
|
||||
|
||||
## 구조
|
||||
## 로드맵
|
||||
|
||||
| 단계 | 목적 | 실행 |
|
||||
|------|------|------|
|
||||
| 01 데이터 | 1년치 봉 적재 | `python scripts/01_download.py` |
|
||||
| 02 Ground Truth | 매수·매도 정답 타점 | `python scripts/02_ground_truth.py` |
|
||||
| 03 분석 | 8TF 기술 지표 enrich | `python scripts/03_analyze_enrich.py` |
|
||||
| 03b 분석 | GT 타점 MTF 스냅샷 | `python scripts/03_analyze_trades.py` |
|
||||
| 04 매칭 | GT 근접 규칙 선택 (예정) | `python scripts/04_match_rules.py` |
|
||||
| 05 운영 | 차트·1분 모니터 | `scripts/05_chart_*.py`, `05_run_monitor.py` |
|
||||
|
||||
상세: [docs/reference/ROADMAP.md](docs/reference/ROADMAP.md)
|
||||
|
||||
## 디렉터리 구조
|
||||
|
||||
```text
|
||||
downloader.py → coins.db (전 간격 증분)
|
||||
indicators.py → BB·일목 계산
|
||||
candle_features.py → 봉별 위치 특징 → 3분 타임라인 행렬
|
||||
combination_analyzer.py → 조합 분석·combination_report.json
|
||||
rule_discovery.py → discovered_rules.json
|
||||
strategy.py → 실시간 evaluate_discovered_live
|
||||
monitor_coin.py → 실거래 루프
|
||||
simulation.py → 백테스트·HTML 차트
|
||||
DeepCoin/
|
||||
├── .env, config.py
|
||||
├── scripts/ # ★ 단계별 CLI (유일한 진입점)
|
||||
├── deepcoin/
|
||||
│ ├── api/bithumb.py # 빗썸 API
|
||||
│ ├── data/ # 01 다운로드
|
||||
│ ├── ground_truth/ # 02 정답 타점
|
||||
│ ├── analysis/ # 03·03b 지표·스냅샷
|
||||
│ ├── matching/ # 04 규칙 매칭 (예정)
|
||||
│ └── ops/ # 05 모니터·차트
|
||||
├── data/ # coins.db, ground_truth/, ops/
|
||||
└── docs/
|
||||
├── reference/ # 가이드·기법 명세 (Git)
|
||||
└── 02~05, charts/ # 단계별 HTML·CSV (재생성)
|
||||
```
|
||||
|
||||
## 봉별 분석 항목
|
||||
상세: [docs/reference/STRUCTURE.md](docs/reference/STRUCTURE.md) · [docs/README.md](docs/README.md)
|
||||
|
||||
### 볼린저
|
||||
- 이벤트: `cross_up_lower`, `cross_up_upper`, `inside_band`, `squeeze` …
|
||||
- 구간: `bb_zone_bottom` ~ `bb_zone_top` (%B)
|
||||
## 환경 변수
|
||||
|
||||
### 일목균형표
|
||||
- `ichi_above_cloud`, `ichi_below_cloud`, `ichi_in_cloud`
|
||||
- `ichi_tk_bull` / `ichi_tk_cross_up`, `ichi_cloud_bull` …
|
||||
| 파일 | 용도 |
|
||||
|------|------|
|
||||
| `.env` | 전역 설정·API 키 (Git 제외, 프로젝트 루트에 필수) |
|
||||
|
||||
### 조합
|
||||
- 3분 기준 `merge_asof`로 모든 봉 특징을 한 행에 정렬
|
||||
- `discover`가 AND/OR 조합으로 매수·매도 규칙 탐색
|
||||
|
||||
## 실행 순서
|
||||
`config.py`와 `scripts/_bootstrap.py`가 프로젝트 루트 `.env`를 `python-dotenv`로 자동 로드합니다. 새 환경에서는 팀에서 `.env`를 전달받거나 기존 로컬 파일을 복사하세요.
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
python downloader.py # 1분봉 2개월, 나머지 6개월
|
||||
python simulation.py # analyze → discover → HTML (탐색 매수·매도 규칙 표시)
|
||||
python monitor_coin.py # 실거래
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
HTML 차트에는 `discovered_rules.json` 에서 찾은 **매수·매도 규칙**의 체결만 표시합니다.
|
||||
고급: `analyze`, `discover`, `compare`, `mtf`.
|
||||
## 빠른 시작
|
||||
|
||||
## 설정 (`config.py`)
|
||||
```bash
|
||||
python scripts/01_download.py
|
||||
python scripts/02_ground_truth.py
|
||||
python scripts/03_analyze_enrich.py
|
||||
python scripts/03_analyze_trades.py
|
||||
python scripts/05_chart_truth.py
|
||||
```
|
||||
|
||||
## 주요 설정 (`config.py` / `.env`)
|
||||
|
||||
| 항목 | 설명 |
|
||||
|------|------|
|
||||
| `ALL_INTERVALS` | 1,3,5,10,15,30,60,240,1440 |
|
||||
| `ENTRY_INTERVAL` | 조합 행렬 기준 3분 |
|
||||
| `DOWNLOAD_MONTHS_1M` | 1분봉 보관 개월 (기본 2) |
|
||||
| `USE_DISCOVERED_LIVE` | 실거래에 discovered_rules 사용 |
|
||||
| `BITHUMB_ACCESS_KEY` | 빗썸 API (다운로드·시세) |
|
||||
| `DB_PATH` | `data/coins.db` (`.env`로 변경 가능) |
|
||||
| `GROUND_TRUTH_FILE` | `data/ground_truth/ground_truth_trades.json` |
|
||||
| `CHART_LOOKBACK_DAYS` | 기본 365일 |
|
||||
| `DOWNLOAD_MONTHS` | 3분 이상 봉 12개월 |
|
||||
| `MONITOR_LOOP_SLEEP_SEC` | 05 모니터 루프 주기(초) |
|
||||
|
||||
## 출력 파일
|
||||
## 산출물
|
||||
|
||||
| 파일 | 내용 |
|
||||
| 경로 | 내용 |
|
||||
|------|------|
|
||||
| `combination_report.json` | 봉별 최신 위치·매수/매도 힌트 |
|
||||
| `discovered_rules.json` | 탐색된 매매 규칙 |
|
||||
| `reports/wld_bb_simulation.html` | 시뮬 차트 |
|
||||
| `data/coins.db` | 전 간격 OHLCV |
|
||||
| `data/ground_truth/ground_truth_trades.json` | 정답 타점 |
|
||||
| `docs/charts/wld_bb_chart.html` | 3분 BB 차트 |
|
||||
| `docs/02_ground_truth/wld_ground_truth_chart.html` | 정답 차트 |
|
||||
| `docs/03_analysis/latest/*_latest.csv` | 간격별 최근 봉 전 기법 |
|
||||
| `docs/03_analysis/general_analysis_trades.csv` | GT 타점 MTF 스냅샷 |
|
||||
|
||||
## 면책
|
||||
|
||||
실거래 손실 책임은 사용자에게 있습니다.
|
||||
실거래는 사용자 책임입니다. 본 저장소는 주문 실행을 포함하지 않습니다.
|
||||
|
||||
Reference in New Issue
Block a user