feat: bear block, trend-continuation entry, partial TP backtest
1. daemon/runner.py: skip scan entirely in bear regime
- calls get_regime() at start of each scan loop
- logs bear block with score before sleeping
2. core/strategy.py: trend-continuation entry filter
- check_trend_6h(): 6h price trend >= 1% (rejects flash spikes)
- 15-min confirmation watchlist (_watchlist dict)
- should_buy() adds watchlist to existing 12h+regime+momentum logic
- CONFIRM_SECONDS env var (default 900 = 15min)
- TREND_6H_MIN_PCT env var (default 1.0%)
3. backtest.py: partial take-profit scenario comparison (--tp-cmp)
- simulate(): partial_tp_pct / partial_tp_ratio params
- blended pnl = ratio * partial_pnl + (1-ratio) * remaining_pnl
- main_tp_cmp(): 3 scenarios A/B/C (none / +5% 50% / +3% 50%)
- result: partial TP reduces cumulative return (-56% → -63%)
big winners carry the strategy; trimming them hurts expected value
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import time
|
||||
|
||||
from core import trader
|
||||
from core.market import get_top_tickers
|
||||
from core.market_regime import get_regime
|
||||
from core.strategy import should_buy
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -23,6 +24,16 @@ def run_scanner() -> None:
|
||||
time.sleep(SCAN_INTERVAL)
|
||||
continue
|
||||
|
||||
# Bear 레짐 시 신규 매수 완전 차단
|
||||
regime = get_regime()
|
||||
if regime["name"] == "bear":
|
||||
logger.info(
|
||||
f"[Bear차단] 레짐={regime['emoji']} BEAR "
|
||||
f"(score={regime['score']:+.2f}%) — 신규 매수 스킵"
|
||||
)
|
||||
time.sleep(SCAN_INTERVAL)
|
||||
continue
|
||||
|
||||
tickers = get_top_tickers()
|
||||
logger.info(f"스캔 시작: {len(tickers)}개 종목")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user