DB오류 처리중
This commit is contained in:
@@ -281,18 +281,20 @@ def check_exit_signal(
|
||||
threshold = 0.7 if regime == MarketRegime.BULL else 0.5
|
||||
|
||||
# ── 2. 1차 익절: 아직 1차 안 했을 때 ──────────────────────────
|
||||
# 최소 1×ATR 수익 조건 추가 — 수수료+슬리피지(~0.35%) 이하 수익에서 조기 청산 방지
|
||||
min_profit_price = entry_price + 1.0 * atr
|
||||
if remaining_pct > threshold:
|
||||
if 55 <= rsi <= 65 and close > bb_middle:
|
||||
if 55 <= rsi <= 65 and close > bb_middle and close >= min_profit_price:
|
||||
if regime == MarketRegime.BULL:
|
||||
return ExitSignal(
|
||||
action="SELL_PARTIAL",
|
||||
reason=f"1차 익절(Bull 30%): RSI({rsi:.1f}) 55~65 회복 + BB중앙({bb_middle:.0f}) 상회",
|
||||
reason=f"1차 익절(Bull 30%): RSI({rsi:.1f}) 55~65 회복 + BB중앙({bb_middle:.0f}) 상회 + 1×ATR({atr:.0f}) 수익",
|
||||
sell_pct=0.30,
|
||||
)
|
||||
else:
|
||||
return ExitSignal(
|
||||
action="SELL_PARTIAL",
|
||||
reason=f"1차 익절(Bear 50%): RSI({rsi:.1f}) 55~65 회복 + BB중앙({bb_middle:.0f}) 상회",
|
||||
reason=f"1차 익절(Bear 50%): RSI({rsi:.1f}) 55~65 회복 + BB중앙({bb_middle:.0f}) 상회 + 1×ATR({atr:.0f}) 수익",
|
||||
sell_pct=0.50,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user