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


Python event.Event类代码示例

本文整理汇总了Python中vnpy.event.Event的典型用法代码示例。如果您正苦于以下问题:Python Event类的具体用法?Python Event怎么用?Python Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: putSettingEvent

 def putSettingEvent(self, settingName, algoSetting):
     """发出算法配置更新事件"""
     algoSetting['settingName'] = settingName
     
     event = Event(EVENT_ALGO_SETTING)
     event.dict_['data'] = algoSetting
     self.eventEngine.put(event)
开发者ID:aaront2000,项目名称:vnpy,代码行数:7,代码来源:algoEngine.py

示例2: writeCtaLog

 def writeCtaLog(self, content):
     """快速发出CTA模块日志事件"""
     log = VtLogData()
     log.logContent = content
     event = Event(type_=EVENT_CTA_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)   
开发者ID:porfavor,项目名称:vnpy,代码行数:7,代码来源:ctaEngine.py

示例3: writeDrLog

 def writeDrLog(self, content):
     """快速发出日志事件"""
     log = VtLogData()
     log.logContent = content
     event = Event(type_=EVENT_DATARECORDER_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)   
开发者ID:QuantFeng,项目名称:vnpy,代码行数:7,代码来源:drEngine.py

示例4: writeLog

 def writeLog(self, content):
     """快速发出日志事件"""
     print "%s.%s.%s" % (__name__, self.__class__.__name__, get_current_function_name())
     log = VtLogData()
     log.logContent = content
     event = Event(type_=EVENT_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)
开发者ID:QuantFeng,项目名称:vnpy,代码行数:8,代码来源:vtEngine.py

示例5: writeLog

 def writeLog(self, content):
     """快速发出日志事件"""
     log = VtLogData()
     log.logContent = content
     log.gatewayName = 'MAIN_ENGINE'
     event = Event(type_=EVENT_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)        
开发者ID:roccox,项目名称:vnpy,代码行数:8,代码来源:vtEngine.py

示例6: writeLog

 def writeLog(self, content):
     """发出日志事件"""
     log = VtLogData()
     log.logContent = content
     log.gatewayName = 'JAQS_SERVICE'
     event = Event(type_=EVENT_JS_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)         
开发者ID:GenesisOrg,项目名称:vnpy,代码行数:8,代码来源:jsEngine.py

示例7: writeLog

 def writeLog(self, msg):
     """"""
     log = VtLogData()
     log.logContent = msg
     
     event = Event(EVENT_TC_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)
开发者ID:roccox,项目名称:vnpy,代码行数:8,代码来源:tcEngine.py

示例8: writeLog

 def writeLog(self, content):
     """发出日志 """
     log = VtLogData()
     log.logContent = content
     
     event = Event(EVENT_OM_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)         
开发者ID:h1222443,项目名称:vnpy,代码行数:8,代码来源:omEngine.py

示例9: writeLog

 def writeLog(self, content):
     """输出日志"""
     log = VtLogData()
     log.logContent = content
     
     event = Event(EVENT_SPREADTRADING_ALGOLOG)
     event.dict_['data'] = log
     
     self.eventEngine.put(event)
开发者ID:h1222443,项目名称:vnpy,代码行数:9,代码来源:stEngine.py

示例10: putSpreadPosEvent

 def putSpreadPosEvent(self, spread):
     """发出价差持仓事件"""
     event1 = Event(EVENT_SPREADTRADING_POS+spread.name)
     event1.dict_['data'] = spread
     self.eventEngine.put(event1)
 
     event2 = Event(EVENT_SPREADTRADING_POS)
     event2.dict_['data'] = spread
     self.eventEngine.put(event2)         
开发者ID:h1222443,项目名称:vnpy,代码行数:9,代码来源:stEngine.py

示例11: putSpreadTickEvent

 def putSpreadTickEvent(self, spread):
     """发出价差行情更新事件"""
     event1 = Event(EVENT_SPREADTRADING_TICK+spread.name)
     event1.dict_['data'] = spread
     self.eventEngine.put(event1)
     
     event2 = Event(EVENT_SPREADTRADING_TICK)
     event2.dict_['data'] = spread
     self.eventEngine.put(event2)        
开发者ID:h1222443,项目名称:vnpy,代码行数:9,代码来源:stEngine.py

示例12: writeLog

 def writeLog(self, content):
     """记录日志"""
     log = VtLogData()
     log.logContent = content
     log.gatewayName = self.ENGINE_NAME
     
     event = Event(EVENT_RTDSERVICE_LOG)
     event.dict_['data'] = log
     self.eventEngine.put(event)
开发者ID:GenesisOrg,项目名称:vnpy,代码行数:9,代码来源:rtdEngine.py

示例13: cancelOrder

    def cancelOrder(self, cancelOrderReq, gatewayName):
        """对特定接口撤单"""
        gateway = self.getGateway(gatewayName)

        event1 = Event(type_=EVENT_PRE_CANCEL_ORDER)
        event1.dict_['data'] = cancelOrderReq
        self.eventEngine.put(event1)
        
        if gateway:
            gateway.cancelOrder(cancelOrderReq)   
开发者ID:alonemelive,项目名称:vnpy,代码行数:10,代码来源:vtEngine.py

示例14: writeLog

    def writeLog(self, content, algo=None):
        """输出日志"""
        log = VtLogData()
        log.logContent = content
        
        if algo:
            log.gatewayName = algo.algoName

        event = Event(EVENT_ALGO_LOG)
        event.dict_['data'] = log
        self.eventEngine.put(event)
开发者ID:aaront2000,项目名称:vnpy,代码行数:11,代码来源:algoEngine.py

示例15: putStrategyEvent

 def putStrategyEvent(self, name):
     """触发策略状态变化事件(通常用于通知GUI更新)"""
     strategy = self.strategyDict[name]
     d = {k:strategy.__getattribute__(k) for k in strategy.varList}
     
     event = Event(EVENT_CTA_STRATEGY+name)
     event.dict_['data'] = d
     self.eventEngine.put(event)
     
     d2 = {k:str(v) for k,v in d.items()}
     d2['name'] = name
     event2 = Event(EVENT_CTA_STRATEGY)
     event2.dict_['data'] = d2
     self.eventEngine.put(event2)        
开发者ID:chongwei111,项目名称:vnpy,代码行数:14,代码来源:ctaEngine.py


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