MATLAB: Error using blp/timeseries when trying to retrieve Bloomberg after-hour bar data

afterbloombergblpdatafeedDatafeed Toolboxerrorhoursincludenonplottableeventsintradayintradaybarrequestintradaytickrequestrequestticktimeseries

I am calling the 'timeseries' function from the Datafeed toolbox to try to get after-hours bar data for AMZN. However, I am getting the following error:
Error using blp/timeseries (line 267)
Java exception occurred:
com.bloomberglp.blpapi.NotFoundException: Element Definition: includeNonPlottableEvents not found in:
IntradayBarDateTimeChoiceRequest
This is how I am calling 'timeseries':
bbgc = blp;
startdate=datenum(datetime(2019,1,31));
enddate=datenum(datetime(2019,1,31));
starttm='14:00:00';
endtm='20:00:00';
res.trd = timeseries(bbgc, {'AMZN US Equity'}, {startdate:enddate,starttm,endtm}, 60, 'Trade',...
{'includeNonPlottableEvents'},{'true'})

Best Answer

When calling the 'timeseries' function, the flag 'includeNonPlottableEvents' only applies to raw intraday tick requests, not intraday bar requests.. You cannot specify an interval or time range within the date range when making this type of request, as the Bloomberg API does not support this.
Here is an example of how you can use raw intraday tick requests to obtain after-hours data:
>> res.trd = timeseries(bbgc, {'AMZN US Equity'}, {floor(now)-1 now}, [], 'Trade','includeNonPlottableEvents',true)
For more information about the input arguments for the 'timeseries' function, see this documentation page: