I would like to get both 'open' and 'close' price data using a single call to the prices function in my research notebook. Can anyone advise how to do this? Or is the only solution to use Pipelines?
In the reference docs, the prices function documentation says the following:
prices(assets, start, end, frequency='daily', price_field='price', symbol_reference_date=None, start_offset=0)
...
price_field ({'open', 'high', 'low', 'close', 'price'}, optional) – Price field to load. ‘price’ produces the same data as ‘close’, but forward-fills over missing data. Default is ‘price’.
But when I use the following code:
price_data_close = prices(
assets=asset,
start=period_start,
end=period_end,
price_field={'close','open'},
frequency=freq)
I get this error:
/build/src/qexec_repo/zipline_repo/zipline/utils/input_validation.pyc
in _check(func, argname, argvalue)
444 'funcname': get_funcname(func),
445 'argname': argname,
--> 446 'actual': actual(argvalue),
447 },
448 )ValueError: qexec.research.api.prices() expected a value in
('close_price', 'high', 'low', 'open_price', 'price') for argument
'price_field', but got set(['close_price', 'open_price']) instead.
What's going wrong?