From f94e078a7580066ec92c465f79421b4112fe33e5 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 22 Feb 2019 14:11:47 +0800 Subject: [PATCH] [Fix]bug in send_order of CtaEngine --- vnpy/app/cta_strategy/engine.py | 2 +- vnpy/trader/object.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vnpy/app/cta_strategy/engine.py b/vnpy/app/cta_strategy/engine.py index 770bf081..e3211baf 100644 --- a/vnpy/app/cta_strategy/engine.py +++ b/vnpy/app/cta_strategy/engine.py @@ -278,7 +278,7 @@ class CtaEngine(BaseEngine): price=price, volume=volume, ) - vt_orderid = self.main_engine.send_limit_order( + vt_orderid = self.main_engine.send_order( req, contract.gateway_name) # Save relationship between orderid and strategy. diff --git a/vnpy/trader/object.py b/vnpy/trader/object.py index c2e112d0..ab3ef5d7 100644 --- a/vnpy/trader/object.py +++ b/vnpy/trader/object.py @@ -6,7 +6,7 @@ from dataclasses import dataclass from datetime import datetime from logging import INFO -from .constant import Direction, Exchange, Interval, Offset, Status +from .constant import Direction, Exchange, Interval, Offset, Status, Product, OptionType ACTIVE_STATUSES = set([Status.SUBMITTING, Status.NOTTRADED, Status.PARTTRADED]) @@ -228,13 +228,13 @@ class ContractData(BaseData): symbol: str exchange: Exchange name: str - product: str + product: Product size: int pricetick: float option_strike: float = 0 option_underlying: str = "" # vt_symbol of underlying contract - option_type: str = "" + option_type: OptionType = None option_expiry: datetime = None def __post_init__(self):