feat(trader): 科创板200股最小手数(分期项切片)—lot_size_for+matcher板块取整
科创板(688/689)最小200股1股递增(不整倍); 主板/创业/北交100整倍; 卖出不取整。 - limit.py 加 lot_size_for(symbol) - matcher cross_order 买入取整按板块(star≥200不取整, 其余100整倍) - routes_paper cta size=lot_size_for(symbol) - test: 688981 买150拒/买250不取整; 主板用例不变; 63/63通过
This commit is contained in:
@@ -145,8 +145,10 @@ def _run_replay(db, aid, req: PaperCreateRequest):
|
||||
cls = get_strategy_class(s.name)
|
||||
if cls is None:
|
||||
continue # 策略不可用(本机无 vnpy_ctastrategy)→ 跳过
|
||||
from sanguo_trader.limit import lot_size_for
|
||||
cta = PaperCtaEngine(s.name, match_session=s.match_session,
|
||||
listing_days=s.listing_days, size=100) # A 股 1 手=100 股
|
||||
listing_days=s.listing_days,
|
||||
size=lot_size_for(s.symbol)) # 主板 100 / 科创 200 股一手
|
||||
vt_symbol = f"{s.symbol}.{guess_exchange(s.symbol).value}"
|
||||
strat = cls(cta, s.name, vt_symbol, s.params) # CtaTemplate(cta_engine, name, vt_symbol, setting)
|
||||
strat.trading = True # 允许 send_order(等价 on_start)
|
||||
|
||||
Reference in New Issue
Block a user