ls증권 히스토리 구독 넣음
This commit is contained in:
@@ -50,7 +50,14 @@ def _pref_digit_suffixes() -> FrozenSet[str]:
|
||||
|
||||
|
||||
def is_preferred_code(code: str) -> bool:
|
||||
"""종목코드만으로 우선주 여부 (name 없어도 판단)."""
|
||||
"""종목코드만으로 우선주·특수코드 여부 (name 없어도 판단).
|
||||
|
||||
KRX 단축코드:
|
||||
- 끝자리 5/7/9 → 구형 우선주
|
||||
- 끝자리 알파벳 → 신형 우선주
|
||||
- 코드 중 알파벳 (예: 0039P0, 0030R0) → 신형 우선주·특수종목
|
||||
(끝자리만 보면 보통주 0 으로 오인 → 캔들/시세 0 폭주)
|
||||
"""
|
||||
c = (code or "").strip()
|
||||
if len(c) < 1:
|
||||
return False
|
||||
@@ -58,7 +65,12 @@ def is_preferred_code(code: str) -> bool:
|
||||
if last in _pref_digit_suffixes():
|
||||
return True
|
||||
# K,L,M… 알파벳 끝 = 신형 우선주 코드
|
||||
if get_env_bool("NON_STOCK_EXCLUDE_ALPHA_SUFFIX", True) and last.isalpha():
|
||||
if not get_env_bool("NON_STOCK_EXCLUDE_ALPHA_SUFFIX", True):
|
||||
return False
|
||||
if last.isalpha():
|
||||
return True
|
||||
# 중간 알파벳 (0039P0 등) — 동일 토글. 끄려면 NON_STOCK_EXCLUDE_ALPHA_SUFFIX=false
|
||||
if any(ch.isalpha() for ch in c):
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -112,6 +124,9 @@ def is_non_stock(name: str, code: str) -> bool:
|
||||
nm = name.upper()
|
||||
if "스팩" in name or "SPAC" in nm:
|
||||
return True
|
||||
# 리츠·부동산펀드 (시세 TR 키 이슈·봇 매매 비대상)
|
||||
if "리츠" in name or "REIT" in nm:
|
||||
return True
|
||||
# 우선주 표기 (우 / 우B / 우C …)
|
||||
if name.endswith("우") or "우B" in name or "우C" in name or name.endswith("(전환)"):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user