Note how the start and end dates are different; that is because these are the dates I am running my simulation under. This makes sense from the perspective if we are only monitoring price data from yahoo, but I would like to pull in additional data from outside sources not natively available to zipline. Naturally, I would like to do this in the initialize step, but I can't because initialize doesn't have dates that reflect my actual simulation parameters. I can do something hacky in handle_data like
But this feels like a step that deserves to be in initialize. Alternately you can add a pre_run step; but this feels kinda the same thing as calling the initialize function.
When I run the zipline CLI the context in my
initialize
function looks like thisThese must be default values. Then my context in
handle_data
it matches my actual simulationNote how the start and end dates are different; that is because these are the dates I am running my simulation under. This makes sense from the perspective if we are only monitoring price data from yahoo, but I would like to pull in additional data from outside sources not natively available to zipline. Naturally, I would like to do this in the
initialize
step, but I can't becauseinitialize
doesn't have dates that reflect my actual simulation parameters. I can do something hacky inhandle_data
likeBut this feels like a step that deserves to be in
initialize
. Alternately you can add apre_run
step; but this feels kinda the same thing as calling theinitialize
function.