Hi Karen,
The idea is that if the 1-year pre-computation takes place under the 5-minute time constraint, it is overly restrictive for backtesting. Under live trading, the computation would be done on a rolling basis, every day; there would be no pre-computation. So, you could end up filtering out algos that would run live with no excessive run-time of
before_trading_start
.
On https://www.quantopian.com/posts/introducing-the-pipeline-api, I had similar questions:
I don't understand "In backtesting, they are calculated in bulk, once per year." Is this done before the backtest even starts? Or will the backtest pause every year as it runs, to do the computation? And is the computation limited to 5 minutes? Or could it take longer? In backtesting, is there a way to turn off the pre-computation, to verify that the algo will run live?
As input to your thinking about live trading, in my opinion, it seems like bad style not to provide a means to catch a time-out error. Users should be able to write their own exception handling. Also, under live trading, it would be prudent to understand how the execution of before_trading_start
will scale with the number of algos using it and the level of computation performed. For example, as a worst case, what if every live trading algo pulled a year's worth of data into memory and crunched on it for almost 5 minutes? And then wrote a bunch of data to context
? Etc. You'll need to get a sense for the worst-case scaling, since you have no control over what code users will execute.
Grant