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


Python TicksUtile.clean_RTTick5secBars方法代码示例

本文整理汇总了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))
开发者ID:reprior123,项目名称:TraderSoftwareRP,代码行数:13,代码来源:LiveTicker5Sec.py

示例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))
开发者ID:reprior123,项目名称:TraderSoftwareRP,代码行数:25,代码来源:TickerStart+-+Copy.py


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