diff --git a/vnpy/app/cta_strategy/backtesting.py b/vnpy/app/cta_strategy/backtesting.py index 85758625..1ee72fc3 100644 --- a/vnpy/app/cta_strategy/backtesting.py +++ b/vnpy/app/cta_strategy/backtesting.py @@ -547,7 +547,8 @@ class BacktestingEngine: self.pricetick, self.capital, self.end, - self.mode + self.mode, + self.inverse ))) results.append(result) @@ -607,6 +608,7 @@ class BacktestingEngine: global ga_capital global ga_end global ga_mode + global ga_inverse ga_target_name = target_name ga_strategy_class = self.strategy_class @@ -621,6 +623,7 @@ class BacktestingEngine: ga_capital = self.capital ga_end = self.end ga_mode = self.mode + ga_inverse = self.inverse # Set up genetic algorithem toolbox = base.Toolbox() @@ -1212,7 +1215,8 @@ def _ga_optimize(parameter_values: tuple): ga_pricetick, ga_capital, ga_end, - ga_mode + ga_mode, + ga_inverse ) return (result[1],)