本文整理汇总了Python中TicksUtile.throw_out_lastbar方法的典型用法代码示例。如果您正苦于以下问题:Python TicksUtile.throw_out_lastbar方法的具体用法?Python TicksUtile.throw_out_lastbar怎么用?Python TicksUtile.throw_out_lastbar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TicksUtile
的用法示例。
在下文中一共展示了TicksUtile.throw_out_lastbar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dload
# 需要导入模块: import TicksUtile [as 别名]
# 或者: from TicksUtile import throw_out_lastbar [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)