[Mod]部分3.0代码兼容性修改

This commit is contained in:
vn.py 2018-05-27 22:18:56 +08:00
parent 010d83eabb
commit 926aad586a
6 changed files with 13 additions and 20 deletions

View File

@ -5,7 +5,7 @@ import os
import traceback
# 默认设置
from chinese import text
from .chinese import text
# 是否要使用英文
from vnpy.trader.vtGlobal import globalSetting

View File

@ -1,7 +1,7 @@
# encoding: UTF-8
from rmEngine import RmEngine
from uiRmWidget import RmEngineManager
from .rmEngine import RmEngine
from .uiRmWidget import RmEngineManager
appName = 'RiskManager'
appDisplayName = u'风险管理'

View File

@ -5,7 +5,7 @@ import os
import traceback
# 默认设置
from chinese import text
from .chinese import text
# 是否要使用英文
from vnpy.trader.vtGlobal import globalSetting

View File

@ -1,7 +1,7 @@
# encoding: UTF-8
from vnpy.trader import vtConstant
from futuGateway import FutuGateway
from .futuGateway import FutuGateway
gatewayClass = FutuGateway
gatewayName = 'FUTU'

View File

@ -12,10 +12,14 @@ from datetime import datetime
from copy import copy
import futuquant as ft
from futuquant.open_context import (RET_ERROR, RET_OK, PriceRegularMode,
StockQuoteHandlerBase, OrderBookHandlerBase,
USTradeOrderHandlerBase, USTradeDealHandlerBase,
HKTradeOrderHandlerBase, HKTradeDealHandlerBase)
from futuquant import (RET_ERROR, RET_OK, PriceRegularMode,
StockQuoteHandlerBase, OrderBookHandlerBase,
TradeOrderHandlerBase, TradeDealHandlerBase)
#from futuquant.open_context import (RET_ERROR, RET_OK, PriceRegularMode,
#StockQuoteHandlerBase, OrderBookHandlerBase,
#USTradeOrderHandlerBase, USTradeDealHandlerBase,
#HKTradeOrderHandlerBase, HKTradeDealHandlerBase)
from vnpy.trader.vtGateway import *
from vnpy.trader.vtConstant import GATEWAYTYPE_INTERNATIONAL

View File

@ -872,8 +872,6 @@ class PositionDetail(object):
self.shortPnl = pos.positionProfit
self.shortPrice = pos.price
#self.output()
#----------------------------------------------------------------------
def updateOrderReq(self, req, vtOrderID):
"""发单更新"""
@ -986,15 +984,6 @@ class PositionDetail(object):
self.longPosFrozen = self.longYdFrozen + self.longTdFrozen
self.shortPosFrozen = self.shortYdFrozen + self.shortTdFrozen
#----------------------------------------------------------------------
def output(self):
""""""
print self.vtSymbol, '-'*30
print 'long, total:%s, td:%s, yd:%s' %(self.longPos, self.longTd, self.longYd)
print 'long frozen, total:%s, td:%s, yd:%s' %(self.longPosFrozen, self.longTdFrozen, self.longYdFrozen)
print 'short, total:%s, td:%s, yd:%s' %(self.shortPos, self.shortTd, self.shortYd)
print 'short frozen, total:%s, td:%s, yd:%s' %(self.shortPosFrozen, self.shortTdFrozen, self.shortYdFrozen)
#----------------------------------------------------------------------
def convertOrderReq(self, req):
"""转换委托请求"""