fix ipo bug

This commit is contained in:
2026-09-16 23:16:32 +08:00
parent 04daeff141
commit 33693adb66
2 changed files with 15 additions and 0 deletions

View File

@@ -102,6 +102,10 @@ def AutoBuyIpo() -> int:
orders = client.orders() # 查询失败时不提交,不能将未知当作无委托。
for item in candidates:
try:
stock = item.get('stock') if isinstance(item, dict) else None
if isinstance(stock, str) and re.fullmatch(r'[0-9]{6}\.BJ', stock.strip()):
logging.info('[IPO] %s 已跳过:北交所不在申购范围内', stock.strip())
continue
stock, price, volume = _candidate(item)
submitted += _subscribe(client, orders, account, now.strftime('%Y%m%d'),
stock, price, volume)