MATLAB: How to obtain the average price using the “history” function

Datafeed Toolbox

Is the "history" function capable of retrieving average price quotes from Bloomberg?
For example, can I use MATLAB to replicate the following Excel Bloomberg function:
=BDH("USDBRL Curncy","PX_LAST","12/31/13","","Fill=P","PER=cm","Quote=g","cols=2;rows=43")
My current MATLAB code doesn't replicate the Excel function because it only reports the closing price quote:
>> history(b,'USDBRL Curncy','PX_LAST','12/31/13',[],...
  {'monthly','calendar','previous_value'})

Best Answer

To retrieve the average price data, you will need to add some additional parameters to the "history" function call. The complete function call should be:
>> history(b,'USDBRL Curncy','PX_LAST','12/31/13',[],...
  {'monthly','calendar','previous_value'},...
  [], 'overrideOption','OVERRIDE_OPTION_GPA');
The additional parameters will ensure that the average price is used when calculating the quotes and that the default period is used for the data set. The prices in the output matrix will mirror the prices returned by the provided Excel function.