VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 3
声望: 0

def process_underlying_tick_event(self, event: Event) -> None:
""""""
tick: TickData = event.data

    for algo in self.underlying_algo_map[tick.vt_symbol]:
        algo.on_underlying_tick(algo)

def process_option_tick_event(self, event: Event) -> None:
    """"""
    tick: TickData = event.data

    algo = self.algos[tick.vt_symbol]
    algo.on_option_tick(algo)

这两个是否应该是tick

Member
avatar
加入于:
帖子: 311
声望: 17

看了下确实是BUG...因为on_underlying_tick/on_option_tick都没有具体用到tick对象,所以没有触发。

发个PR修复下。

Member
avatar
加入于:
帖子: 3
声望: 0

另外OptionAlgoEngine里面有type写错了,self.underlying_algo_map: Dict[str, ElectronicEyeAlgo] = defaultdict(list),可能应该是self.underlying_algo_map: Dict[str, List[ElectronicEyeAlgo]] = defaultdict(list),倒是不影响运行
class OptionAlgoEngine:
def init(self, option_engine: OptionEngine):
""""""
self.option_engine = option_engine
self.main_engine = option_engine.main_engine
self.event_engine = option_engine.event_engine

    self.algos: Dict[str, ElectronicEyeAlgo] = {}
    self.active_algos: Dict[str, ElectronicEyeAlgo] = {}

    self.underlying_algo_map: Dict[str, ElectronicEyeAlgo] = defaultdict(list)
    self.order_algo_map: Dict[str, ElectronicEyeAlgo] = {}

    self.register_event()
Super Moderator
avatar
加入于:
帖子: 529
声望: 43

对的,应该是列表,可以发个pr修复。

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】