All my three algorithms running in the April's Quantopian Open have been excluded from the contest due to a runtime error. The algos are actually the same running with different parameters, in all three cases the error happens on the same line and is a
TimeoutException: Too much time spent in handle_data call.
The code where the algorithm ran into the exception is the middle line of
closes = history(_tail, _frequency, "price")
highs = history(_tail, _frequency, "high")
lows = history(_tail, _frequency, "low")
This is the very start of my handle function, and I'm feetching those history dataframes in order to evaluate ATR.
I've been suggested to
optimizing your code to run faster[…] avoiding multiple calls to history()
I wonder how am I supposed to make my code faster if the problem is in a history() call.
The values for _tail are roughly 100, I don't think the length of the history is the issue as the algorithm with the shortest value stopped two days before the other two.
Those are the only three history calls I'm doing (and I'm doing because I need them) also my system doesn't even run on a minute-level basis, my handle_data has just a return statement and I'm using a custom function scheduled for daily execution.
The (custom) IDE debugger doesn't step into platform's functions - that's quite expected of course- but how am I supposed to debug an issue that happens into the history call?
My algos weren't top contender but I'm quite annoyed by this issue, has anyone experienced timeout exception or has any hint how to prevent this?
As side note I'm setting universe at 2% interval, that's the max the minute simulation will accept.
To Quantopian: can we have daily live trading algorithm possibly with a wider timeout? That should make much difference on your side.