Bloomberg FTP Historic Price Data

Here is an example request file to get historic price data from Bloomberg:


START-OF-FILE
FIRMNAME=XXXXX
SECID=TICKER
PROGRAMFLAG=adhoc
PROGRAMNAME=gethistory
HIST_FORMAT=horizontal
REPLYFILENAME=price_data.out
COLUMNHEADER=yes
SECMASTER=yes
DERIVED=yes
DELIMITER=,
HEADER=no
DATERANGE=31

START-OF-FIELDS
PX_OPEN
PX_SETTLE
PX_LAST
END-OF-FIELDS

START-OF-DATA
ES1 Index
END-OF-DATA
END-OF-FILE

For the detailed description of common request parameters, refer to the Bloomberg FTP Intro.

The parameters relevant to the price data request are the following:

  • DATERANGE — parameter to determine how much data to request. Integer means N days in the past from today.
  • PROGRAMNAME — need to use gethistory program here since we want data for a time period.
  • ES1 Index — name of the instrument. Here we use index for S&P 500 Generic Futures.
  • Commonly used fields for security pricing include:
    • PX_OPEN — price at which the security first traded on a given day.
    • PX_SETTLE — official closing price determined by the closing range that is used to calculate gains and losses, margin calls and invoice prices. For CME group of exchanges: the final settlement price represents the Settlement at Clearing Tick which is the instrument's settlement price at the clearing tick precision for all products.
    • PX_LAST — last price for the security. Returns the last price provided by the exchange.

The result should look like the following:

      
START SECURITY,ES1 Index,PX_OPEN,PX_SETTLE,PX_LAST,
ES1 Index,01/03/2023,1000.00,1001.00,1000.00,
ES1 Index,01/04/2023,1000.00,1001.00,1000.00,
ES1 Index,01/05/2023,1000.00,1001.00,1000.00,
ES1 Index,01/06/2023,1000.00,1001.00,1000.00,
END SECURITY,ES1 Index,PX_OPEN,PX_SETTLE,PX_LAST,