本文整理汇总了Python中TicksUtile.clean_RTTick5secBars方法的典型用法代码示例。如果您正苦于以下问题:Python TicksUtile.clean_RTTick5secBars方法的具体用法?Python TicksUtile.clean_RTTick5secBars怎么用?Python TicksUtile.clean_RTTick5secBars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TicksUtile
的用法示例。
在下文中一共展示了TicksUtile.clean_RTTick5secBars方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RTBar_reply_handler
# 需要导入模块: import TicksUtile [as 别名]
# 或者: from TicksUtile import clean_RTTick5secBars [as 别名]
def RTBar_reply_handler(msg):
if msg.typeName == 'realtimeBar':
reqid=(((str(msg)).split()[1]).split('=')[1]).replace(',','')
sym=symTickerIddict[reqid]
onerow = (str(msg)).split(',')
cleanonerow = TicksUtile.clean_RTTick5secBars(onerow,sym)
rpu_rp.WriteArrayToCsvfileAppend(DataDown +today+'.'+sym+ '.RTticks.csv',[cleanonerow])
rpu_rp.WriteArrayToCsvfile(DataDown +today+'.'+sym+ '.RTtickslastquote.csv',[cleanonerow])
else:
print str(msg)
rpu_rp.WriteStringsToFileAppend(TMP +'replys.RTticks',str(msg))
示例2: reply_handler
# 需要导入模块: import TicksUtile [as 别名]
# 或者: from TicksUtile import clean_RTTick5secBars [as 别名]
def reply_handler(msg):
msgarray = (str(msg)).split()
print msgarray, 'rawmessg'
reqid=(msgarray[1]).split('=')[1].replace(',','')
fieldnum = (msgarray[2]).split('=')[1].replace(',','')
sym=symTickerIddict[reqid]
onerow = (str(msg)).split(',')
print onerow,'onerow split by comma'
timenow= datetime.now().time().isoformat()
print msg.typeName, sym, timenow
if msg.typeName == 'realtimeBar':
cleanonerow = TicksUtile.clean_RTTick5secBars(onerow,sym)
rpu_rp.WriteArrayToCsvfileAppend(DataDown +today+'.'+sym+ '.RTticks.csv',[cleanonerow])
rpu_rp.WriteArrayToCsvfile(DataDown +today+'.'+sym+ '.RTtickslastquote.csv',[cleanonerow])
######## elif msg.typeName == 'tickString' or msg.typeName == 'tickSize' or msg.typeName == 'tickPrice' :
######## onerow.append(timenow)
######## rpu_rp.WriteArrayToCsvfileAppend(DataDown +today+'.'+sym+ '.RTtickData.csv',[onerow])
######## elif msg.typeName == 'updateMktDepth':
######## onerow.append(timenow)
######## rpu_rp.WriteArrayToCsvfileAppend(DataDown +today+'.'+sym+ '.RTMktDepth.csv',[onerow])
else:
print str(msg)
rpu_rp.WriteStringsToFileAppend(TMP +'replys.RTticks',str(msg))