refactor: DeepCoin 1·2단계 파이프라인으로 구조 재편

레거시 분석·매칭·운영 코드를 정리하고 src/deepcoin 기반으로 재구성한다.
1단계 GT는 2년 스윙·눌림목·돌파·다이버전스 타점을 차트에 표시하고,
2단계는 8개 매매 기법과 GT 정합 평가 스크립트를 추가한다.
.env와 GT JSON 산출물은 추적에서 제외한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-06-08 23:51:26 +09:00
parent 51f70076fb
commit df3c9aecb9
154 changed files with 4629 additions and 215122 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,379 +0,0 @@
{
"symbol": "WLD",
"interval_min": 3,
"gt_pnl_pct": 4291.35,
"grid_combinations": 1728,
"valid_combinations": 432,
"min_trades": 30,
"best": {
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 3.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
"best_params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 3.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
},
"top": [
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 3.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 3.0,
"bb_max": 0.65,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 3.0,
"bb_max": 0.75,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 4.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 4.0,
"bb_max": 0.65,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.0,
"sell_swing_pct": 4.0,
"bb_max": 0.75,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.5,
"sell_swing_pct": 3.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.5,
"sell_swing_pct": 3.0,
"bb_max": 0.65,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.5,
"sell_swing_pct": 3.0,
"bb_max": 0.75,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.5,
"sell_swing_pct": 4.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.5,
"sell_swing_pct": 4.0,
"bb_max": 0.65,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 2.5,
"sell_swing_pct": 4.0,
"bb_max": 0.75,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 3.0,
"sell_swing_pct": 3.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 3.0,
"sell_swing_pct": 3.0,
"bb_max": 0.65,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 3.0,
"sell_swing_pct": 3.0,
"bb_max": 0.75,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 3.0,
"sell_swing_pct": 4.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 3.0,
"sell_swing_pct": 4.0,
"bb_max": 0.65,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.66,
"trade_count": 134,
"leg_count": 17,
"max_drawdown_pct": 0.96,
"capture_ratio": 0.0034,
"params": {
"peak_mode": "local",
"pivot_order": 8,
"buy_swing_pct": 3.0,
"sell_swing_pct": 4.0,
"bb_max": 0.75,
"min_leg_pct": 8.0,
"min_bars_between_legs": 60,
"use_local_trough": false
}
},
{
"pnl_pct": 14.35,
"trade_count": 133,
"leg_count": 18,
"max_drawdown_pct": 0.81,
"capture_ratio": 0.0033,
"params": {
"peak_mode": "local",
"pivot_order": 12,
"buy_swing_pct": 2.0,
"sell_swing_pct": 3.0,
"bb_max": 0.55,
"min_leg_pct": 8.0,
"min_bars_between_legs": 90,
"use_local_trough": false
}
},
{
"pnl_pct": 14.35,
"trade_count": 133,
"leg_count": 18,
"max_drawdown_pct": 0.81,
"capture_ratio": 0.0033,
"params": {
"peak_mode": "local",
"pivot_order": 12,
"buy_swing_pct": 2.0,
"sell_swing_pct": 3.0,
"bb_max": 0.65,
"min_leg_pct": 8.0,
"min_bars_between_legs": 90,
"use_local_trough": false
}
}
],
"target_pnl_pct": 300.0,
"target_met": false
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,76 +0,0 @@
{
"best_params": {
"dd_large_pct": 5.0,
"dd_medium_pct": 2.0
},
"best_metrics": {
"dd_large_pct": 5.0,
"dd_medium_pct": 2.0,
"train_pnl_pct": 681.36,
"holdout_pnl_pct": 62.36,
"full_pnl_pct": 1120.97,
"max_drawdown_pct": 19.22,
"wf_positive_months": 11,
"wf_months": 12,
"large_tier_buys": 1598
},
"grid_size": 18,
"top5": [
{
"dd_large_pct": 5.0,
"dd_medium_pct": 2.0,
"train_pnl_pct": 681.36,
"holdout_pnl_pct": 62.36,
"full_pnl_pct": 1120.97,
"max_drawdown_pct": 19.22,
"wf_positive_months": 11,
"wf_months": 12,
"large_tier_buys": 1598
},
{
"dd_large_pct": 5.0,
"dd_medium_pct": 3.0,
"train_pnl_pct": 681.36,
"holdout_pnl_pct": 62.36,
"full_pnl_pct": 1120.97,
"max_drawdown_pct": 19.22,
"wf_positive_months": 11,
"wf_months": 12,
"large_tier_buys": 1598
},
{
"dd_large_pct": 5.0,
"dd_medium_pct": 4.0,
"train_pnl_pct": 681.36,
"holdout_pnl_pct": 62.36,
"full_pnl_pct": 1120.97,
"max_drawdown_pct": 19.22,
"wf_positive_months": 11,
"wf_months": 12,
"large_tier_buys": 1598
},
{
"dd_large_pct": 12.0,
"dd_medium_pct": 2.0,
"train_pnl_pct": 671.91,
"holdout_pnl_pct": 62.36,
"full_pnl_pct": 1106.19,
"max_drawdown_pct": 15.64,
"wf_positive_months": 11,
"wf_months": 12,
"large_tier_buys": 1531
},
{
"dd_large_pct": 12.0,
"dd_medium_pct": 3.0,
"train_pnl_pct": 671.91,
"holdout_pnl_pct": 62.36,
"full_pnl_pct": 1106.19,
"max_drawdown_pct": 15.64,
"wf_positive_months": 11,
"wf_months": 12,
"large_tier_buys": 1531
}
],
"holdout_start": "2026-04-11 05:33:00"
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,435 +0,0 @@
{
"source": "/Users/xavis/workspace/ncue/DeepCoin/docs/03_analysis/general_analysis_trades.csv",
"profile_json": "/Users/xavis/workspace/ncue/DeepCoin/docs/03_analysis/gt_mtf_profile.json",
"calibration_json": "/Users/xavis/workspace/ncue/DeepCoin/docs/03_analysis/gt_calibration_report.json",
"buy_profile_features": [
"m3_bb_pos",
"m3_ga_cci_20",
"m3_ga_keltner_pos",
"m3_ga_mfi_14",
"m3_ga_donchian_pos",
"m3_RSI",
"m5_bb_pos",
"m5_ga_cci_20",
"m5_ga_keltner_pos",
"m5_ga_mfi_14",
"m5_ga_donchian_pos",
"m5_ga_cci_oversold",
"m10_bb_pos",
"m10_ga_cci_20",
"m10_ga_ha_bull",
"m10_ga_donchian_pos",
"m10_ga_keltner_pos",
"m10_stoch_k",
"m15_bb_pos",
"m15_ga_ha_bull",
"m15_ga_cci_20",
"m15_ga_keltner_pos",
"m15_ga_donchian_pos",
"m15_stoch_k",
"m30_ga_ha_bull",
"m30_bb_pos",
"m30_ga_cci_20",
"m30_ga_cci_overbought",
"m30_ga_donchian_pos",
"m30_ga_keltner_pos",
"m60_ga_ha_bull",
"m60_ga_cci_20",
"m60_bb_pos",
"m60_ga_williams_overbought",
"m60_ga_cci_overbought",
"m60_ga_keltner_pos",
"m240_ga_ha_bull",
"m240_ga_ha_trend_up",
"m240_ga_chart_ha_trend",
"m240_ga_cci_20",
"m240_bb_pos",
"m240_ga_keltner_pos",
"d1_ga_ha_bull",
"d1_ga_cci_oversold",
"d1_ga_cci_20",
"d1_ga_hammer",
"d1_bb_pos",
"d1_ga_chart_ha_trend",
"m10_ga_williams_r",
"m10_ga_mfi_14"
],
"sell_profile_features": [
"m3_bb_pos",
"m3_ga_cci_20",
"m3_ga_keltner_pos",
"m3_ga_mfi_14",
"m3_ga_donchian_pos",
"m3_RSI",
"m5_bb_pos",
"m5_ga_cci_20",
"m5_ga_keltner_pos",
"m5_ga_mfi_14",
"m5_ga_donchian_pos",
"m5_ga_cci_oversold",
"m10_bb_pos",
"m10_ga_cci_20",
"m10_ga_ha_bull",
"m10_ga_donchian_pos",
"m10_ga_keltner_pos",
"m10_stoch_k",
"m15_bb_pos",
"m15_ga_ha_bull",
"m15_ga_cci_20",
"m15_ga_keltner_pos",
"m15_ga_donchian_pos",
"m15_stoch_k",
"m30_ga_ha_bull",
"m30_bb_pos",
"m30_ga_cci_20",
"m30_ga_cci_overbought",
"m30_ga_donchian_pos",
"m30_ga_keltner_pos",
"m60_ga_ha_bull",
"m60_ga_cci_20",
"m60_bb_pos",
"m60_ga_williams_overbought",
"m60_ga_cci_overbought",
"m60_ga_keltner_pos",
"m240_ga_ha_bull",
"m240_ga_ha_trend_up",
"m240_ga_chart_ha_trend",
"m240_ga_cci_20",
"m240_bb_pos",
"m240_ga_keltner_pos",
"d1_ga_ha_bull",
"d1_ga_cci_oversold",
"d1_ga_cci_20",
"d1_ga_hammer",
"d1_bb_pos",
"d1_ga_chart_ha_trend",
"m10_ga_williams_r",
"m10_ga_mfi_14"
],
"buy_gt_count": 325,
"sell_gt_count": 160,
"rule_count": 12,
"rules": [
{
"rule_id": "buy_compound_top3",
"side": "buy",
"kind": "compound",
"conditions": [
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.0,
"hi": 0.2135380413505097
},
{
"col": "m5_bb_pos",
"op": "between",
"lo": 0.0010558937498797,
"hi": 0.2085149451832707
},
{
"col": "m5_ga_cci_20",
"op": "between",
"lo": -188.40579710144863,
"hi": -113.65120836054932
}
],
"profile_cols": [
"m10_bb_pos",
"m5_bb_pos",
"m5_ga_cci_20"
]
},
{
"rule_id": "buy_compound_tight",
"side": "buy",
"kind": "compound_tight",
"conditions": [
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.02269722528896669,
"hi": 0.16417141470116056
},
{
"col": "m5_bb_pos",
"op": "between",
"lo": 0.050986874829589954,
"hi": 0.17673357601131273
},
{
"col": "m5_ga_cci_20",
"op": "between",
"lo": -169.2052113398648,
"hi": -124.73123841544977
},
{
"col": "m10_ga_cci_20",
"op": "between",
"lo": -175.7862791639258,
"hi": -132.6451584428887
}
]
},
{
"rule_id": "buy_contrast_m10_bb_pos",
"side": "buy",
"kind": "contrast",
"conditions": [
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.02269722528896669,
"hi": 0.16417141470116056
},
{
"col": "m10_bb_pos",
"op": "lte",
"value": 0.8561892083441174
}
]
},
{
"rule_id": "buy_mtf_cross_all_tf",
"side": "buy",
"kind": "mtf_cross",
"conditions": [
{
"col": "m3_bb_pos",
"op": "between",
"lo": 0.0217975704436916,
"hi": 0.2431494170206665
},
{
"col": "m5_bb_pos",
"op": "between",
"lo": 0.0010558937498797,
"hi": 0.2085149451832707
},
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.0,
"hi": 0.2135380413505097
},
{
"col": "m15_bb_pos",
"op": "between",
"lo": 0.0,
"hi": 0.2485098739243929
},
{
"col": "m30_ga_ha_bull",
"op": "eq_int",
"value": 0
},
{
"col": "m60_ga_ha_bull",
"op": "eq_int",
"value": 0
},
{
"col": "m240_ga_ha_bull",
"op": "eq_int",
"value": 0
},
{
"col": "d1_ga_ha_bull",
"op": "eq_int",
"value": 0
}
]
},
{
"rule_id": "sell_compound_top3",
"side": "sell",
"kind": "compound",
"conditions": [
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.7897850598593097,
"hi": 1.0
},
{
"col": "m5_bb_pos",
"op": "between",
"lo": 0.776608631452867,
"hi": 0.9797670778565873
},
{
"col": "m5_ga_cci_20",
"op": "between",
"lo": 93.20386715706546,
"hi": 168.50552522505774
}
],
"profile_cols": [
"m10_bb_pos",
"m5_bb_pos",
"m5_ga_cci_20"
]
},
{
"rule_id": "sell_compound_tight",
"side": "sell",
"kind": "compound_tight",
"conditions": [
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.8328462659060121,
"hi": 0.9770682040908933
},
{
"col": "m5_bb_pos",
"op": "between",
"lo": 0.8247158558563334,
"hi": 0.9337055148500956
},
{
"col": "m5_ga_cci_20",
"op": "between",
"lo": 107.30920624132844,
"hi": 148.54421175101805
},
{
"col": "m10_ga_cci_20",
"op": "between",
"lo": 118.85113382022408,
"hi": 158.3923823574028
}
]
},
{
"rule_id": "sell_contrast_m10_bb_pos",
"side": "sell",
"kind": "contrast",
"conditions": [
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.8328462659060121,
"hi": 0.9770682040908933
},
{
"col": "m10_bb_pos",
"op": "gte",
"value": 0.14607994670516883
}
]
},
{
"rule_id": "sell_mtf_cross_all_tf",
"side": "sell",
"kind": "mtf_cross",
"conditions": [
{
"col": "m3_bb_pos",
"op": "between",
"lo": 0.6734769690278859,
"hi": 0.9584317797555851
},
{
"col": "m5_bb_pos",
"op": "between",
"lo": 0.776608631452867,
"hi": 0.9797670778565873
},
{
"col": "m10_bb_pos",
"op": "between",
"lo": 0.7897850598593097,
"hi": 1.0
},
{
"col": "m15_bb_pos",
"op": "between",
"lo": 0.8094990667113329,
"hi": 1.0
},
{
"col": "m30_ga_ha_bull",
"op": "eq_int",
"value": 1
},
{
"col": "m60_ga_ha_bull",
"op": "eq_int",
"value": 1
},
{
"col": "m240_ga_ha_bull",
"op": "eq_int",
"value": 1
},
{
"col": "d1_ga_ha_bull",
"op": "eq_int",
"value": 1
}
]
},
{
"rule_id": "gt_model_buy_zigzag_bb",
"side": "buy",
"kind": "gt_model",
"logic": "and",
"conditions": [
{
"col": "gt_buy_signal",
"op": "eq_int",
"value": 1
}
],
"gt_spec": "trough_zigzag + bb_pos <= GT_BUY_BB_MAX"
},
{
"rule_id": "gt_model_buy_trough_local",
"side": "buy",
"kind": "gt_model",
"logic": "and",
"conditions": [
{
"col": "gt_trough_local",
"op": "eq_int",
"value": 1
},
{
"col": "bb_pos",
"op": "lte",
"value": 0.45
}
],
"gt_spec": "local trough + bb filter"
},
{
"rule_id": "gt_model_sell_zigzag_peak",
"side": "sell",
"kind": "gt_model",
"logic": "and",
"conditions": [
{
"col": "gt_sell_signal",
"op": "eq_int",
"value": 1
}
],
"gt_spec": "major swing peak (ZigZag)"
},
{
"rule_id": "gt_model_sell_peak_local",
"side": "sell",
"kind": "gt_model",
"logic": "and",
"conditions": [
{
"col": "gt_peak_local",
"op": "eq_int",
"value": 1
}
],
"gt_spec": "local high extremum"
}
]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

View File

@@ -1,115 +0,0 @@
# DeepCoin 배포 체크리스트 (GT → Simulation → Operations)
- **설계:** [ARCHITECTURE.md](../reference/ARCHITECTURE.md)
- **초기 자금:** ₩400,000 (`GT_INITIAL_CASH_KRW`)
- **운영 배분:** `sim_causal_hybrid` (= `06_execute_live`)
---
## 1. 한 장 요약
```text
[Ground Truth] 사후 ZigZag · 미래 허용 → 벤치마크 PnL
[Simulation] monitor_rules · 인과 스캔 · 40만·현금/보유 제약
[Operations] 동일 규칙·hybrid · LIVE=1 · 빗썸 실주문
```
| 경로 | 배포 |
|------|------|
| GT oracle | 아님 |
| **sim_causal_hybrid** | **예** (시뮬·운영 공통) |
| sim_tier_enhanced | **금지** |
---
## 2. Ground Truth
- [ ] `01_download.py` 완료 (주봉·월봉 포함)
- [ ] `02_ground_truth.py``CHART_LOOKBACK_DAYS` 의도 확인
- [ ] `03_analyze_enrich.py` + `03_analyze_trades.py` + `03_gt_mtf_profile.py`
- [ ] `05_chart_truth.py` — HTML·JSON 정합
- [ ] `GENERAL_ANALYSIS_INTERVALS``10080,43200` 포함
---
## 3. Simulation
- [ ] `GT_SIGNAL_CAUSAL=1`
- [ ] `04_match_rules.py``monitor_rules` 2개 (`buy_compound_tight`, `sell_mtf_cross_all_tf`)
- [ ] `04_simulation_report.py``simulation_report.html` 확인
- [ ] hybrid Go/No-Go·holdout·MDD 검토 ([SIMULATION.md](../reference/SIMULATION.md))
- [ ] conviction tier 미배포 확인
---
## 4. Operations
### 4.1 `.env`
```env
LIVE_TRADING_ENABLED=1
GT_SIGNAL_CAUSAL=1
SIM_PRIMARY_SIZING=auto
GT_INITIAL_CASH_KRW=400000
LIVE_DAILY_KRW_MAX=400000
LIVE_DAILY_LOSS_LIMIT_KRW=40000
LIVE_MAX_TRADES_PER_DAY=15
LIVE_COOLDOWN_MIN=3
MONITOR_LOOP_SLEEP_SEC=180
```
전체: [env.recommended.md](env.recommended.md)
### 4.2 기동 순서
```bash
python scripts/00_sync_ops.py
python scripts/06_verify_live.py
python scripts/check_balance.py
python scripts/06_execute_live.py --once
python scripts/06_execute_live.py
```
### 4.3 Go/No-Go (운영)
**GO**
- [ ] `06_verify_live.py` PASS
- [ ] 시뮬 hybrid 검토 완료
- [ ] 빗썸 API·잔고 정상
- [ ] `--once``data/ops/live_trades.jsonl` 확인
**NO-GO**
- verify FAIL
- monitor_rules ≠ 2개
- `GT_SIGNAL_CAUSAL=0`
### 4.4 Kill switch
- `06` 프로세스 중지
- 빗썸 수동 청산
---
## 5. 주기적 유지보수
| 주기 | 작업 |
|------|------|
| 일 1회 | `01_download` (또는 06 자동 sync) |
| 주 1회 | `06_verify_live` |
| 월 1회 | `02`~`04` 재실행·시뮬 Go 재확인 |
---
## 6. 스크립트 인덱스
| 축 | 스크립트 |
|----|----------|
| GT | `02`, `03_*`, `05_chart_truth` |
| Sim | `04_match_rules`, `04_simulation_report` |
| Ops | `06_verify_live`, `06_execute_live` |
스크립트 목록: `scripts/README.md`, `docs/reference/ARCHITECTURE.md`

View File

@@ -1,88 +0,0 @@
# 운영 `.env` 권장값 (Operations)
설계: [ARCHITECTURE.md](../reference/ARCHITECTURE.md). dry-run·Phase C 블록은 **사용하지 않습니다**.
---
## 공통 (GT · Simulation · Operations)
```env
SYMBOL=WLD
CHART_LOOKBACK_DAYS=365
# 10TF (주·월봉 포함)
GENERAL_ANALYSIS_INTERVALS=3,5,10,15,30,60,240,1440,10080,43200
TREND_INTERVALS=60,240,1440,10080,43200
# 인과 sim · live hybrid (필수)
GT_SIGNAL_CAUSAL=1
SIM_CAUSAL_TIER=1
SIM_PRIMARY_SIZING=auto
# hybrid DD (hybrid_dd_calibration.json 과 동기)
CAUSAL_GT_DD_LARGE_PCT=5.0
CAUSAL_GT_DD_MEDIUM_PCT=2.0
GT_BUY_PCT_LARGE_LEG=1.0
GT_BUY_PCT_SMALL_LEG=0.05
GT_BUY_PCT_MEDIUM_LEG=0.25
GT_LARGE_LEG_TOP_PCT=0.2
GT_MIN_ORDER_KRW=5000
GT_INITIAL_CASH_KRW=400000
MATCH_MONITOR_MAX_PER_SIDE=1
```
---
## Operations (실거래)
```env
LIVE_TRADING_ENABLED=1
LIVE_ORDER_KRW=40000
LIVE_DAILY_KRW_MAX=400000
LIVE_MAX_TRADES_PER_DAY=15
LIVE_COOLDOWN_MIN=3
LIVE_DAILY_LOSS_LIMIT_KRW=40000
LIVE_SLIPPAGE_PCT=0.05
MONITOR_ALERT_KRW_AMOUNT=40000
MONITOR_ALERT_COOLDOWN_MIN=3
MONITOR_LOOP_SLEEP_SEC=180
MATCH_LIVE_CACHE_SEC=180
```
| 변수 | 값 | 설명 |
|------|-----|------|
| `GT_INITIAL_CASH_KRW` | 400,000 | 시뮬·운영 배분 기준 |
| `LIVE_DAILY_KRW_MAX` | 400,000 | 일 매수 한도 (large tier 1회와 정합) |
| `LIVE_DAILY_LOSS_LIMIT_KRW` | 40,000 | 일 손실 중단 |
### 기동 확인
```bash
python scripts/06_verify_live.py
python scripts/check_balance.py
python scripts/06_execute_live.py --once
```
---
## 한도 상향 (검증 후만)
시뮬 hybrid에 근접하려면 `LIVE_DAILY_KRW_MAX` 등을 올릴 수 있으나 **MDD·슬리피지·실계좌 검증 후**에만 적용합니다.
---
## 절대 변경하지 말 것
```env
# LIVE_TRADING_ENABLED=0 → 06 기동 불가 (dry-run 제거됨)
# GT_SIGNAL_CAUSAL=0 → sim·live 불일치
# conviction tier 배포 금지 (enhanced=False 고정)
# 시뮬 sim_causal_hybrid 정합: fire_outcomes monitor 발화 부트스트랩
LIVE_HYBRID_BOOTSTRAP_FIRES=1
```
체크리스트: [DEPLOYMENT_CHECKLIST.md](./DEPLOYMENT_CHECKLIST.md)

View File

@@ -1,14 +0,0 @@
# docs
| 경로 | 축 | Git |
|------|-----|-----|
| [reference/ARCHITECTURE.md](reference/ARCHITECTURE.md) | **전체 설계** | 추적 |
| [reference/GROUND_TRUTH.md](reference/GROUND_TRUTH.md) | GT | 추적 |
| [reference/SIMULATION.md](reference/SIMULATION.md) | Simulation | 추적 |
| [reference/OPERATIONS.md](reference/OPERATIONS.md) | Operations | 추적 |
| [02_ground_truth/](02_ground_truth/) | GT 산출물 (JSON·HTML 재생성) | CSV/JSON 추적, HTML는 .gitignore |
| [03_analysis/](03_analysis/) | GT 입력·프로필 | CSV/JSON 추적, HTML·latest는 .gitignore |
| [04_matching/](04_matching/) | Sim 산출물 | JSON/CSV 추적, HTML 일부 .gitignore |
| [05_ops/](05_ops/) | Ops 가이드·검증 기록 | env.recommended 추적, live_verification_* .gitignore |
구조: [reference/STRUCTURE.md](reference/STRUCTURE.md)

View File

@@ -1,182 +0,0 @@
# DeepCoin 아키텍처 — Ground Truth · Simulation · Operations
프로젝트는 **세 축만** 사용합니다. 예전 Phase A/B/C·dry-run·paper 모의 체결은 제거되었습니다.
```mermaid
flowchart TB
subgraph data [공통 데이터]
DL[01_download]
DB[(coins.db)]
DL --> DB
end
subgraph gt [Ground Truth]
GT02[02_ground_truth]
GT03[03 분석·프로필]
GT05[05_chart_truth]
DB --> GT02
GT02 --> GJSON[ground_truth_trades.json]
GT03 --> GJSON
GJSON --> GT05
end
subgraph sim [Simulation]
M04[04_match_rules]
S04[04_simulation_report]
GJSON --> M04
DB --> M04
M04 --> MR[matched_rules.json]
MR --> S04
S04 --> SR[simulation_report.*]
end
subgraph ops [Operations]
V06[06_verify_live]
E06[06_execute_live]
MR --> E06
SR --> V06
E06 --> BT[빗썸 API]
end
```
---
## 1. Ground Truth (정답)
### Plan — 목적
- **벤치마크** 매수·매도 타점·leg·비중 (운영 목표 수익의 상한 참고).
- **미래 데이터 허용**: ZigZag·피벗은 사후 라벨링 (`ground_truth.py`).
- 시뮬·운영 규칙의 **교사 신호**가 아님 (oracle 직접 매매 금지).
### Do — 실행
| 순서 | 스크립트 | 산출 |
|------|----------|------|
| (선행) | `01_download.py` | `data/coins.db` (3m~일봉 + 주·월봉) |
| 1 | `02_ground_truth.py` | `data/ground_truth/ground_truth_trades.json` |
| 2 | `03_analyze_enrich.py` | `docs/03_analysis/latest/*` (10TF 지표) |
| 3 | `03_analyze_trades.py` | `general_analysis_trades.csv` (GT 타점 스냅샷) |
| 4 | `03_gt_mtf_profile.py` | `gt_mtf_profile.json` (규칙 후보 입력) |
| 5 | `05_chart_truth.py` | `docs/02_ground_truth/wld_ground_truth_chart.html` |
패키지: `deepcoin/ground_truth/`, `deepcoin/analysis/`
### Check — 핵심 설정
| 변수 | 의미 |
|------|------|
| `CHART_LOOKBACK_DAYS` | GT·스캔 구간 (기본 365) |
| `GT_INITIAL_CASH_KRW` | GT 포트폴리오 시뮬 초기 자금 (40만) |
| `GT_*` | ZigZag·분할 매수·leg 티어 |
### Act — 갱신 시
GT 파라미터·구간 변경 후 **02 → 03* → 05** 순 재실행.
---
## 2. Simulation (시뮬레이션)
### Plan — 목적
- GT 프로필에서 **규칙 후보** 생성 → 전 구간 **발화 스캔** → EV·holdout 검증.
- **과거 데이터만** 사용 (`GT_SIGNAL_CAUSAL=1`, `enrich_scan_frame_gt_signals(causal=True)`).
- 초기 자금 **40만 원**, **현금 있을 때만 매수**, **보유 있을 때만 매도** (`gt_allocation` / `HybridSimPortfolio`).
### Do — 실행
| 순서 | 스크립트 | 산출 |
|------|----------|------|
| 1 | `04_match_rules.py` | `matched_rules.json`, `fire_outcomes.csv` |
| 2 | `04_simulation_report.py` | `simulation_report.json/html`, Go/No-Go |
| (선택) | `04_hybrid_dd_calibrate.py` | `hybrid_dd_calibration.json` |
| (선택) | `04_causal_gt_calibrate.py` | `causal_gt_calibration.json` |
패키지: `deepcoin/matching/`
### Check — 운영 규칙·배분
| 항목 | 값 |
|------|-----|
| `monitor_rules` | `buy_compound_tight`, `sell_mtf_cross_all_tf` (주봉 w1 조건 포함 가능) |
| **권장 primary** | `sim_causal_hybrid` (hybrid DD tier, `enhanced=False`) |
| **배포 금지** | `sim_tier_enhanced` (conviction) |
| Go/No-Go | holdout EV, MDD, fee stress — [SIMULATION.md](SIMULATION.md) |
### Act — 재검증
데이터·GT·`GENERAL_ANALYSIS_INTERVALS` 변경 시 **04_match → 04_simulation** 재실행.
운영 전 **simulation_report.html** 에서 hybrid Go/No-Go 확인.
---
## 3. Operations (운영)
### Plan — 목적
- 시뮬과 **동일 규칙·동일 hybrid 배분**으로 빗썸 **실주문**.
- `LIVE_TRADING_ENABLED=1` **필수**. dry-run·paper 없음.
### Do — 실행
| 순서 | 스크립트 | 역할 |
|------|----------|------|
| (선행) | `00_sync_ops.py` | 운영 전 봉 동기화 |
| 1 | `06_verify_live.py` | 설정·규칙·한도·tier 점검 |
| 2 | `check_balance.py` | 빗썸 KRW·보유 확인 |
| 3 | `06_execute_live.py` | 실거래 루프 (`--once` 1회 테스트) |
| (선택) | `05_run_monitor.py` | 알림만 (주문 없음) |
패키지: `deepcoin/ops/live_trader.py`, `hybrid_sim_execution.py`
### Check — 제약 (시뮬과 동일)
| 제약 | 구현 |
|------|------|
| 초기 자금 | `GT_INITIAL_CASH_KRW=400000` (배분 기준) |
| 매수 | 가용 현금·수수료, `LIVE_DAILY_KRW_MAX`, EV/WF 통과 매수만 |
| 매도 | 보유 수량, `plan_live_hit``sell_qty` |
| 이력 | `LIVE_HYBRID_BOOTSTRAP_FIRES=1``fire_outcomes` monitor 발화 + 운영 체결분 |
| 인과 | 발화 시점까지 OHLC·지표만 (`live_eval` + causal GT signals) |
### Act — Kill switch
1. `06_execute_live` 프로세스 중지
2. 빗썸 앱 수동 청산
3. 필요 시 `01`~`04` 재실행 후 규칙·시뮬 재승인
---
## 스크립트 번호 ↔ 축 (빠른 참조)
| 축 | 스크립트 |
|----|----------|
| **데이터** | `01_download`, `00_sync_ops` |
| **GT** | `02`, `03_*`, `05_chart_truth` |
| **Sim** | `04_match_rules`, `04_simulation_report`, `04_*_calibrate` |
| **Ops** | `06_verify_live`, `06_execute_live`, `check_balance`, `05_run_monitor` |
| **검증** | `verify_env.py`, `test_buy_sell_rehearsal.py` |
---
## 데이터·미래 사용 정책
| 축 | 미래 데이터 |
|----|-------------|
| Ground Truth | **허용** (라벨링·벤치마크) |
| Simulation | **금지** (발화·스캔·배분 tier는 과거 leg·DD만) |
| Operations | **금지** (Simulation과 동일 규칙·엔진) |
---
## 관련 문서
| 문서 | 내용 |
|------|------|
| [GROUND_TRUTH.md](GROUND_TRUTH.md) | GT 타점·배분 상세 |
| [SIMULATION.md](SIMULATION.md) | Go/No-Go·portfolio_compare |
| [LIVE_TRADING.md](LIVE_TRADING.md) | 06 실거래 |
| [OPERATIONS.md](OPERATIONS.md) | 일상 루틴 |
| [RISK.md](RISK.md) | 한도·Kill switch |
| [DEPLOYMENT_CHECKLIST.md](../05_ops/DEPLOYMENT_CHECKLIST.md) | 기동 체크리스트 |

View File

@@ -1,80 +0,0 @@
# Ground Truth (정답 타점)
설계: [ARCHITECTURE.md](ARCHITECTURE.md) — **Ground Truth** 축.
1년(기본 `CHART_LOOKBACK_DAYS=365`) 3분봉에서 **사후 최적 스윙** 매수·매도 라벨.
**미래 데이터 허용** (ZigZag). Simulation·Operations에는 oracle을 직접 쓰지 않습니다.
JSON 필드 `model`에 타점·비중·자본 배분 규칙이 일반화되어 있습니다 (`deepcoin/ground_truth/gt_model.py`).
## Plan — 타점 구조 (일반화)
### Leg (라운드트립 구간)
- **leg_id**: 이전 **고점 매도** 시각 ~ 다음 **고점 매도** 직전까지.
- 마지막 구간: 마지막 major peak 이후 ~ 기간 말 → **기간말 leg** (종가 청산 1회).
### 매수 타점 (Entry)
| 항목 | 규칙 |
|------|------|
| 피벗 | ZigZag **저점(trough)**, `GT_BUY_MIN_SWING_PCT` |
| 가격 | 해당 봉 **Low** |
| 후보 | leg 구간 내 trough, `GT_BUY_MIN_BARS` 간격, BB (`bb_pos <= GT_BUY_BB_MAX`) |
| **비중 weight** | `w_i = (1/price_i) / Σ(1/price_j)`**저가일수록 큰 비중** |
| leg당 상한 | `GT_MAX_BUYS_PER_LEG` (초과 시 저가 순 유지) |
### 매도 타점 (Exit)
| 항목 | 규칙 |
|------|------|
| 피벗 | **major swing 고점(peak)** |
| 가격 | 해당 봉 **High** |
| **비중 weight** | 1회 매도: **100%** · 2회 분할: **65% + 35%** (`GT_SELL_SPLIT_GAP_PCT`) |
| 수량 | leg 보유 수량 × 매도 비중 (마지막 매도 = leg 전량) |
## Do — 자본 배분 (amount_krw)
시각순 체결. **매도 후 현금**이 다음 매수에 반영됩니다.
```
총보유자산 = 현금 + 보유×체결가
최적매수율 = (이번 weight / leg 남은 weight 합) × leg티어스케일
목표매수액 = 총보유자산 × 최적매수율
실제매수액 = min(목표, 가용현금/(1+수수료)), 최소 GT_MIN_ORDER_KRW
```
| leg 티어 | 조건 | 스케일 (`.env`) |
|----------|------|-----------------|
| 대형 | leg 수익률 상위 `GT_LARGE_LEG_TOP_PCT` | `GT_BUY_PCT_LARGE_LEG` (기본 1.0) |
| 소형 | 그 외 | `GT_BUY_PCT_SMALL_LEG` (기본 0.05) |
**summary.pnl_pct**: 위 배분으로 **시각순** 시뮬 + 기간말 **종가 평가**.
**JSON 저장 순서**: leg별 매수 전량 → 매도 전량 (`leg_block`, 차트·테이블 정합).
## 실행
```bash
python scripts/02_ground_truth.py # ground_truth_trades.json (+ model)
python scripts/05_chart_truth.py # HTML 차트
```
## Check — 주요 환경 변수
| 변수 | 기본 | 설명 |
|------|------|------|
| `GT_MIN_SWING_PCT` | 4.0 | 매도 피벗 ZigZag(%) |
| `GT_BUY_MIN_SWING_PCT` | 3.0 | 매수 피벗 ZigZag(%) |
| `GT_PIVOT_ORDER` | 20 | 국소 극값 반경 |
| `GT_MIN_BARS_BETWEEN` | 30 | 체결 최소 간격(봉) |
| `GT_MIN_LEG_PCT` | 8.0 | major leg 최소 수익(%) |
| `GT_BUY_PCT_LARGE_LEG` | 1.0 | 상위 leg 총자산 배분 스케일 |
| `GT_BUY_PCT_SMALL_LEG` | 0.05 | 소형 leg 스케일 |
| `GT_LARGE_LEG_TOP_PCT` | 0.2 | 대형 leg 상위 비율 |
| `GT_MIN_ORDER_KRW` | 5000 | 최소 체결 원화 |
## Act
- JSON·`model` 수정 후 `02` / `05` 재실행
- 시뮬 비교: `04_simulation_report.py` (GT vs 시뮬·총자산% vs 고정 ₩/회)

View File

@@ -1,67 +0,0 @@
# 3단계 — 실거래 (hybrid primary)
## 운영 모델 (시뮬과 동일)
실거래는 **시뮬 `sim_causal_hybrid`** 와 같은 배분 경로만 사용합니다. dry-run·모의 체결은 제거되었습니다.
| 구분 | 내용 |
|------|------|
| 신호 | `matched_rules.json``monitor_rules` 2개 |
| 매수 규칙 | `buy_compound_tight` |
| 매도 규칙 | `sell_mtf_cross_all_tf` (주봉 w1 조건 포함) |
| 배분 | hybrid DD tier + past-leg, **`enhanced=False`** |
| 이력 | `LIVE_HYBRID_BOOTSTRAP_FIRES=1``fire_outcomes` monitor 발화 + 운영 체결분 |
| 체결 엔진 | `plan_live_hit` = `replay_hybrid_signals` (= `build_monitor_hybrid_sized_trades`) |
| 매수 필터 | 시뮬과 동일 — monitor 발화 전체 (`approved_buy_rules=None`) |
| 금지 | `sim_tier_enhanced` (conviction), GT oracle 타점 |
코드: `deepcoin/ops/hybrid_sim_execution.py``live_trader.py` (`LIVE_TRADING_ENABLED=1` 필수)
## 기동 전 점검
```bash
python scripts/06_verify_live.py # 설정·tier·규칙·한도
python scripts/check_balance.py # 빗썸 KRW·보유 확인
```
## 실거래 실행
`.env``LIVE_TRADING_ENABLED=1` 확인 후:
```bash
python scripts/06_execute_live.py --once # 1회
python scripts/06_execute_live.py # 상시 루프
```
## 환경 변수 (운영 예)
| 변수 | 예 | 설명 |
|------|-----|------|
| `LIVE_TRADING_ENABLED` | 1 | 0이면 06 기동 불가 |
| `GT_SIGNAL_CAUSAL` | 1 | hybrid sizing (과거만) |
| `GT_INITIAL_CASH_KRW` | 400000 | 시뮬·배분 기준 |
| `LIVE_DAILY_KRW_MAX` | 400000 | 일 주문 한도 |
| `LIVE_DAILY_LOSS_LIMIT_KRW` | 40000 | 일 손실 한도 |
| `LIVE_COOLDOWN_MIN` | 3 | 규칙당 쿨다운(분) |
| `LIVE_MAX_TRADES_PER_DAY` | 15 | 일 최대 체결 수 |
전체: [env.recommended.md](../05_ops/env.recommended.md)
## 주문·배분 동작
- 발화 이력 → `plan_live_hit` / `replay_hybrid_signals` (인과, 현금·보유 제약)
- **매수:** EV/WF 통과 규칙만, 가용 현금 범위, 일한도·쿨다운
- **매도:** 보유 수량 필요, 시뮬 분할 `sell_qty` 기준 시장가 매도
## 로그
| 경로 | 내용 |
|------|------|
| `data/ops/live_trades.jsonl` | 실주문 기록 |
| `data/ops/live_signal_history.json` | 발화 이력 (배분 정합) |
| `docs/05_ops/live_verification_*.md` | `06_verify_live.py` 점검 기록 |
## Kill switch
1. `06_execute_live` 프로세스 중지
2. 빗썸 앱에서 수동 청산

View File

@@ -1,133 +0,0 @@
# 운영 가이드
## 로드맵과 현재 위치 (2026-06-01)
| 순서 | 단계 | 상태 |
|------|------|------|
| 1 | 시뮬레이션 | **완료** (GO) — [SIMULATION.md](SIMULATION.md) |
| 2 | 문서화 | **본 문서군** — SIMULATION / LIVE / RISK / OPERATIONS |
| 3 | 오픈 (실거래) | **운영 중** — [LIVE_TRADING.md](LIVE_TRADING.md) |
| 4 | 실계좌 검증 | 1~2주 |
| 5 | 지속 운영 | 06 상시 + 월간 재시뮬 |
배포 모델: **hybrid primary** (= 시뮬 `sim_causal_hybrid`). 상세: [LIVE_TRADING.md](LIVE_TRADING.md)
---
## 단계별 스크립트
| 단계 | 스크립트 | 산출·역할 |
|------|----------|-----------|
| 01 | `01_download.py` | `coins.db` (3~1440분, 1분 제외) |
| (자동) | 05/06·`load_frames_from_db` | API 수집 시 `MONITOR_PERSIST_CANDLES=1`이면 **즉시 DB INSERT** |
| 02 | `02_ground_truth.py` | GT JSON·차트 |
| 03 | `03_analyze_enrich.py` | `docs/03_analysis/latest/` |
| 03b | `03_analyze_trades.py` | GT MTF 스냅샷 CSV |
| 03c | `03_gt_mtf_profile.py` | GT 프로필 (04 입력) |
| 04 | `04_match_rules.py` | `matched_rules.json` |
| 04 시뮬 | `04_simulation_report.py` | Go/No-Go 리포트 |
| 05 | `05_run_monitor.py` | 알림 (주문 없음) |
| 06 | `06_execute_live.py` | 알림+주문 (LIVE=1) |
| 점검 | `06_verify_live.py` | hybrid·한도·규칙 PASS (`LIVE=1`) |
| 환경 | `verify_env.py` | `.env`·경로 검증 |
구조: [STRUCTURE.md](STRUCTURE.md)
---
## 실거래 운영 (LIVE=1)
### `.env` 핵심
```env
LIVE_TRADING_ENABLED=1
GT_SIGNAL_CAUSAL=1
SIM_PRIMARY_SIZING=auto
MONITOR_LOOP_SLEEP_SEC=180
```
전체: [env.recommended.md](../05_ops/env.recommended.md)
### 매일 루틴
| 순서 | 명령 | 빈도 |
|------|------|------|
| 1 | `python scripts/01_download.py` | 1일 1회 |
| 2 | `python scripts/06_verify_live.py` | 기동 전·1일 1회 |
| 3 | `python scripts/06_execute_live.py` | 상시 (빗썸 실주문) |
선택: `python scripts/05_run_monitor.py` (알림만 병행)
### 기동 절차
1. [env.recommended.md](../05_ops/env.recommended.md) 적용
2. `LIVE_TRADING_ENABLED=1` 확인
3. `06_verify_live.py` → PASS
4. `06_execute_live.py --once``live_trades.jsonl` 확인
5. `06_execute_live.py` 상시
체크리스트: [DEPLOYMENT_CHECKLIST.md](../05_ops/DEPLOYMENT_CHECKLIST.md)
---
## Phase B-2 이후 (검증 통과 시)
- `LIVE_DAILY_KRW_MAX` 등 한도 상향 (리스크 문서·본인 판단)
- 주간 `04_simulation_report.py`로 EV·hybrid Go 재확인
---
## 텔레그램
| 스크립트 | 내용 |
|----------|------|
| 05 | 규칙 발화·MTF 요약 (주문 없음) |
| 06 | 발화 + 실주문 체결 (`LIVE=1` 필수) |
중복 완화: `MONITOR_ALERT_COOLDOWN_MIN`, `LIVE_COOLDOWN_MIN`
---
## 장애 대응
| 증상 | 조치 |
|------|------|
| 주문 실패 | `live_trades.jsonl`, API 키·잔고 → `LIVE_TRADING_ENABLED=0` |
| 알림만, 주문 없음 | `LIVE_TRADING_ENABLED=1` 및 06 프로세스 확인 |
| verify FAIL | `.env`, `matched_rules` 2개, `GT_SIGNAL_CAUSAL=1` |
| hybrid 금액 0 | 현금·EV/WF·tier 스킵 로그 확인 |
| 과다 알림 | 쿨다운 증가 |
| 시뮬과 수익 괴리 | 일한도·슬리피지 — [RISK.md](RISK.md) |
---
## 데이터·산출물 경로
| 경로 | 용도 |
|------|------|
| `data/coins.db` 또는 루트 `coins.db` | OHLCV |
| `data/ground_truth/ground_truth_trades.json` | GT |
| `docs/04_matching/matched_rules.json` | 운영 규칙 |
| `docs/04_matching/simulation_report.html` | 시뮬 리포트 |
| `data/ops/live_trades.jsonl` | 06 로그 |
---
## 오픈 당일 체크리스트 (3단계)
- [ ] 시뮬·hybrid Go/No-Go **GO** (참고)
- [ ] 운영 `.env`
- [ ] `06_verify_live.py` PASS
- [ ] `LIVE_TRADING_ENABLED=1` 의도 확인
- [ ] `--once``live_trades.jsonl`
- [ ] [RISK.md](RISK.md) Kill switch 숙지
---
## 관련 문서
- [ROADMAP.md](ROADMAP.md)
- [SIMULATION.md](SIMULATION.md)
- [LIVE_TRADING.md](LIVE_TRADING.md)
- [RISK.md](RISK.md)
- [DEPLOYMENT_CHECKLIST.md](../05_ops/DEPLOYMENT_CHECKLIST.md)

View File

@@ -1,51 +0,0 @@
# 리스크 — Simulation · Operations
설계: [ARCHITECTURE.md](ARCHITECTURE.md)
## 모델 리스크 (배포 경로)
| 경로 | 리스크 수준 | 조치 |
|------|-------------|------|
| **hybrid primary** (`sim_causal_hybrid`) | 배포 허용 | `06_verify_live` 후 소액 시작 |
| GT oracle | **운영 금지** | 벤치마크만 (미래 허용) |
| conviction (`sim_tier_enhanced`) | **금지** | `enhanced=False` 고정 |
| sim 고수익 ≠ 실현 | **구조적 갭** | 일한도·슬리피지·부분 체결 |
시뮬 Go/No-Go는 과거 데이터 가정이며 실계좌 수익을 보장하지 않습니다.
## 자금·한도 (Operations)
| 원칙 | 내용 |
|------|------|
| 초기 기준 | `GT_INITIAL_CASH_KRW=400000` |
| 일 매수 | `LIVE_DAILY_KRW_MAX` — hybrid 1회액 초과 시 스킵 |
| 일 손실 | `LIVE_DAILY_LOSS_LIMIT_KRW` 초과 시 당일 중단 |
| 매수 | EV/WF 통과 규칙 + 가용 현금 |
| 매도 | 보유 수량 필요 |
한도는 [env.recommended.md](../05_ops/env.recommended.md) 기준으로 시작하고, 검증 후에만 상향합니다.
## 시장·기술 리스크
| 리스크 | 완화 |
|--------|------|
| API 장애 | 재시도·06 중지 |
| 슬리피지 | 소액·`live_trades.jsonl` 기록 |
| 봉 지연 | `01_download` / `00_sync_ops` |
| 단일 종목(WLD) | 일한도·포지션 상한 |
## Kill switch
1. `06_execute_live` 프로세스 중지
2. 빗썸 수동 청산
## 재평가
| 주기 | 작업 |
|------|------|
| 주 1회 | `06_verify_live.py` |
| 월 1회 | `04_simulation_report.py` |
## 면책
실거래 손익은 운영자 책임입니다. 본 저장소는 투자 자문이 아닙니다.

View File

@@ -1,33 +0,0 @@
# DeepCoin 로드맵
설계: [ARCHITECTURE.md](ARCHITECTURE.md) — **GT → Simulation → Operations** 만 사용합니다.
## 축별 상태
| 축 | 상태 | 다음 액션 |
|----|------|-----------|
| **Ground Truth** | 1년 GT·10TF 프로필 | 구간·파라미터 변경 시 `02`~`03` 재실행 |
| **Simulation** | hybrid Go/No-Go (MDD 참고) | 월 1회 `04_simulation_report` |
| **Operations** | LIVE=1, dry-run 제거 | `06_verify_live``06_execute_live` |
## 권장 워크플로
```text
01 download
→ 02 GT (+ 03 분석·프로필, 05 차트)
→ 04 match + 04 simulation (인과, 40만 원)
→ 06 verify + 06 execute (동일 monitor_rules)
```
운영 배분: **sim_causal_hybrid** = **06 live** (`hybrid_sim_execution`)
## 문서 맵
| 문서 | 축 |
|------|-----|
| [GROUND_TRUTH.md](GROUND_TRUTH.md) | GT |
| [SIMULATION.md](SIMULATION.md) | Simulation |
| [LIVE_TRADING.md](LIVE_TRADING.md) | Operations |
| [OPERATIONS.md](OPERATIONS.md) | Operations |
| [RISK.md](RISK.md) | Operations |
| [DEPLOYMENT_CHECKLIST.md](../05_ops/DEPLOYMENT_CHECKLIST.md) | 기동 체크 |

View File

@@ -1,111 +0,0 @@
# Simulation (시뮬레이션)
설계: [ARCHITECTURE.md](ARCHITECTURE.md). Ground Truth **이후**, Operations **이전** 단계입니다.
## 목적
1. `monitor_rules`가 holdout·walk-forward·수수료 스트레스를 통과하는지 검증한다.
2. 운영에 쓸 **배분 경로(primary)** 를 정한다. (실전 = **hybrid**, GT oracle 아님)
## 실행
```bash
python scripts/04_match_rules.py # 선행
python scripts/04_simulation_report.py
```
## 산출물
| 파일 | 내용 |
|------|------|
| `docs/04_matching/simulation_report.json` | Go/No-Go, `portfolio_compare`, walk-forward |
| `docs/04_matching/simulation_report.html` | GT·시뮬 경로별 카드·차트 |
## 배포 모델 (primary)
| 경로 | `portfolio_compare` 키 | 전기간 PnL (최근 실행) | 운영 |
|------|------------------------|------------------------|------|
| GT oracle (사후 ZigZag) | `ground_truth_chrono` | +4,291% | **미사용** (미래 허용 벤치마크) |
| **권장 primary** | `sim_primary` = `sim_causal_hybrid` | (리포트 참고) | **Operations 배분** |
| causal tier only | `sim_sized` | +75% | 미사용 |
| 인과 GT leg 엔진 | `sim_causal_gt` | +15% | 미사용 |
| conviction tier | `sim_tier_enhanced` | -51% | **금지** |
| 고정 금액 baseline | `sim_fixed_order` | -94% | 비교용 |
- `primary_sizing`: **hybrid** (`go_no_go_hybrid.primary_sizing`)
- hybrid: monitor 발화 + **DD tier + past-leg tier**, `enhanced=False`
- 코드: `deepcoin/ground_truth/causal_gt_hybrid.py`, `deepcoin/matching/simulation.py`
## Go/No-Go (최근 실행 요약)
### 규칙 (`go_no_go`)
| rule_id | holdout EV | WF+ 비율 | fee 2× EV | 결과 |
|---------|------------|----------|-----------|------|
| `buy_compound_tight` | 5.66 | 0.75 | 4.99 | PASS |
| `sell_mtf_cross_all_tf` | 7.13 | 1.00 | 7.12 | PASS |
**GO**
### hybrid primary (`go_no_go_hybrid`)
| 검사 | 값 | 결과 |
|------|-----|------|
| monitor_rules_go | - | PASS |
| hybrid_holdout_pnl | +62.35% | PASS |
| hybrid_max_mdd | 19.22% | PASS |
| hybrid_fee_stress_pnl | +975.74% | PASS |
| option_c_target_300pct (optional) | +1,147% | PASS |
**GO** · `primary_sizing=hybrid`
### Option C 2차 (`go_no_go_option_c_phase2`)
- 전기간 +1,000% 목표, GT capture ≥23%, WF 양수 월 비율, 슬리피지 스트레스 등 → **GO**
재실행 후 수치는 `simulation_report.json`을 기준으로 한다.
## 포트폴리오 비교 (`portfolio_compare`) — 읽는 법
| 키 | 설명 |
|----|------|
| `ground_truth_chrono` | GT 타점·`amount_krw` 시각순 체결 (상한 벤치마크) |
| `sim_primary` / `sim_causal_hybrid` | **운영 배분과 동일** (monitor + hybrid tier) |
| `sim_sized` | EV/WF·leg 가중 복리 (구 경로) |
| `sim_hybrid_holdout` | hybrid 전기간 복리 후 **holdout 구간** 자산 증감 |
| `sim_hybrid_fee_stress` | 수수료 스트레스 hybrid |
| `hybrid_dd_params` | `dd_large_pct`, `dd_medium_pct` (캘리브 JSON과 동기) |
## 검증 항목
| 항목 | 설명 |
|------|------|
| Holdout | 규칙별 EV≥0, PF≥1 |
| Walk-forward | 월별 EV·`SIM_GO_WF_POSITIVE_RATIO` |
| 수수료 스트레스 | `SIM_FEE_STRESS_MULT` (기본 2×) |
| hybrid | holdout PnL, MDD, fee stress, (선택) +300% |
| 슬리피지 | Option C 2차 — 체결가 불리 가정 후 흑자 여부 |
## 시뮬 vs 실운영 (기대 갭)
시뮬 hybrid는 **일한도 없이** 복리·전액 배분을 가정한다. 실거래는 `LIVE_DAILY_KRW_MAX` 등으로 체결이 잘리므로 **수익률이 sim_primary와 같지 않을 수 있다**. (배포 체크리스트 D6: 실현=sim 미달)
## 환경 변수
| 변수 | 용도 |
|------|------|
| `SIM_GO_*`, `SIM_FEE_STRESS_MULT`, `SIM_WALK_FORWARD_MIN_MONTHS` | 규칙 Go/No-Go |
| `SIM_PRIMARY_SIZING` | `auto` \| `hybrid` \| `causal_tier` (권장: **auto** → hybrid) |
| `GT_SIGNAL_CAUSAL` | 1 — hybrid live sizing 활성 |
| `CAUSAL_GT_DD_LARGE_PCT`, `CAUSAL_GT_DD_MEDIUM_PCT` | hybrid tier (캘리브와 동기) |
| `GT_BUY_PCT_*`, `GT_LARGE_LEG_TOP_PCT` | tier 비중 |
## NO-GO 시
1. `04_match_rules.py` 재실행 (프로필·선별)
2. `04_simulation_report.py` 재실행
3. `go_no_go` / `go_no_go_hybrid` checks 확인
## 다음 단계
- **Operations:** [LIVE_TRADING.md](LIVE_TRADING.md), [OPERATIONS.md](OPERATIONS.md), [DEPLOYMENT_CHECKLIST.md](../05_ops/DEPLOYMENT_CHECKLIST.md)

View File

@@ -1,44 +0,0 @@
# DeepCoin 프로젝트 구조
실행은 **`scripts/`** 만 사용합니다. 설계는 **Ground Truth · Simulation · Operations** 세 축입니다.
[ARCHITECTURE.md](ARCHITECTURE.md)
## 축별 매핑
| 축 | 패키지 | 스크립트 | 산출물 |
|----|--------|----------|--------|
| **데이터** | `deepcoin/data/` | `01_download`, `00_sync_ops` | `data/coins.db` |
| **Ground Truth** | `ground_truth/`, `analysis/` | `02`, `03_*`, `05_chart_truth` | `ground_truth_trades.json`, `docs/02_ground_truth/` |
| **Simulation** | `matching/` | `04_match_rules`, `04_simulation_report` | `docs/04_matching/` |
| **Operations** | `ops/` | `06_verify_live`, `06_execute_live` | `data/ops/live_trades.jsonl` |
보조: `05_run_monitor` (알림), `verify_env`, `test_buy_sell_rehearsal`
## 디렉터리 트리
```text
DeepCoin/
├── .env, config.py
├── deepcoin/
│ ├── api/
│ ├── data/
│ ├── ground_truth/
│ ├── analysis/
│ ├── matching/
│ └── ops/
├── scripts/
├── data/
└── docs/
├── reference/ # ARCHITECTURE, GROUND_TRUTH, SIMULATION …
├── 02_ground_truth/
├── 03_analysis/
├── 04_matching/
└── 05_ops/
```
## `docs/` 규칙
- `docs/reference/` — 가이드 (Git)
- `docs/02_*` ~ `docs/05_ops/` — 스크립트 재생성 산출물
코드의 `REPORTS_*` 별칭은 `deepcoin/paths.py`에서 `docs/*`로 연결됩니다.