fix(trader): volume×size(A股1手=100股) — DoubleMa 真策略回放 filled=3 跑通

This commit is contained in:
2026-07-07 15:15:27 +08:00
parent 17a4801450
commit ba2138e1cf
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -146,14 +146,14 @@ def _run_replay(db, aid, req: PaperCreateRequest):
if cls is None:
continue # 策略不可用(本机无 vnpy_ctastrategy)→ 跳过
cta = PaperCtaEngine(s.name, match_session=s.match_session,
listing_days=s.listing_days)
listing_days=s.listing_days, size=100) # A 股 1 手=100 股
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
try:
from vnpy.trader.utility import ArrayManager
if not hasattr(strat, "am"):
strat.am = ArrayManager(100)
strat.am = ArrayManager(20) # 默认 100 根才 inited,短区间不够;用 20 兼容
except Exception:
pass
cta.set_strategy(strat)