diff --git a/vnpy/trader/object.py b/vnpy/trader/object.py index 800f54f4..a13acc0a 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, Product, OptionType, OrderType +from .constant import Direction, Exchange, Interval, Offset, Status, Product, OptionType, OrderType, Color ACTIVE_STATUSES = set([Status.SUBMITTING, Status.NOTTRADED, Status.PARTTRADED, Status.CANCELLING]) @@ -108,6 +108,7 @@ class RenkoBarData(BarData): """ Renko bar data of a certain trading period. """ + color: Color = Color.EQUAL # bar的颜色 seconds: int = 0 # 当前Bar的秒数(针对RenkoBar) high_seconds: int = -1 # 当前Bar的上限秒数 low_seconds: int = -1 # 当前bar的下限秒数 @@ -117,7 +118,6 @@ class RenkoBarData(BarData): low_time = None # 最后一次进入低位区域的时间 high_time = None # 最后一次进入高位区域的时间 - @dataclass class OrderData(BaseData): """