backtrader2/backtrader

yahoo feed fromdate

Closed this issue · 0 comments

As mentioned by borutF here:
https://community.backtrader.com/topic/3917/setting-only-the-fromdate-parameter-in-yahoo-data-feed
The fromdate is not taken into accont when todate is not set

  if self.p.todate is not None:
              period2 = (self.p.todate.date() - posix).total_seconds()
              urlargs.append('period2={}'.format(int(period2)))
  
  if self.p.todate is not None:
              period1 = (self.p.fromdate.date() - posix).total_seconds()
              urlargs.append('period1={}'.format(int(period1)))


yahoo.py