fix ipo bug
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user