mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 22:18:31 +08:00
BUG: Ensure that the bar count is an integer in minutely mode simple
transforms total_seconds can return a float, which when divided by `60` would still yield a float causing a value error when passed to range.
This commit is contained in:
+2
-1
@@ -338,8 +338,9 @@ class SIDData(object):
|
||||
# 210 minutes in a an early close and 390 in a full day.
|
||||
ms = sum(210 if d in env.early_closes else 390 for d in ds)
|
||||
# Add the number of minutes for today.
|
||||
ms += \
|
||||
ms += int(
|
||||
(now - env.get_open_and_close(now)[0]).total_seconds() / 60
|
||||
)
|
||||
|
||||
cls._minute_bar_cache[days] = ms + 1 # Account for this minute
|
||||
|
||||
|
||||
Reference in New Issue
Block a user