zipline-live / zipline

Zipline-Live, a Pythonic Algorithmic Trading Library
http://www.zipline-live.io/
Apache License 2.0
394 stars 65 forks source link

Potential event miss #99

Open umitanuki opened 6 years ago

umitanuki commented 6 years ago

https://github.com/zipline-live/zipline/blob/master/zipline/gens/realtimeclock.py#L87

This module is using the local time but technically it can miss some events that happen once a day like market close, if one iteration takes so long and the next chance to check the local clock is beyond this boundary.

peterfabakker commented 6 years ago

correct, in my head there are a few potential solutions: 1) we kill processes that are running longer than a minute (Q solution) 2) we allow multiple events to be launched independently (execution I dont know) 3) we simply queue all events and have a separate process that checks whether they're are executed and if not we launch them after the tardy event....

more ideas?

umitanuki commented 6 years ago

Good to know Q kills it if it hangs. That sounds reasonable when it comes to Q who hosts bunch of algos. In zipline-live, I think the assumption is that it's this developer's responsibility that it doesn't hang and should be ok to take as long as it needs. I like 2. which should be simpler than 3. and anyway it is an event-driven system that doesn't guarantee necessarily time-correctness