ls증권 히스토리 구독 넣음
This commit is contained in:
@@ -277,11 +277,26 @@ class TailCatchStrategy(BaseStrategy):
|
||||
},
|
||||
}
|
||||
|
||||
# align — 다음 3분봉 시가 시장가
|
||||
# align — 다음 3분봉: RAM 첫 틱 → 없으면 시가 (시장가 계산용)
|
||||
align_on = get_env_bool("SHORT_LIVE_BACKTEST_ALIGN", True)
|
||||
entry_open = float(sig.get("entry_price", 0) or 0)
|
||||
entry_src = "ohlc_open"
|
||||
_ebk = str(sig.get("entry_bar_key") or "")[:12]
|
||||
_defer = self._defer_mid_enroll_entry(
|
||||
code, _ebk, int(self.candle_tf or 3),
|
||||
)
|
||||
if _defer:
|
||||
self.logger.info("🔍 [%s] %s(%s)", _defer, name, code)
|
||||
return None
|
||||
if align_on and entry_open > 0:
|
||||
curr_price = entry_open
|
||||
from kis_trader.engine.tail_tick_replay import live_align_entry_price
|
||||
curr_price, entry_src = live_align_entry_price(
|
||||
self.ws,
|
||||
code,
|
||||
entry_open,
|
||||
entry_bar_key=_ebk,
|
||||
tf_min=int(self.candle_tf or 3),
|
||||
)
|
||||
else:
|
||||
curr_price = float(candles[-1]["close"])
|
||||
wsd = self.ws.get_price(code)
|
||||
@@ -328,10 +343,11 @@ class TailCatchStrategy(BaseStrategy):
|
||||
atr_entry = curr_price * 0.01
|
||||
|
||||
self.logger.info(
|
||||
"🎯 [SHORT 시그널] %s(%s) price=%.0f qty=%d pat=%s tail=%.2f rec=%.0f%% RSI=%.1f",
|
||||
"🎯 [SHORT 시그널] %s(%s) price=%.0f qty=%d pat=%s tail=%.2f rec=%.0f%% RSI=%.1f entry_src=%s",
|
||||
name, code, curr_price, qty,
|
||||
sig.get("pattern", "hammer"),
|
||||
sig.get("tail_ratio", 0), sig.get("recovery_pos", 0) * 100, sig.get("rsi_val", 0),
|
||||
entry_src,
|
||||
)
|
||||
return {
|
||||
"code": code,
|
||||
|
||||
Reference in New Issue
Block a user