[Mod] 修正typehint

This commit is contained in:
nanoric 2018-10-23 21:20:30 -04:00
parent b702f77af9
commit d68529dacd

View File

@ -184,6 +184,7 @@ class VtTradeData(VtBaseData):
trade.volume = tradeVolume trade.volume = tradeVolume
trade.tradeTime = datetime.now().strftime('%H:%M:%S') trade.tradeTime = datetime.now().strftime('%H:%M:%S')
return trade return trade
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@staticmethod @staticmethod
def createFromOrderData(order, def createFromOrderData(order,
@ -240,13 +241,19 @@ class VtOrderData(VtBaseData):
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@staticmethod @staticmethod
def createFromGateway(gateway, orderId, symbol, exchange, price, volume, direction, def createFromGateway(gateway, # type: VtGateway
offset=EMPTY_UNICODE, orderId, # type: str
tradedVolume=EMPTY_INT, symbol, # type: str
status=constant.STATUS_UNKNOWN, exchange, # type: str
orderTime=EMPTY_UNICODE, price, # type: float
cancelTime=EMPTY_UNICODE, volume, # type: int
): # type: (VtGateway, str, str, str, float, float, str, str, int, str, str, str)->VtOrderData direction, # type: str
offset=EMPTY_UNICODE, # type: str
tradedVolume=EMPTY_INT, # type: int
status=constant.STATUS_UNKNOWN, # type: str
orderTime=EMPTY_UNICODE, # type: str
cancelTime=EMPTY_UNICODE, # type: str
): # type: (...)->VtOrderData
vtOrder = VtOrderData() vtOrder = VtOrderData()
vtOrder.gatewayName = gateway.gatewayName vtOrder.gatewayName = gateway.gatewayName
vtOrder.symbol = symbol vtOrder.symbol = symbol
@ -291,12 +298,16 @@ class VtPositionData(VtBaseData):
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@staticmethod @staticmethod
def createFromGateway(gateway, exchange, symbol, direction, position, def createFromGateway(gateway, # type: VtGateway
frozen=EMPTY_INT, exchange, # type: str
price=EMPTY_FLOAT, symbol, # type: str
yestordayPosition=EMPTY_INT, direction, # type: str
profit=EMPTY_FLOAT position, # type: int
): # type: (VtGateway, str, str, str, float, int, float, int, float)->VtPositionData frozen=EMPTY_INT, # type: int
price=EMPTY_FLOAT, # type: float
yestordayPosition=EMPTY_INT, # type: int
profit=EMPTY_FLOAT # type: float
): # type: (...)->VtPositionData
vtPosition = VtPositionData() vtPosition = VtPositionData()
vtPosition.gatewayName = gateway.gatewayName vtPosition.gatewayName = gateway.gatewayName
vtPosition.symbol = symbol vtPosition.symbol = symbol
@ -421,7 +432,6 @@ class VtContractData(VtBaseData):
return d return d
######################################################################## ########################################################################
class VtHistoryData(object): class VtHistoryData(object):
"""K线时间序列数据""" """K线时间序列数据"""
@ -531,6 +541,3 @@ class VtSingleton(type):
cls._instances[cls] = super(VtSingleton, cls).__call__(*args, **kwargs) cls._instances[cls] = super(VtSingleton, cls).__call__(*args, **kwargs)
return cls._instances[cls] return cls._instances[cls]