當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。