Skip to content

Commit

Permalink
fix bug occurred when force run init when pt resume
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuizi7 committed Sep 4, 2018
1 parent 1ee782e commit 08ff0f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rqalpha/core/strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def before_trading(self, event):

@run_when_strategy_not_hold
def handle_bar(self, event):
if self._force_run_before_trading:
if self._force_run_before_trading and (self._before_trading is not None):
self.before_trading(event)
else:
bar_dict = event.bar_dict
Expand All @@ -91,7 +91,7 @@ def handle_bar(self, event):

@run_when_strategy_not_hold
def handle_tick(self, event):
if self._force_run_before_trading:
if self._force_run_before_trading and (self._before_trading is not None):
self.before_trading(event)
else:
tick = event.tick
Expand Down

0 comments on commit 08ff0f5

Please sign in to comment.