[update] RenkoBarData,增加Color

This commit is contained in:
msincenselee 2020-02-27 11:34:07 +08:00
parent 78c30de2f4
commit 4dd0f24ede

View File

@ -6,7 +6,7 @@ from dataclasses import dataclass
from datetime import datetime from datetime import datetime
from logging import INFO 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]) 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. Renko bar data of a certain trading period.
""" """
color: Color = Color.EQUAL # bar的颜色
seconds: int = 0 # 当前Bar的秒数针对RenkoBar) seconds: int = 0 # 当前Bar的秒数针对RenkoBar)
high_seconds: int = -1 # 当前Bar的上限秒数 high_seconds: int = -1 # 当前Bar的上限秒数
low_seconds: int = -1 # 当前bar的下限秒数 low_seconds: int = -1 # 当前bar的下限秒数
@ -117,7 +118,6 @@ class RenkoBarData(BarData):
low_time = None # 最后一次进入低位区域的时间 low_time = None # 最后一次进入低位区域的时间
high_time = None # 最后一次进入高位区域的时间 high_time = None # 最后一次进入高位区域的时间
@dataclass @dataclass
class OrderData(BaseData): class OrderData(BaseData):
""" """