Skip to content

Commit

Permalink
Cover case in which result in high-level overridden operations have m…
Browse files Browse the repository at this point in the history
…ultiple lines and wer not be taken into account for minimum period calculations
  • Loading branch information
backtrader committed Apr 27, 2019
1 parent 8559898 commit fc9298f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backtrader/linebuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,8 @@ def dopreinit(cls, _obj, *args, **kwargs):
# Do not produce anything until the operation lines produce something
_minperiods = [x._minperiod for x in args if isinstance(x, LineSingle)]

if not _minperiods:
mlines = [x.lines[0] for x in args if isinstance(x, LineMultiple)]
_minperiods = [x._minperiod for x in mlines]
mlines = [x.lines[0] for x in args if isinstance(x, LineMultiple)]
_minperiods += [x._minperiod for x in mlines]

_minperiod = max(_minperiods or [1])

Expand Down

0 comments on commit fc9298f

Please sign in to comment.