Bug in timers?
-
Using daily dataset and several SMA over short & long period, I get normal values when using the next() function to calculate values and execute trades, but if I place a timer and move the logic from next() into notify_timer(), for example:
self.add_timer(
when=dtm.time(9, 31),
offset=dtm.timedelta(),
repeat=dtm.timedelta(),
weekdays=[],
)The timer executes, but there are gaps of several days here and there in the SMA data with the exact same dataset.
Why notify_timer() doesn't see the precalculated values of the SMA properly the same way next() sees them?Here is an example using Yahoo daily dataset of SPY:
2020-05-20, DATA
2020-05-21, DATA
2020-05-22, DATA
2020-05-26 NO DATA (timer doesn't execute?)
2020-05-27, DATA
2020-05-28 NO DATA (timer doesn't execute?)
2020-05-29, DATAWhere as if the logic is in next(), all days have data