wondertrader / wtpy

wtpy是基于wondertrader为底层的针对python的子框架
MIT License
926 stars 259 forks source link

WtEngine=>add_sel_strategy=>create_sel_context传参错误 #107

Closed olawonzhu closed 1 year ago

olawonzhu commented 1 year ago
def add_sel_strategy(self, strategy:BaseSelStrategy, date:int, time:int, period:str, slippage:int = 0):
    #if isinstance(strategy, EtSelStrategy):
    #    strategy.setEngine(self)
    id = self.__wrapper__.create_sel_context(strategy.name(), date, time, period, slippage)
    self.__sel_ctxs__[id] = SelContext(id, strategy, self.__wrapper__, self)

slippage作为第五个参数传入,但是WtWrapper里定义的是第七个

def create_sel_context(self, name:str, date:int, time:int, period:str, trdtpl:str = 'CHINA', session:str = "TRADING", slippage:int = 0) -> int:
wondertrader commented 1 year ago

dev已修复,正式版>=0.9.8