本文整理汇总了Python中EventEngine.DyEvent.data['codes']方法的典型用法代码示例。如果您正苦于以下问题:Python DyEvent.data['codes']方法的具体用法?Python DyEvent.data['codes']怎么用?Python DyEvent.data['codes']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventEngine.DyEvent
的用法示例。
在下文中一共展示了DyEvent.data['codes']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _histDaysMannualUpdate
# 需要导入模块: from EventEngine import DyEvent [as 别名]
# 或者: from EventEngine.DyEvent import data['codes'] [as 别名]
def _histDaysMannualUpdate(self):
if self._histDaysMannualUpdateAction.text() == '停止':
self._mainEngine._info.print('停止股票(指数)历史日线数据手动更新...', DyLogData.ind)
# change UI
self._stopRunningMutexAction()
event = DyEvent(DyEventType.stopUpdateStockHistDaysReq)
self._mainEngine.eventEngine.put(event)
else: # 开始手动更新
data = {}
if DyStockDataHistDaysManualUpdateDlg(data, self).exec_():
self._mainEngine._info.print('开始股票(指数,基金)历史日线数据手动更新[{0}, {1}]...'.format(data['startDate'], data['endDate']), DyLogData.ind)
# change UI
self._startRunningMutexAction(self._histDaysMannualUpdateAction)
event = DyEvent(DyEventType.updateStockHistDays)
event.data = data
event.data['codes'] = DyStockCommon.getDyStockCodes(event.data['codes'])
# 是否要更新指数的日线数据
if event.data['index']:
if event.data['codes'] is None:
event.data['codes'] = []
event.data['codes'].extend(list(DyStockCommon.indexes))
self._mainEngine.eventEngine.put(event)
示例2: _histTicksMannualUpdate
# 需要导入模块: from EventEngine import DyEvent [as 别名]
# 或者: from EventEngine.DyEvent import data['codes'] [as 别名]
def _histTicksMannualUpdate(self):
if self._histTicksMannualUpdateAction.text() == '停止':
self._mainEngine._info.print('停止股票(基金)历史分笔数据手动更新...', DyLogData.ind)
# change UI
self._stopRunningMutexAction()
event = DyEvent(DyEventType.stopUpdateStockHistTicksReq)
self._mainEngine.eventEngine.put(event)
else: # 开始手动更新
data = {}
codeLabelText = '股票(基金)代码(空代表所有代码), e.g. 600016,510300,002213,...'
if DyCodeDateDlg(codeLabelText, data, self).exec_():
self._mainEngine._info.print('开始股票(基金)历史分笔数据手动更新...', DyLogData.ind)
# change UI
self._startRunningMutexAction(self._histTicksMannualUpdateAction)
event = DyEvent(DyEventType.updateStockHistTicks)
event.data = data
event.data['codes'] = DyStockCommon.getDyStockCodes(event.data['codes'])
self._mainEngine.eventEngine.put(event)