MATLAB: How to receive only one file using submitftp for several message types and several trade fields

datafeedDatafeed Toolboxfinancetoolkit

We have a subscription to Thomson Reuters TickHistory and we use MATLAB to download data. What we have been doing is running the following:
>> x = submitftp(r, contractName, {'Price'},...
  {t1,t2}, 'TimeAndSales', 'Trade', 'CBT', 'FUT');
>> x = submitftp(r, contractName, {'Bid Price','Ask Price'},...
  {t1,t2}, 'TimeAndSales', 'Quote', 'CBT', 'FUT', 1);
Each of the commands has different message types ('Trade' and 'Quote') and different trade fields ({'Price'} and {'Bid Price', 'Ask Price'}).
This generates two files – one with trade data and the other with Bids/Asks. We would like to get the same data in a single file. We know that we can do this from the Thomson Reuters web interface, but have not figured out the right command in MATLAB.

Best Answer

To receive one file when using “submitftp” to query different trade fields for different message types, you can execute the following code:
>> x = submitftp(r, contractName, { {'Price'},{'Bid Price','Bid Ask'} },...
  {t1, t2}, 'TimeAndSales', {'Trade','Quote'}, 'CBT', 'FUT')
Please note that the parameter for trade fields is a cell array of cell arrays: { {'Price'}, {'Bid Price', 'Bid Ask'} }, one for the Trade message type and one for the Quote message type.