We have changed the signature of
before_trading_start
.
We have changed the signature of before_trading_start
so that it now takes a data
parameter in addition to context
. Existing algorithms will continue to run, but there will be a warning asking you to add the data
parameter.
You can fix the warning by changing your declaration of before_trading_start
from before_trading_start(context)
to before_trading_start(context, data)
.
Why are we making this change?
We are making this change because we are about to enter the alpha of our Modeling API. We shared our plans for this back in May, and have been steadily working on implementing it within Zipline. The API allows you to filter and rank the entire universe of securities by built-in or custom factors. Having access to data
in before_trading_start
will allow you to access information about your portfolio as well as any factors that you calculate.
We are very excited about the Modeling API and we are looking forward to get it into your hands as soon as possible. We are giving it to a limited number of users this week to get help with testing. We know this is an incredible tease, but we will do our best to get it out to everyone as soon as possible.
Please feel free to reach out to me if you would like to be included in the alpha.