수정
This commit is contained in:
@@ -349,6 +349,9 @@ def check_orb_signal(
|
||||
orb_stop = max(orb_stop, atr_floor)
|
||||
# 상한 클램프: 일일 손실 한도 대비 종목당 최대 한도
|
||||
stop_loss = max(orb_stop, hard_stop)
|
||||
# 최소 손절폭 보장: ATR/ORB가 너무 좁으면 노이즈에 즉시 손절 → 최소 -1.0% 확보
|
||||
min_stop = current_price * (1 - settings.DAY_TRADE_MIN_STOP_LOSS_PCT)
|
||||
stop_loss = min(stop_loss, min_stop)
|
||||
risk = current_price - stop_loss
|
||||
if risk <= 0:
|
||||
return None # 손절폭이 0 이하면 진입 무의미
|
||||
@@ -412,6 +415,9 @@ def check_vwap_bounce_signal(
|
||||
raw_stop = (current_price - settings.DAY_TRADE_VWAP_ATR_MULT * atr) if atr else current_price * (1 - settings.DAY_TRADE_ORB_STOP_LOSS_PCT)
|
||||
hard_stop_vwap = current_price * (1 - settings.DAY_TRADE_REVERSION_STOP_LOSS_PCT)
|
||||
stop_loss = max(raw_stop, hard_stop_vwap, 1.0) # 타이트한 쪽 = 진입가에 가까운 = 높은 가격, 최소 1원 보장
|
||||
# 최소 손절폭 보장: ATR이 너무 작으면 노이즈에 즉시 손절 → 최소 -1.0% 확보
|
||||
min_stop = current_price * (1 - settings.DAY_TRADE_MIN_STOP_LOSS_PCT)
|
||||
stop_loss = min(stop_loss, min_stop)
|
||||
target = (current_price + settings.DAY_TRADE_TARGET_MULTIPLIER * atr) if atr else vwap * 1.03
|
||||
|
||||
return DayTradeSignal(
|
||||
@@ -471,6 +477,9 @@ def check_rsi_bb_signal(
|
||||
raw_stop = (current_price - settings.DAY_TRADE_RSI_BB_ATR_MULT * atr) if atr else current_price * (1 - settings.DAY_TRADE_ORB_STOP_LOSS_PCT)
|
||||
hard_stop_rsi = current_price * (1 - settings.DAY_TRADE_REVERSION_STOP_LOSS_PCT)
|
||||
stop_loss = max(raw_stop, hard_stop_rsi, 1.0) # 타이트한 쪽 = 진입가에 가까운 = 높은 가격, 최소 1원 보장
|
||||
# 최소 손절폭 보장: ATR이 너무 작으면 노이즈에 즉시 손절 → 최소 -1.0% 확보
|
||||
min_stop = current_price * (1 - settings.DAY_TRADE_MIN_STOP_LOSS_PCT)
|
||||
stop_loss = min(stop_loss, min_stop)
|
||||
# 최소 1.5R 보장: bb_middle이 너무 가까우면 R:R 확보를 위해 목표 상향
|
||||
risk = current_price - stop_loss
|
||||
target = max(bb_middle, current_price + risk * 1.5) # 1.5R 보장
|
||||
|
||||
Reference in New Issue
Block a user