From 4f94988a6e678aeaad5d13dbb0447e232fdc0f57 Mon Sep 17 00:00:00 2001 From: xldistance <819873074@qq.com> Date: Fri, 7 Jun 2019 16:00:13 +0800 Subject: [PATCH] =?UTF-8?q?ctaengine=E4=BB=B7=E6=A0=BC=E5=8F=96=E6=95=B4?= =?UTF-8?q?=E5=88=B0=E6=9C=80=E5=B0=8F=E4=BB=B7=E6=A0=BC=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ctaengine价格取整到最小价格变动 --- vnpy/app/cta_strategy/engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnpy/app/cta_strategy/engine.py b/vnpy/app/cta_strategy/engine.py index e17f49ec..fd3d3c46 100644 --- a/vnpy/app/cta_strategy/engine.py +++ b/vnpy/app/cta_strategy/engine.py @@ -36,7 +36,7 @@ from vnpy.trader.constant import ( Offset, Status ) -from vnpy.trader.utility import load_json, save_json, extract_vt_symbol +from vnpy.trader.utility import load_json, save_json, extract_vt_symbol,round_to from vnpy.trader.database import database_manager from vnpy.trader.rqdata import rqdata_client @@ -464,7 +464,7 @@ class CtaEngine(BaseEngine): if not contract: self.write_log(f"委托失败,找不到合约:{strategy.vt_symbol}", strategy) return "" - + price = round_to(price,contract.pricetick) if stop: if contract.stop_supported: return self.send_server_stop_order(strategy, contract, direction, offset, price, volume, lock)