Barchart Market Data Solutions » Web Services » Historical Data
End of Day (EOD) Queries
EOD queries return all records (daily, weekly or monthly) for a specified symbol during a specified period between a start and an end date.
Contact Us
Historical Data
- Overview
- Tick Queries
- Minute Queries
- Minute Date Range Queries
- Nearby Minute Queries
- Form T Minute Queries
- End of Day (EOD) Queries
- End of Day Date Range Queries
- Event Queries
Instrument Definitions
End of Day (EOD) Queries
EOD queries return all records (daily, weekly or monthly) for a specified symbol during a specified period between a start and an end date. A maximum number of records to be returned can also be specified along with an end date (the maximum number of records is ignored if a start date is specified). The request handler for EOD queries is queryeod.ashx.
An optional data parameter specifies whether the records returned are daily, weekly or monthly, and whether plain, nearby, or continuation records are returned. If not specified, daily records are returned.
A “nearby record” is the nearest futures contract to expiration at any given date in time. Example: Corn Dec 2008, Corn Sep 2008, Corn July 2008 ...
A “continuation record” is the same contract month over different contract years. Example: Corn Dec 2008, Corn Dec 2007, Corn Dec 2006 ...
Nearby and continuation futures records include price data for the front month contract up to the prior day before expiration.
If both a start and an end date are specified, then all records within the specified period will be returned. If a start date is specified, the maximum number of records is ignored.
If no start date is specified and an end date is specified along with a maximum number of records to be returned, then a number of records up to the maximum number specified or back to the beginning of the available data will be returned, whichever is smaller. If no maximum number of records is specified, then all the records between the end date specified and the beginning of the available data will be returned.
If no end date is specified and a start date is specified all the records between the start date and the most current available data will be returned. The maximum number of records is ignored if a start date is specified.
If no dates and no maximum number of records are specified, then all the available records will be returned. If a maximum number of records is specified, the query will be treated as if the end date is specified to the most current available data (refer to maximum number of records when end date is specified in paragraph above).
To query end-of-day options data the symbol format must follow options symbology structure, which is comprised of the underlying futures symbol including the month and year code followed by a vertical bar "|" followed by the strike, followed by a Call or Put indicator ("C" or "P"). For example, the following symbol is valid for NGH12 600 Call options: NGH12|600C
End of Day (EOD) Query Parameters
The following parameters are either required or supported in minute queries (required parameters are marked with an asterisk):
username*: this parameter should be set to the user name provided by ddfplus to the user account.
password*: this parameter should be set to the password provided by ddfplus for the user name passed in parameter username.
symbol*: this parameter should be set to the symbol for which the query should return data.
start: this parameter should be set to the desired start date for the query (the result set will include records back to, and including, this value). If not set, the value will default to the beginning of available. The value should conform to the format yyyymmdd.
end: this parameter should be set to the desired end date for the query (the result set will include records up to, and including, this value). If not set, the value will default to the end of available data (the current day). The value should conform to the format yyyymmdd.
maxrecords: this parameter should be set to the maximum number of records desired. If not specified, the number of records returned will be determined by the date parameters specified as well as any defaults that apply to the query.
order: this parameter can be set to one of two values (asc and desc) in order to specify the chronological order of the result set returned. If this parameter is not specified, the order results is not guaranteed.
data: this parameter can be set to one of fifteen values (daily, dailynearest, dailycontinue, weekly, weeklynearest, weeklycontinue, monthly, monthlynearest, monthlycontinue, quarterly, quarterlynearest, quarterlycontinue, yearly, yearlynearest, and yearlycontinue) in order to specify whether daily, weekly, monthly, quarterly or yearly records are to be returned, and whether they should be plain, nearest, or continuation records. Nearest and continuation are ignored for equities, and if specified the query will simply return plain records.
The 'nearest' queries return the total volume by default (&volume=total) but if you desire contract volume, this can be overridden by passing &volume=contract.
A “nearby record” is the nearest futures contract to expiration at any given date in time. Example: Corn Dec 2008, Corn Sep 2008, Corn July 2008 ...
A “continuation record” is the same contract month over different contract years. Example: Corn Dec 2008, Corn Dec 2007, Corn Dec 2006 ...
contractroll:: for futures, multi-contract nearest queries (data parameter set to dailynearest, weeklynearest, monthlynearest, quarterlynearest or yearlynearest), this parameter can be set to one of two values (expiration, combined), and determines how the switch from one contract to the next in the series is calculated. When the value specified is 'expiration', the switch from one contract to the next in the series will be based on the expiration date (and the value of the 'daystoexpiration' parameter if specified). When the value specified is 'combined', a combination of volume and openinterest will be used to determine when to switch from one contract to the next in the series (when using this value, the 'daystoexpiration' parameter is ignored).
volume: for futures, this parameter can be set to one of two values (contract and total) in order to specify whether the volume returned should be the contract volume or the total volume. For aggregates (such as weekly, monthly or yearly), this returns the average volume for the period specified. If the value is preceded by 'sum' (sumcontract and sumtotal), then it returns the sum of the volumes in each daily bar during the period specified. If not specified, the value will default to contract. For aggregate equities queries (such as weekly, monthly or yearly), this parameter can be set to sum to return the sum of the volumes in each daily bar during the period specified. If not specified, then the average volume is returned.
dividends=false (turns off dividends adjustment for stock data)
splits=false (turns off split adjustment for stock data)
If you want data in raw unadjusted form, then both of these need to be set.
If you want data in raw unadjusted form, then both of these need to be set.
nearby: this parameter specifies the offset from the front month for 'nearest' queries (data parameter set to dailynearest, weeklynearest, monthlynearest, quarterlynearest and yearlynearest). The default value for this parameter is 1, which sets nearest queries to the most current front month. If set to a value greater than 1, then the nth front month is used (for example, in August of 2010, ESU10 would be the current front month, so nearby=2 would use ESZ10, nearby=3 would use ESH11, etc.) This parameter is ignored for all other queries. Alternatively, the same functionality provided by the nearby parameter can be achieved using the symbol notation symbol=RS*n, where RS is the root symbol and n is the nth front month (i.e. symbol=ES*1, symbol=YM*3, etc.). When using this notation on the symbol parameter, the nearby parameter should be omitted.
daystoexpiration: this parameter specifies the number of calendar days prior to a contract expiration when the series of contracts will be switched to the next contract in the series. Valid values are 0 through 60. A value of 0 will tell the system to use the day of expiration. If not specified, the default value (1) is used, resulting in each contract in the series to run until (and including) the day prior to its expiration. This parameter only applies to multi-contract futures queries and is ignored for all other queries.
backadjust: this parameter specifies whether the contracts in the series will be adjusted based on the roll-gap between the closing prices of the current contract and the previous contract on the day of the switch. Valid values are true and false. If not specified, the default value is false resulting in a non-adjusted query. Adjustments are reflected starting from the current date, regardless if an end date is set or not. This parameter only applies to multi-contract futures queries and is ignored for all other queries.
End of Day (EOD) Query Results Format
Results are returned by EOD queries in comma delimited text format, one record per line, as follows:
SYMBOL,YYYY-MM-DD,OPEN,HIGH,LOW,CLOSE,VOLUME[,OPENINTEREST]
Example (fragment of weekly nearest for ESH09):
ESZ08,2008-12-08,872.25,919.25,829,886,3269325,3301807 ESZ08,2008-12-15,883.5,919.25,857.25,881.25,2670206,3198151 ESH09,2008-12-22,884.25,891.5,852.75,869,654227,2287817 ESH09,2008-12-29,869,932.75,853.25,925.5,853185,2344054
Example:
CSCO,2009-02-09,16.99,17.05,16.62,16.85,37633398 CSCO,2009-02-10,16.59,16.93,15.92,16.05,69148797 CSCO,2009-02-11,16.18,16.27,15.85,16.17,46280102 CSCO,2009-02-12,15.97,16.22,15.63,16.2,57651598
Note: open interest does not apply to equities, and is therefore omitted.
End of Day (EOD) Query Examples
In order to query all the daily records for Apple between February 3, 2009, and February 23, 2009 execute:
http://ds01.ddfplus.com/historical/queryeod.ashx?username=username&password=password&symbol=AAPL&start=20090203&end=20090223&data=daily
In order to query the last 10 weekly records for Apple up to the current day execute:
http://ds01.ddfplus.com/historical/queryeod.ashx?username=username&password=password&symbol=AAPL&maxrecords=10&data=weekly
In order to query the last 100 daily nearest records for ESH09 execute:
http://ds01.ddfplus.com/historical/queryeod.ashx?username=username&password=password&symbol=ESH09&maxrecords=100&data=dailynearest
In order to query the 100 daily nearest records up to February 3, 2009 for ESH09 with total volume execute:
http://ds01.ddfplus.com/historical/queryeod.ashx?username=username&password=password&symbol=ESH09&end=20090203&maxrecords=100&data=dailynearest&volume=total
In order to query NGH12 600 Call options from 1/1/12 to 1/31/12 execute:
http://ds01.ddfplus.com/historical/queryeod.ashx?username=username&password=password&symbol=NGH12|600C&start=20120101&end=20120131&order=&data=daily&volume=contract