- snap_to_next_tick(ts, tick_size, offset=datetime.timedelta(0))[source]#
Calculate when the trading logic should wake up from the sleep next time.
If cycle duration is unknown do nothing.
ts (datetime) – Current timestamp
tick_size (CycleDuration) – How big leaps we are taking
offset (timedelta) – How many minutes of offset we assume to ensure we have candle data generated after the timestamp
When to wake up from the sleep next time
- Return type: