当前位置: 首页>>代码示例>>Python>>正文


Python TicksUtile.backupTickfiles方法代码示例

本文整理汇总了Python中TicksUtile.backupTickfiles方法的典型用法代码示例。如果您正苦于以下问题:Python TicksUtile.backupTickfiles方法的具体用法?Python TicksUtile.backupTickfiles怎么用?Python TicksUtile.backupTickfiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TicksUtile的用法示例。


在下文中一共展示了TicksUtile.backupTickfiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: dload

# 需要导入模块: import TicksUtile [as 别名]
# 或者: from TicksUtile import backupTickfiles [as 别名]
def dload(symlist,barlist,strikelist,expirylist):
    print symlist
    global bar, sym
    trans_id = 0
    strikelist = [1]
    expirylist  = [1]
    for sym in symlist:
        print sym
        for bar in barlist:
            for strike in strikelist:
                for expiry in expirylist:
                    fname = DataDown+ today + '.' + sym + '.'  + bar.replace(' ','')+'.ddload.csv'
                    TicksUtile.backupTickfiles(fname)
                    ##########
                    duration = bardict[bar]
                    barspaced = bardictspaced[bar]
                    contract = ibutiles.create_contract(sym,strike,expiry)
                    ticktype = ticktypedict[sym]
                    print bar, sym, duration,ticktype, barspaced, strike, expiry
                    tws_conn.reqHistoricalData(trans_id, contract, '', duration, barspaced, ticktype, 0, 2)
                    trans_id = trans_id + 1  
                    sleep(10)
                    
                    tmp = DataDown+ today + '.' + 'tempdlfile' + '.ddload.csv'
                    fname = DataDown+ today + '.' + sym + '.'  + bar.replace(' ','')+'.ddload.csv'
                    shutil.copyfile(tmp,fname)
                    TicksUtile.throw_out_lastbar(fname)
开发者ID:reprior123,项目名称:TraderSoftwareRP,代码行数:29,代码来源:IBHistlESFDAX1min.py

示例2: reply_handler

# 需要导入模块: import TicksUtile [as 别名]
# 或者: from TicksUtile import backupTickfiles [as 别名]
from ib.opt import Connection, message   ##??
#############################
global  sym, symbol_list, symdict
########################################
symbol_list = symlistTicker
symTickerIddict ={}
contractdict ={}
symid=0
### backup tick files ####
print symbol_list
for sym in symbol_list:
    symid+=1
    symTickerIddict.update({str(symid) : sym})
    for filename in ['.RTticks.csv','.RTMktDepth.csv','.RTtickData.csv']:
        fname1 = DataDown+ today + '.' + sym  +filename
        TicksUtile.backupTickfiles(fname1)
##        flush file
        rpu_rp.WriteArrayToCsvfile(fname1,[])
##flush tick files where necessary   
rpu_rp.WriteArrayToCsvfile(TMP +'replys.RTticks',[])
rpu_rp.WriteArrayToCsvfile(TMP +'replys.RTtickDOMs',[])
#################
onerow =[]
current_time = datetime.now().time()
timenow=current_time.isoformat()
################
def reply_handler(msg):
    msgarray = (str(msg)).split()
    print msgarray, 'rawmessg'
    reqid=(msgarray[1]).split('=')[1].replace(',','')
    fieldnum = (msgarray[2]).split('=')[1].replace(',','')   
开发者ID:reprior123,项目名称:TraderSoftwareRP,代码行数:33,代码来源:TickerStart+-+Copy.py


注:本文中的TicksUtile.backupTickfiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。