Home
Datafeed Toolbox
Contents
1. FromDate ToDate data fetch Connect Security Fields FromDate ToDate data fetch Connect Security FromDate ToDate Period Arguments Connect Yahoo connection object created with yahoo Security A MATLAB string or cell array of strings containing the name of a security in a format recognizable by the Yahoo server Note Retrieving historical data for multiple securities at one time is not supported for Yahoo You can fetch historical data for only a single security at a time Fields A MATLAB string or cell array of strings indicating 5 188 the data fields for which to retrieve data A partial list of supported values for current market data are e Symbol e Last e Date e Time fetch Date Note Date and Time are MATLAB date numbers Time is a fractional part of a date number For example 0 5 12 00 00 PM Change Open High Low Volume A partial list of supported values for historical data are Close Date High Low Open Volume Adj Close For a complete list of supported values for market and historical data see ynfields mat Date string or serial date number indicating date for the requested data If you enter today s date fetch returns yesterday s data 5 189 fetch Description 5 190 FromDate Beginning date for historical data Note You can specify dates
2. 1 5 1 Getting Started 1 6 BD RFA Configuration Editor 4 Key E lconnectiontype jacs_CbeEnabled dacs_GenerateLocks lacs_SbePubEnabled dacs_SbeSubEnabled loadDataDict portNumber 8101 rList 111 222 333 134 userName mw335 By RFA Configuration Editor Key Value RemoteConnection connectionList 5 If you are not DACS enabled disable DACS About Data Servers and Data Service Providers a Add the following to your connection configuration dacs _CbheEnabled false dacs SbePubEnabled false dacs SbeSubEnabled false b If you are running an SSL connection add the following to your connection configuration dacs _GenerateLocks false For more information see the reuters function reference page Troubleshooting Issues with Reuters Configuration Editor These errors occur when you attempt to use the Reuters Configuration Editor to configure connections on a machine on which an XML Parser is not installed java com reuters rfa tools config editor ConfigEditor org xml sax SAXException System property org xml sax driver not specified at org xml sax helpers XMLReaderFactory createXMLReader Unknown Source at com reuters rfa tools config editor rfaConfigRuleDB rfaConfi gRuleDB java 56 at com reuters rfa tools config editor ConfigEditor init ConfigEditor java 86 at com reuters rfa tools config editor ConfigEditor Config
3. data fetch Connect Security STOP unsubscribes the list of securities from processing Bloomberg real time events Bloomberg connection object created with the bloomberg function A MATLAB string containing the name of a security or a cell array of strings containing a list of securities specified in a format recognizable by the Bloomberg server You can substitute a CUSIP number for a security name as needed You can only call a single security when using the TIMESERIES flag as well Note This argument is case sensitive A MATLAB string indicating the dates for which to retrieve data Possible values are e DEFAULT Data from most recent bid ask or trade If you do not specify a Flag value fetch uses the default value of DEFAULT e TODAY Today s data only e ENHANCED Data from most recent date of each individual field Optional Currency in which the fetch function returns historical data A list of valid currencies appears in the file bloomberg bbfields mat Default Optional Security type identifier A list of valid currencies appears in the file bloomberg bbfields mat Default A MATLAB string or cell array of strings specifying specific fields for which you request data A list of valid currencies appears in the file bloomberg bbfields mat Default 5 9 fetch 5 10 Override Values Date Minutes TickField FromDate ToDate P
4. s qp status r x s qp status r x returns the status and queue position of the Thomson Reuters Tick History TRTH FTP request handle x When s is equal to Complete download the file from the TRTH server manually or programmatically Check the status of your FTP request x submitftp r GOOG 0 Exchange ID Price Volume floor now 10 floor now TimeAndSales Trade NSQ EQU s while strcmp s Complete s qp status r x end Optionally download the file from the TRTH server programmatically The data file is generated in a directory api results on the server The file has extension csv gz filename api results char x report csv gz urlwrite https tickhistory thomsonreuters com HttpPull Download user username amp pass password amp file filename rdth_results csv gz This call to urlwrite saves the downloaded file with the name rdth_results csv gz in the current directory 5 139 submitftp Purpose Syntax Description 5 140 Submit FTP request for Thomson Reuters Tick History data xX submitftp r sec X submitftp r sec tradefields daterange reqtype messtype exchange domain x submitftp r sec tradefields daterange reqtype messtype exchange domain marketdepth x submitftp r sec returns information about the security sec such as the code currency exchange and name for the given trth c
5. date 02 02 2007 02 03 2007 security ABC N XYZ 0 See Also reuters rdthloader 5 171 thkrs Purpose Syntax Description See Also 5 172 SIX Financial Information connection T tlkrs CI UI password T tlkrs C1I UI password makes a connection to the SIX Financial Information data service given the Customer ID CI User ID UI and password password provided by SIX Financial Information close getdata history timeseries close Purpose Close connection to SIX Financial Information Syntax close C Description close C closes the connection C to SIX Financial Information See Also tikrs 5 173 getdata Purpose Syntax Description Examples 5 174 Current SIX Financial Information data oO li getdata c s f D getdata c s f returns the data for the fields f for the security list s Retrieve SIX Financial Information pricing data for specified securities Connect to Telekurs c tlkrs US12345 userapid01 userapid10 Convert specified fields to ID strings ids tkfieldtoid c Bid Ask Last market Retrieve data for specified securities d getdata c 1758999 149 134 275027 148 184 ids Your output appears as follows d XRF 1x1 struct IL 1x1 struct I 1x1 struct M 1x1 struct P 1x1 struct d I contains the instrument IDs and d P contains the pricing data View the instrument I
6. Optional Period within a date range Period values are e d daily values e w weekly values e m monthly values Currency Optional Currency in which fetch returns the data ReqFlag Optional Specifies how the fetch request is processed by Datastream The default value is 0 Note You can enter the optional arguments Fields FromDate ToDate Period and Currency as MATLAB strings or empty arrays data fetch Connect Security returns the default time series for the indicated security data fetch Connect Security Fields returns data for the specified security and fields 5 51 fetch 5 52 Examples data fetch Connect Security Fields Date returns data for the specified security and fields on a particular date data fetch Connect Security Fields FromDate ToDate returns data for the specified security and fields for the indicated date range data fetch Connect Security Fields FromDate ToDate Period returns instrument data for the given range with the indicated period data fetch Connect Security Fields FromDate ToDate Period Currency also specifies the currency in which to report the data data fetch Connect Security Fields FromDate ToDate Period Currency ReqFlag also specifies a ReqFlag that determines how the request is processed
7. Purpose Syntax Arguments Description Examples 5 104 Retrieve information about next Haver Analytics variable D nextinfo H S H Haver Analytics connection object created with the haver function S Haver Analytics variable D nextinfo H S returns information for the next Haver Analytics variable after the variable S Establish a Haver Analytics connection H H haver d work haver data haverd dat Request information for the variable following FFED D nextinfo H FFED The following structure is returned VarName FFED2 StartDate 01 Jan 1991 EndDate 31 Dec 1998 NumberObs 2088 Frequency D DateTimeMod 02 Apr 2007 20 46 37 Magnitude 0 DecPrecision 2 DifType 1 AggType AVG DataType Group ZO05 Source FRB nextinfo Descriptor Federal Funds Effective Rate p a ShortSource History LongSource Historical Series See Also close get haver info isconnection 5 105 havertool Purpose Run Haver Analytics graphical user interface GUI Syntax havertool H Arguments H Haver Analytics connection object created with haver Description havertool H runs the Haver Analytics graphical user interface GUI The GUI appears in the following figure ee Alt xJ Total Bankruptcy Filings U S Units Units 1960 1970 1980 1990 2000 2010 Source Administrative Office of the U S Courts Agg Type Start Date End Date Workspace V
8. date DATE1 retrieves data from file with date stamps of value DATE1 5 169 rnseloader Examples 5 170 x rnseloader file date DATE1 DATE2 retrieves data from file with date stamps between DATE1 and DATE2 x rnseloader file security SECNAME retrieves data from file for the securities specified by SECNAME x rnseloader file start STARTREC retrieves data from file beginning with the record specified by STARTREC x rnseloader file records NUMRECORDS retrieves NUMRECORDS number of records from file x rnseloader file fieldnames F retrieves only the specified fields F in the output structure Retrieve data from the file file csv with date stamps of 02 02 2007 x rnseloader file csv date 02 02 2007 Retrieve data from file csv between and including 02 02 2007 and 02 03 2007 x rnseloader file csv date 02 02 2007 02 03 2007 Retrieve data from file csv for the security XYZ 0 x rnseloader file csv security XYZ 0 Retrieve the first 10000 records from file csv x rnseloader file csv records 10000 Retrieve data from file csv starting at record 100000 x rnseloader file csv start 100000 rnseloader Retrieve up to 100000 records from file csv for the securities ABC N and XYZ 0 with date stamps between and including the dates 02 02 2007 and 02 03 2007 x rnseloader file csv records 100000
9. Close Volume OI Flags TickBid TickAsk and TickTrade For raw intraday tick requests the following fields are valid TickType Time Price Size Exchange and Flags Return the monthly closing and high prices for the given dates for the given security in 10 minute bars D timeseries E ABC US Equity close high 1 01 2010 4 10 2010 10 Return all fields for the given dates for the given security in 10 minute bars Fields are returned in the following order Time Open High Low Close Volume OI Flags TickBid TickAsk and TickTrade 5 61 timeseries D timeseries E ABC US Equity 8 01 2009 8 10 2009 10 See Also esig close getdata history 5 62 Purpose Syntax Description Arguments Examples See Also IQFEED Desktop API connection Q iqf username password Q iqf username password portname Q iqf username password starts IQFEED or makes a connection to an existing IQFEED session Q iqf username password portname starts IQFEED or makes a connection to an existing IQFEED session Note Only one IQFEED connection can be open at a time username The user name for the IQFEED account password The password for the IQFEED account portname The IQFEED port identifier default Admin Create an IQFEED connection handle Q iqf username password Alternatively you can create a connection and specify the portname argument
10. d daily values e b business day daily values e m monthly values e mb beginning monthly values e me ending monthly values e q quarterly values e qb beginning quarterly values e qe ending quarterly values e y annual values yb beginning annual values e ye ending annual values data fetch Connect returns the names of all available formula libraries data fetch Connect Library returns the valid field names for a given formula library data fetch Connect Security Fields returns data for the specified security and fields data fetch Connect Security Fields Date returns security data for the specified fields on the requested date data fetch Connect Security Fields FromDate ToDate returns security data for the specified fields for the date range FromDate to ToDate fetch Examples See Also data fetch Connect Security FromDate ToDate Period returns security data for the date range FromDate to ToDate with the specified period Retrieving Names of Available Formula Libraries Obtain the names of available formula libraries D fetch Connect Retrieving Valid Field Names of a Specified Library Obtain valid field names of the FactSetSecurityCalcs library D fetch Connect fs Retrieving the Closing Price of a Specified Security Obtain the closing price of the security IBM D fetch Connect IBM
11. function or edit your classpath txt file Retrieve Field Data Retrieve Field Data getdata obtains Bloomberg field data The entire set of field data provides statistics for all possible securities but it does not apply universally to any one security To obtain data for specific fields of a given security use the getdata function with the following syntax d getdata Connect Security Fields For example use the Bloomberg connection object c to retrieve the values of the fields Open and Last_Price c blp d getdata c IBM US Equity Open Last_Price d Open 126 2500 Last_Price 125 1250 3 Example Retrieve Bloomberg Data 3 4 Retrieve Time Series Data timeseries returns price and volume data for a particular security on a specified date Use the following command to return time series data for a given security and a specific date data timeseries Connection Security Date Date can be a MATLAB date string or serial date number To obtain time series data for the current day use the alternate form of the function data timeseries Connection Security floor now To obtain time series data for IBM using an existing connection c enter the following c blp data timeseries c IBM US Equity floor now Retrieve Historical Data Retrieve Historical Data Use history to obtain historical data for a specific security To obtain historical data for a specified field
12. returns x 1 if the connection to the Kx Systems Inc kdb database is valid and x 0 otherwise Establish a connection to a Kx Systems Inc kdb database k k kx localhost 5001 Verify that k is a valid connection x isconnection k x 1 close fetch get kx 5 123 tables Purpose Syntax Arguments Description Examples See Also 5 124 Retrieve table names from Kx Systems Inc kdb databases t tables k k The Kx Systems Inc kdb connection object created with the kx function t tables k returns the list of tables for the Kx Systems Inc kdb connection Retrieve table information for the Kx Systems Inc kdb database using the connection k t tables k t intraday seclist trade exec fetch insert kx rdth Purpose Syntax Description Examples Connect to Thomson Reuters Tick History Il rdth username password r rdth username password creates a Thomson Reuters Tick History connection to enable intraday tick data retrieval To create a Thomson Reuters Tick History connection the command r rdth user company com mypassword returns r client 1x1 com thomsonreuters tickhistory webservice client RDTHApiClient user user company com password VkRKKKK KKK KK Suppose you want to get the intraday price and volume information for all ticks of type Trade To determine which fields apply to the messag
13. Aggregated into Time Intervals Retrieve today s trade time series for the given security aggregated into five minute intervals D fetch c ABC US Equity TIMESERIES now 5 Trade Retrieving Time Series Default Closing Price Retrieve the closing price for the given dates using the default period of the data D fetch c ABC US Equity HISTORY Last_Price 8 01 99 8 10 99 Retrieving Monthly Closing Price Retrieve the monthly closing price for the specified dates D fetch c ABC US Equity HISTORY Last_Price 8 01 99 9 30 00 m bloomberg close get isconnection 5 13 get Purpose Syntax Arguments Description Examples 5 14 Retrieve Bloomberg connection object properties get is not recommended Use the b1p function get instead value get Connect PropertyName value get Connect Connect Bloomberg connection object created with the bloomberg function PropertyName Optional A MATLAB string or cell array of strings containing property names Property names are e Connection e IPAddress e Port e Socket e Version value get Connect PropertyName returns a MATLAB structure containing the value of the specified properties for the Bloomberg connection object value get Connect returns the value for all properties Establish a connection c to a Bloomberg data server c bloomberg Retrieve this connection s prop
14. Also ans View the pricing data d P v ans 45 45 44 32 33 45 45 44 26 27 94 95 Convert the field identification strings in d P k to their corresponding field names like this d P k tlkrs getdata timeseries tkfieldtoid tkidtofield tkidtofield c d P k history 5 177 isconnection Purpose Syntax Description See Also 5 178 True if valid SIX Financial Information connection X isconnection C X isconnection C returns true if C is a valid SIX Financial Information connection and false otherwise tlkrs close getdata timeseries Purpose Syntax Description Examples SIX Financial Information intraday tick data oO Il timeseries c s t timeseries c s startdate enddate D timeseries c s t 5 Il D timeseries c s t returns the raw tick data for the SIX Financial Information connection object c the security s and the date t Every trade best and ask tick is returned for the given date or date range D timeseries c s startdate enddate returns the raw tick data for the security s for the date range defined by startdate and enddate D timeseries c s t 5 returns the tick data for the security s for the date t in intervals of 5 minutes for the field f Intraday tick data requested is returned in 5 minute intervals with the columns representing First High Low Last Volume Weighted Average and
15. Connect to the FRED data server at the URL http research stlouisfed org fred2 c fred http research stlouisfed org fred2 close fetch get isconnection 5 89 close 5 90 Purpose Syntax Arguments Description Examples See Also Close connections to FRED data servers close Connect Connect FRED connection object created with fred close Connect closes the connection to the FRED data server Make a connection c to a FRED data server c fred http research stlouisfed org fred2 Close this connection close c fred fetch Purpose Syntax Arguments Description Request data from FRED data servers data fetch Connect Series data fetch Connect Series D1 data fetch Connect Series D1 D2 Connect FRED connection object created with the fred function Series MATLAB string containing the name of a series in a format recognizable by the FRED server D1 MATLAB string or date number indicating the date from which to retrieve data D2 MATLAB string or date number indicating the date range from which to retrieve data For a given series fetch returns historical data using the connection to the FRED data server data fetch Connect Series returns data for Series using the connection object Connect data fetch Connect Series D1 returns data for Series using the connection object Connect for the date D1 data f
16. Moving Average Retrieve SIX Financial Information intraday tick data for the past 2 days c d tikrs US12345 userapid0O1 userapid10 timeseries c 1758999 149 134 floor now 25 floor now Display the returned data d XRF 1x1 struct IL 1x1 struct I 1x1 struct TSL 1x1 struct TS 1x1 struct P 1x1 struct 5 179 timeseries d I contains the instrument IDs d TS contains the date and time data and d P contains the pricing data Display the tick times d TS t 1 10 ans 013500 013505 013510 013520 013530 013540 013550 013600 013610 013620 Display the field IDs d P k 1 10 ans 13 4 130 13 3 134 130 1303 134 130 133 1304 Convert these IDs to field names Mid Bid Ask with tkidtofield 5 180 timeseries d P k tkidtofield c d P k history Load the file tlkrs tkfields mat for a listing of the field names and corresponding IDs Display the corresponding tick values d P v 1 10 ans 45 325 45 32 45 33 45 325 45 32 45 33 45 325 45 32 45 33 45 325 See Also tlkrs getdata history 5 181 tkfieldtoid Purpose Syntax Description Examples See Also 5 182 SIX Financial Information field names to identification string D tkfieldtoid c f typ D tkfieldtoid c f typ converts SIX Financial Information field names to their corresponding identif
17. Purpose Syntax Description Examples See Also eSignal Desktop API connection m li esig user E esig user creates an eSignal Desktop API connection given the user name user Only one eSignal connection can be open at a time In order to use the signal interface you need to make the eSignal Desktop API visible to MATLAB by using the command Add NET assembly NET addAssembly D Work esignal DesktopAPI_TimeAndSales DesktopAPI_TimeAndSales obj Release Interop IESignal d11 Note Interop IESignal d11 does not ship with Datafeed Toolbox This file is created by Microsoft Visual Studio using an unmanaged DLL in a managed environment Interop IESignal d1l is a wrapper that Visual Studio creates If you do not have Interop IESignal d11 contact our technical support staff Use the NET addAssembly command to access Interop IESignal d1l in MATLAB For example NET addAssembly D Work esignal DesktopAPI_TimeAndSales DesktopAPI_TimeAndSales obj Release Interop IESi Create an eSignal connection handle Enter mylogin as your user name E esig mylogin close getdata history timeseries close Purpose Syntax Description See Also Close eSignal connection close e close e closes the eSignal connection object e esig 5 57 getdata 5 58 Purpose Syntax Description Examples See Also Current eSignal data D getdata E S D getdata E S retu
18. Request data from Thomson Reuters Datastream data servers Syntax data fetch Connect Security data fetch Connect Security Fields data fetch Connect Security Fields Date data fetch Connect Security Fields FromDate ToDate data fetch Connect Security Fields FromDate ToDate Period data fetch Connect Security Fields FromDate ToDate Period Currency data fetch Connect Security Fields FromDate ToDate Period Currency ReqFlag Arguments Connect Thomson Reuters Datastream connection object created with the datastream function Security MATLAB string containing the name of a security or cell array of strings containing names of multiple securities This data is in a format recognizable by the Thomson Reuters Datastream data server Fields Optional MATLAB string or cell array of strings indicating the data fields for which to retrieve data Date Optional MATLAB string indicating a specific calendar date for which you request data FromDate Optional Start date for historical 5 50 data fetch Description ToDate Optional End date for historical data If you specify a value for ToDate FromDate cannot be an empty value Note You can specify dates in any of the formats supported by datestr and datenum that show a year month and day Period
19. Systems Inc close 5 116 exec 5 117 fetch 5 119 get 5 121 insert 5 122 isconnection 5 123 kx 5 114 tables 5 124 marketdepth 5 67 news 5 69 realtime 5 71 Reuters close 5 157 fetch 5 160 get 5 163 history 5 164 reuters 5 145 stop 5 167 Reuters Datascope Tick History fetch 5 131 get 5 135 isconnection 5 138 rdth 5 125 rdth close 5 130 rdthloader 5 142 rnseloader 5 169 Thomson Reuters Datastream close 5 49 datastream 5 48 fetch 5 50 get 5 54 isconnection 5 55 timeseries 5 61 5 73 Yahoo close 5 187 fetch 5 188 get 5 192 Index isconnection 5 193 yahoo 5 185 G get 5 135 Bloomberg 5 14 5 29 FRED 5 93 Haver Analytics 5 100 Interactive Data Pricing and Reference Data s RemotePlus 5 112 Kx Systems Inc 5 121 Reuters 5 163 Thomson Reuters Datastream 5 54 Yahoo 5 192 getdata Bloomberg 5 30 graphical user interface 4 1 H haver 5 95 to 5 96 Haver Analytics 5 95 to 5 96 havertool 5 106 Haver Analytics 5 106 history Bloomberg 5 32 Reuters 5 164 ide 5 108 info Haver Analytics 5 101 insert Kx Systems Inc 5 122 IQFEED 5 68 to 5 65 5 67 5 69 5 71 5 73 isconnection 5 138 Bloomberg 5 16 5 37 FRED 5 94 Haver Analytics 5 103 Interactive Data Pricing and Reference Data s RemotePlus 5 113 Kx Systems Inc 5 123 Thomson Reuters Datastream 5 55 Yahoo 5 193 isfield Bloomberg 5 17 K kx 5 114 L lookup Bloomberg 5 18
20. for the Reuters session object r d history r s f p returns all available historical data for the RIC s and fields f for the Reuters session object r p specifies the period of the data d history r s d returns the historical data for the RIC s for the given date d for the Reuters session object r history Examples d history r s startdate enddate returns the daily historical data for the RIC s for the given date range defined by startdate and enddate d history r s startdate enddate p returns the daily historical data for the RIC s for the given date range defined by startdate and enddate p specifies the period of the data d history r s f startdate enddate returns the daily historical data for the RIC s for the given date range defined by startdate and enddate d history r s f startdate enddate p returns the historical data for the RIC s and fields f for the given date range defined by startdate and enddate p specifies the period of the data d history r WXYZ 0 returns a structure containing all available historical end of day daily data for the RIC wxyz o for the Reuters session object r d history r WXYZ 0 close returns a structure with the fields date and close containing all available historical end of day daily data for the RIC wxyz o d history r WXYZ 0 close m returns all available monthly data d history r WXYZ 0 01 03 2009 02 24 2009 ret
21. in FAR 12 212 DFARS Part 227 72 and DFARS 252 227 7014 Accordingly the terms and conditions of this Agreement and only those rights specified in this Agreement shall pertain to and govern the use modification reproduction release performance display and disclosure of the Program and Documentation by the federal government or other entity acquiring for or through the federal government and shall supersede any conflicting contractual terms or conditions If this License fails to meet the government s needs or is inconsistent in any respect with federal procurement law the government agrees to return the Program and Documentation unused to The MathWorks Inc Trademarks MATLAB and Simulink are registered trademarks of The MathWorks Inc See www mathworks com trademarks for a list of additional trademarks Other product or brand names may be trademarks or registered trademarks of their respective holders Patents MathWorks products are protected by one or more U S patents Please see www mathworks com patents for more information Revision History December 1999 June 2000 December 2000 February 2003 June 2004 August 2004 September 2005 March 2006 September 2006 March 2007 September 2007 March 2008 October 2008 March 2009 September 2009 March 2010 September 2010 April 2011 September 2011 March 2012 September 2012 March 2013 First printing Online only Online only Online only Online only Online only Seco
22. in any of the formats supported by datestr and datenum that show a year month and day ToDate End date for historical data Period Period within date range Period values are e d daily e w weekly e m monthly dividends data fetch Connect Security returns data for all fields from Yahoo s Web site for the indicated security Note This function does not support retrieving multiple securities at once You must fetch a single security at a time data fetch Connect Security Fields returns data for the specified fields data fetch Connect Security Date returns all security data for the requested date data fetch Connect Security Fields Date returns security data for the specified fields on the requested date data fetch Connect Security FromDate ToDate returns security data for the date range FromDate to ToDate fetch data fetch Connect Security Fields FromDate ToDate returns security data for the specified fields for the date range FromDate to ToDate data fetch Connect Security FromDate ToDate Period returns security data for the date range FromDate to ToDate with the indicated period Examples Retrieving Last Prices for a Set of Equities Connect to the Yahoo data server to obtain the last prices for a set of equities y yahoo FastFood fetch y ko pep mcd Last FastFo
23. inside single quotes You can specify several name and value pair arguments in any order as Name1 Value1 NameN ValueN Note For information on available Name Value options for StudyAttributes see the Bloomberg tool located at C b1p API APIv3 bin BBAPIDemo exe Study Request for Bloomberg Technical Analysis Data Over Specified Time Period List the available Bloomberg studies r tahistory b 5 43 tahistory In this example the dmi study is used To display the Name Value options for StudyAttributes for dmi use the syntax r dmiStudyAttributes ans period 1x130 char priceSourceHigh 1x149 char priceSourceLow 1x147 char priceSourceClose 1x151 char Obtain more information on theStudyAttributes for period r dmiStudyAttributes period ans DEFINITION period Alternate names Min Value 1 Max Value 1 TYPE Int64 End Definition period Request a dmi study for the security IBM US Equity using the StudyAttributes for priceSourceHigh priceSourceLow and priceSourceClose for a specified time period d tahistory b IBM US Equity floor now 30 floor now dmi all_calendar_days period 14 priceSourceHigh PX_HIGH priceSourceLow PX_LOW priceSourceClose PX_LAST 5 44 tahistory A successful studyResponse holds information on the requested security It contains a studyDataTable with one studyDataRow for each interval returned
24. nextinfo Haver Analytics 5 104 rdth 5 125 rdthloader 5 142 realtime Bloomberg 5 38 retrieving connection properties 2 5 reuters 5 145 Reuters Reuters Configuration Editor 1 5 Reuters Datascope Tick History file See rdth See rdthloader Reuters Newscope See rnseloader rnseloader 5 169 S Securities Lookup dialog box 4 9 stop Index 3 Index Bloomberg 5 40 Bloomberg 5 41 Reuters 5 167 timeseries Bloomberg 5 46 T tables Y Kx Systems Inc 5 124 yahoo 5 185 tahistory Index 4
25. price Retrieving the Closing Price of a Specified Security Using Default Date Period Obtain the closing price for IBM using the default period of the data D fetch C IBM price 09 01 07 09 10 07 Retrieving the Monthly Closing Prices of a Specified Security for a Given Date Range Obtain the monthly closing prices for IBM from 09 01 05 to 09 10 07 D fetch C IBM price 09 01 05 09 10 07 m close factset isconnection 5 79 get Purpose Syntax Arguments Description Examples 5 80 Retrieve properties of FactSet connection object value get Connect PropertyName value get Connect Connect FactSet connection object created with the factset function PropertyName Optional A MATLAB string or cell array of strings containing property names Property names are user serial password e cid value get Connect PropertyName returns the value of the specified properties for the FactSet connection object value get Connect returns a MATLAB structure where each field name is the name of a property of Connect and each field contains the value of that property Establish a connection to FactSet data Connect factset Fast_User 1234 Fast_Pass userid Retrieve the connection property value h get Connect h user Fast_User serial 1234 password Fast_Pass get See Also cid userid Retrieve the va
26. realtime b IBM US Equity AAPL US EQUITY Last_Trade Volume v3stockticker Subscribe to a Security and Request Data Import while Running v3showtrades Subscribe to the security ABC US Equity Request the fieldsLast_Trade Bid Ask Volume and VWAP events while the function v3showtrades is running realtime subs t realtime C ABC US Equity Last_Trade Bid Ask Volume VWAP v3showtrades See Also blp history timeseries 5 39 stop 5 40 Purpose Syntax Description See Also Unsubscribe real time requests for Bloomberg V3 stop c subs t stop c subs s stop c subs t unsubscribes real time requests associated with the Bloomberg connection c and subscription list subs t is the timer associated with the real time callback for the subscription list stop c subs S unsubscribes real time requests for each security s on the subscription list subs The timer input t is empty blp getdata history realtime timeseries tahistory Purpose Syntax Description Input Arguments Returns historical technical analysis from Bloomberg V3 D tahistory c D tahistory c s fromdate todate studychoice per Name Value D tahistory c returns the Bloomberg V3 session technical analysis data study and element definitions D tahistory c s fromdate todate studychoice per Name Value returns the Bloomberg V3 session technical ana
27. returns daily data for all calendar days reporting missing values as NaN If a value is unspecified fetch returns a default value Note If you do not specify a value for Period fetch uses default values Optional Currency type The file bloomberg bbfields mat lists supported currencies 5 11 fetch 5 12 Market A MATLAB string indicating the market in which a particular security trades Possible values are Comdty Commodities Corp Corporate bonds Equity Equities Govt Government bonds Index Indexes M Mkt Money Market securities Mtge Mortgage backed securities Muni Municipal bonds Pfd Preferred stocks MATLABProg A string that is the name of any valid MATLAB program Examples Retrieving Header Data Retrieve header data for a United States equity with ticker ABC D fetch c ABC US Equity Retrieving Opening and Closing Prices Retrieve the opening and closing prices D fetch c ABC US Equity GETDATA Last_Price Open Retrieving Override Fields Retrieve the requested fields given override fields and values D fetch c 3358ABCD4 Corp GETDATA fetch See Also YLD_YTM_ASK ASK OAS SPREAD ASK OAS VOL_ASK PX_ASK OAS VOL_ASK 99 125000 14 000000 Retrieving Time Series Data Retrieve today s time series D fetch c ABC US Equity TIMESERIES now Retrieving Time Series Data
28. server sales representative Proxy Information Requirements The following data service providers may require you to specify a proxy host and proxy port plus a username and password if the user s site requires proxy authentication e FactSet e Federal Reserve Economic Data About Data Servers and Data Service Providers Thomson Reuters Datastream Thomson Reuters Tick History Yahoo IQFEED For information on how to specify these settings see Specify Proxy Server Settings for Connecting to the Internet FactSet Data Service Requirements You need a license to use FactSet FAST technology For more information see the FactSet Web site at http www factset com Reuters Data Service Requirements Configuring Reuters Connections Using the Reuters Configuration Editor You must use the Reuters Configuration Editor to configure your connections as follows 1 Open the Reuters Market Data System configuration editor by typing the following command rmdsconfig 2 Load the sample configuration file a Click File gt Import gt File b Select the file matlabroot toolbox datafeed datafeed sampleconfig xml 3 Modify sampleconfig xml based on the site specific settings that you obtain from Reuters 4 Define a namespace a connection and a session associated with the connection The following example adds the session remoteSession with the namespace MyNS to the connection list for the connection remoteConnection
29. the N rows in the data set fieldinfo fieldsearch getdata history realtime timeseries close Purpose Close connection to Bloomberg V3 data server Syntax close c Description close c closes the connection c to the Bloomberg V3 session See Also blp 5 23 display Purpose Display Bloomberg V3 connection object Syntax disp display c Description disp display c displays the Bloomberg V3 connection object 5 24 eqs Purpose Syntax Description Examples Returns equity screening data from Bloomberg V3 eqs b sname eqs b sname stype eqs b sname stype languagelID eqs b sname stype languageID Group gg 0C 0 D eqs b sname returns equity screening data given the Bloomberg V3 session screen name sname D eqs b sname stype returns equity screening data given the Bloomberg V3 session screen name sname and screen type stype stype can be set to GLOBAL for Bloomberg screen names or PRIVATE for customized screen names D eqs b sname stype languageID returns equity screening data given the Bloomberg V3 session screen name sname screen type stype and languageID D eqs b sname stype languageID Group returns equity screening data given the Bloomberg V3 session screen name sname screen type stype languageID and Group Note when using the optional Group input argument stype cannot be set to PRIVATE for customized screen names Return Eq
30. turns off news updates for the list of currently subscribed level 1 securities Q IQFEED connection handle created using iqf S S is a single security input elistener Function handle that specifies the function used to listen for data on the news lookup port ecallback Function handle that specifies the function that processes data events Return news data using the defaults for socket listener and event handler and display the results in the MATLAB workspace in the variable IQFeedNewsData news q ABC openvar IQFeedNewsData Return news data for the security ABC using the function handles iqfeedlistener and iqfeedeventhandler Display the results in the MATLAB workspace in the variable IQFeedNewsData 5 69 news news q ABC iqfeednewslistener G iqfeednewseventhandler openvar IQFeedNewsData See Also iqf close history marketdepth realtime timeseries 5 70 realtime Purpose Syntax Description Arguments Examples IQFEED asynchronous level 1 data realtime Q S realtime Q S F realtime Q S elistener ecallback realtime Q S returns asynchronous level 1 data using uses the current update field list default socket listener and event handler realtime Q S F returns asynchronous level 1 data for a specified field list using the default socket listener and event handler realtime Q S elistener ecallback returns asynchronous level 1 data using an explicitly def
31. you already have blpapi3 jar downloaded from Bloomberg you can find it in your Bloomberg directories at blp api APIv3 JavaAPI lib blpapi3 jar or b1lp api APIv3 JavaAPI v3 3 1 0 lib blpapi3 jar If you have blpapi3 jar proceed to Step 3 If blpapi3 jar is not downloaded from Bloomberg you can download it as follows 1 In your Bloomberg terminal type WAPI GO to display the Desktop Server API screen 2 Select SDK Download Center and then click Desktop v3 x API 3 Once you haveblpapi3 jar on your system add it to the MATLAB Java classpath using javaaddpath This is must be done for every session of MATLAB To avoid repeating this at every session you can add javaaddpath to your startup m file or you can add the full path for blpapi3 jar to your classpath txt file Establish a connection c to a Bloomberg data server c blp Establish a connection using the default port of 8194 and localhost as the IP address with a timeout value of 10 seconds c blp 10000 bip See Also category close fieldinfo fieldsearch getdata history realtime timeseries 5 21 category 5 22 Purpose Syntax Description See Also Bloomberg V8 field category search d category c f d category c f returns category information given a search string f The data returned is an N by 5 cell array containing categories field IDs field mnemonics field names and field data types for each of
32. 114 Connect to Kx Systems Inc kdb databases k kx ip p k kx ip p id ip IP address for the connection to the Kx Systems Inc kdb database p Port for the Kx Systems Inc kdb database connection id The username password string for the Kx Systems Inc kdb database connection k kx ip p connects to the Kx Systems Inc kdb database given the IP address ip and port number p k kx ip p id connects to the Kx Systems Inc kdb database given the IP address ip port number p and username password string id Before you connect to the database add The Kx Systems Inc file jdbc jar to the MATLAB javaclasspath using the javaaddpath command The following example adds jdbc jar to the MATLAB javaclasspath c q java javaaddpath c q java jdbc jar Note In earlier versions of the Kx Systems Inc kdb database this jar file was named kx jar If you are running an earlier version of the database substitute kx jar for jdbc jar in these instructions to add this file to the MATLAB javaclasspath Run the following command from a DOS prompt to specify the port number 5001 q tradedata q p 5001 See Also Connect to a Kx Systems Inc server using IP address LOCALHOST and port number 5001 k kx LOCALHOST 5001 handle 1x1 c ipaddress localhost port 5001 close exec get fetch tables 5 115 close Purpose Close connections to Kx Systems Inc kdb databases Syn
33. 2 request type enter AaplTickData submitftp R AAPL O Nominal Value now 05 now NasdaqLevel2 Nominal Value NSQ EQU To use a MarketDepth level of 3 enter AaplTickData submitftp R AAPL O Bid Price Bid Size now 05 now MarketDepth Market Depth NSQ EQU 3 fetch get rdth rdthloader status 5 141 rdthloader Purpose Syntax Arguments Description 5 142 Retrieve data from Thomson Reuters Tick History file x rdthloader file x rdthloader file date DATE1 x rdthloader file date DATE1 DATE2 x rdthloader file security SECNAME x rdthloader file start STARTREC x rdthloader file records NUMRECORDS Specify the following arguments as name value pairs You can specify any combination of name value pairs in a single call to rdthloader file Thomson Reuters Tick History file from which to retrieve data date Use this argument with DATE1 DATE2 to retrieve data between and including the specified dates Specify the dates as numbers or strings security Use this argument to retrieve data for SECNAME where SECNAME is a cell array containing a list of security identifiers for which to retrieve data start Use this argument to retrieve data beginning with the record STARTREC where STARTREC is the record at which rdthloader begins to retrieve data Specify STARTREC as a number records Use this
34. 73 timeseries timeseries q ABC floor now now openvar IQFeedTimeseriesData Return the intraday ticks for a daterange and per of 60 seconds and use the default socket listener and event handler and then display the results in the MATLAB workspace in the variable IQFeedTimeseriesData timeseries q ABC 02 12 2012 09 30 00 02 12 2012 16 00 00 60 openvar IQFeedTimeseriesData Return the intraday ticks for a dateranage on the security ABC using the function handles iqfeedlistener and iqfeedeventhandler Display the results in the MATLAB workspace in the variable TQFeedTimeseriesData timeseries q ABC floor now now iqtimeseriesfeedlistener iqtimeseriesfeedeventhandler openvar IQFeedTimeseriesData See Also iqf close history marketdepth realtime 5 74 factset Purpose Syntax Arguments Description Examples See Also Establish connection to FactSet data Connect factset UserName SerialNumber Password ID UserName User login name SerialNumber User serial number Password User password ID FactSet customer identification number Note FactSet assigns values to all input arguments Connect factset UserName SerialNumber Password ID connects to the FactSet interface Establish a connection to FactSet data Connect factset username 1234 password fsid Connect user username serial 1234 password p
35. ATA Fields Override Values Ident data fetch Connect Security TIMESERIES Date Minutes TickField data fetch Connect Security HISTORY Fields FromDate ToDate Period Currency Ident ticker fetch Connect SearchString LOOKUP Market data fetch Connect Security REALTIME Fields MATLABProg data fetch Connect Security STOP For a given security fetch returns header default current time series real time and historical data via a connection to a Bloomberg data server data fetch Connect Security fills the header fields with data from the most recent date with a bid ask or trade data fetch Connect Security HEADER Flag Ident returns data for the most recent date of each individual field for the specified security type identifiers based upon the value of Flag e If Flag is DEFAULT fetch fills the header fields with data from the most recent date with a bid ask or trade Alternatively you could use the command data fetch Connect Security e If Flag is TODAY fetch returns the header field data with data from today only e If Flag is ENHANCED fetch returns the header field data for the most recent date of each individual field In this case for example the bid and ask group fields could come from different dates fetch data fetch Connect Security
36. Connect to the Bloomberg Data Server 2 3 Connection Object Properties 000055 2 5 Retrieve Connection Properties 0 kk k 2 5 Retrieve Data ona Security cece KK RR RR eee 2 6 Disconnect from Data Servers 0000 kk k 2 7 Example Retrieve Bloomberg Data 3 About This Example KK KK RR RR KK KK K 8 2 Retrieve Field Data RR RR KK KK KK 3 3 Retrieve Time Series Data 0 0 00 0 cee eee 3 4 Retrieve Historical Data 0 KK KK 3 5 Datafeed Toolbox Graphical User Interface 4 Introduction kk k kK kK kk KK KK kk kK kK KK kk kk kk k 4 2 Retrieve Data with the Datafeed Dialog Bx 4 3 Connecting to Data Servers KK KK KK KK K 4 4 R trieving Data ccs lt AR bek be a WW Vala wla al n 4 5 Setting Overrides kk kK KK KK KK KK KK kk kk kk kk 4 6 Obtain Ticker Symbol with the Datafeed Securities Lookup Dialog Box 0 cece eens 4 9 Functions Alphabetical List 5 Index vi Contents Getting Started e Product Description on page 1 2 e About Data Servers and Data Service Providers on page 1 3 1 Getting Started Product Description Access financial data from data service providers Datafeed Toolbox provides access to current intraday historical and real time market data from leading financial data provi
37. Datafeed Toolbox User s Guide R2013a A K 1x AT 7 few n EPA W y pence kenya lt j MathWorks x OF How to Contact MathWorks www mathworks com Web comp soft sys matlab Newsgroup www mathworks com contact_TS html Technical Support suggest mathworks com Product enhancement suggestions bugs mathworks com Bug reports doc mathworks com Documentation error reports service mathworks com Order status license renewals passcodes info mathworks com Sales pricing and general information 508 647 7000 Phone 508 647 7001 Fax The MathWorks Inc 3 Apple Hill Drive Natick MA 01760 2098 For contact information about worldwide offices see the MathWorks Web site Datafeed Toolbox User s Guide COPYRIGHT 1999 2013 by The MathWorks Inc The software described in this document is furnished under a license agreement The software may be used or copied only under the terms of the license agreement No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks Inc FEDERAL ACQUISITION This provision applies to all acquisitions of the Program and Documentation by for or through the federal government of the United States By accepting delivery of the Program or Documentation the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined
38. Ds like this d I k ans 1758999 149 134 275027 148 184 View the pricing data field IDs like this getdata ans 33 2 1 33 3 1 3 1 1 33 2 1 33 3 1 3 1 1 And the pricing data like this d P v ans 44 94 44 95 0 9715 0 9717 Convert field IDs in d P k to field names like this d P k tkidtofield c d P k market Load the file tlkrs tkfields mat for a listing of the field names Bid Ask Last and corresponding IDs See Also tlkrs history timeseries tkfieldtoid tkidtofield 5 175 history Purpose Syntax Description Examples 5 176 End of day SIX Financial Information data D history c s f fromdate todate D history c s f fromdate todate returns the historical data for the security list s for the fields f for the dates fromdate to todate Retrieve end of day SIX Financial Information data for the specified security for the past 5 days c tlkrs US12345 userapidO1 userapid10 ids tkfieldtoid c Bid Ask history d history c 1758999 149 134 ids floor now 5 floor now d XRF 1x1 struct IL 1x1 struct I 1x1 struct HL 1x1 struct HD 1x1 struct P 1x1 struct d I contains the instrument IDs d HD contains the dates and d P contains the pricing data View the dates d HD d ans 20110225 20110228 20110301 View the pricing field IDs history See
39. Editor java 61 at com reuters rfa tools config editor ConfigEditor main ConfigEditor java 1303 To address this problem download an XML parser file and then include a path to this file in your CLASSPATH environment variable The following example shows how to set your CLASSPATH environment variable to include the XML parser file C xerces jar downloaded from http xerces apache org xerces j index html set CLASSPATH CLASSPATH matlabroot toolbox datafeed datafeed config editor jar c xerces jar 1 7 1 Getting Started 1 8 Thomson Reuters Data Service Requirements You need the following to connect to Thomson Reuters data servers e A license for Thomson Reuters Datastream DataWorks To connect to the Thomson Reuters Datastream API from the Web you need a user name password and URL provided by Thomson Reuters For more information see the Thomson Reuters Web site at http www thomsonreuters com Communicate with Financial Data Servers e Communicate with Data Servers on page 2 2 e Connect to the Bloomberg Data Server on page 2 3 e Connection Object Properties on page 2 5 e Disconnect from Data Servers on page 2 7 2 Communicate with Financial Data Servers 2 2 Communicate with Data Servers This section uses the Bloomberg financial data server as an example of how to retrieve data with the Datafeed Toolbox software To establish a connection to the Bloomber
40. GETDATA Fields Override Values Ident returns the current market data for the specified fields of the indicated security You can further specify the data with the optional Override Values and Ident arguments Note If a call to the fetch function with the GETDATA argument encounters an invalid security in a list of securities to retrieve it returns NaN data for the invalid security s fields data fetch Connect Security TIMESERIES Date Minutes TickField returns the tick data for a single security for the specified date You can further specify data with the optional Minutes and TickField arguments If there is no data found in the specified range which must be no more than 50 days fetch returns an empty matrix You can specify TickField as a string or numeric value For example TickField Trade or TickField 1 returns data for ticks of type Trade The function dftool ticktypes returns the list of intraday tick fields fetch returns intraday tick data requested with an interval with the following columns Time e Open e High e Low e Value of last tick e Volume total value of ticks Total value of ticks for the time range e Number of ticks The fetch function returns columns 7 and 8 only if they make sense for the requested field 5 7 fetch 5 8 For today s tick data enter the command data fetch Connect Security TIMESERIES now For
41. P Address Using default IP Address Current Connections How To Retrieve Data with the Datafeed Dialog Box on page 4 3 bloomberg 5 4 Purpose Syntax Description Examples See Also Connect to Bloomberg data servers bloomberg is not recommended Use b1p instead e Il bloomberg c bloomberg establishes a connection c to a Bloomberg data server It uses port number 8194 and the default internet address provided when you installed the Bloomberg software on your machine Establish a connection c to a Bloomberg data server c bloomberg close fetch get isconnection close Purpose Syntax Arguments Description Examples See Also Close connections to Bloomberg data servers bloomberg is not recommended Use b1p instead close Connect Connect Bloomberg connection object created with the bloomberg function close Connect closes the connection to the Bloomberg data server Establish a Bloomberg connection c c bloomberg Close this connection close c bloomberg 5 5 fetch 5 6 Purpose Syntax Description Request data from Bloomberg data servers fetch is not recommended Use the blp functions getdata history realtime ortimeseries instead data fetch Connect Security data fetch Connect Security HEADER Flag Ident data fetch Connect Security GETD
42. Purpose Syntax Description Arguments Examples IQFEED asynchronous historical end of period data timeseries Q S daterange news Q S daterange per elistener ecallback timeseries Q S daterange returns intraday ticks for the given date range using the default socket listener and event handler news Q S daterange per elistener ecallback returns intraday ticks for the given date range and defined period using an explicitly defined socket listener and event handler Data requests are returned asynchronously For requests that return a large number of ticks there may be a significant lag between the request and when the data is returned to the MATLAB workspace Q IQFEED connection handle created using iqf S S is a single security input daterange Ether a scalar value that specifies how many periods of data to return or a date range of the form startdate enddate startdate and enddate can be input as MATLAB date numbers or strings per Specifies in seconds the bar interval of the ticks used to aggregate ticks into intraday bars elistener Function handle that specifies the function used to listen for data on the IQFEED Lookup port ecallback Function handle that specifies the function that processes data event Return intraday ticks for a given daterange and use the default socket listener and event handler and then display the results in the MATLAB workspace in the variable IQ FeedTimeseriesData 5
43. Q iqf username password Admin close history marketdepth news realtime timeseries 5 63 close 5 64 Purpose Syntax Description Arguments Examples See Also Close IQFEED ports close Q close Q closes all IQFEED ports currently open for a given IQFEED connection handle Q Q IQFEED connection handle created using iqf Close all ports for an IQFEED connection handle close Q iqf history Purpose Syntax Description Arguments Examples IQFEED asynchronous historical end of period data history Q S daterange history Q S daterange per elistener ecallback history Q S daterange asynchronously returns historical end of period data using the default periodicity socket listener and event handler history Q S daterange per elistener ecallback asynchronously returns historical end of period data explicitly specifying the periodicity socket listener and event handler Data is returned asynchronously for requests For requests that return a large number of data points there may be significant lag between the request and when the data is returned to the MATLAB workspace Q IQFEED connection handle created using iqf S S is a single security input daterange Ether a scalar value that specifies how many periods of data to return or a date range of the form startdate enddate startdate and enddate can be input as MATLAB date numbers or strings per Specif
44. See Also blp getdata history realtime timeseries 5 45 timeseries 5 46 Purpose Syntax Description Tips Bloomberg V3 intraday tick data d timeseries c s t d timeseries c s StartDate EndDate d timeseries c s t b f d timeseries c s t f api val d timeseries c s t returns raw tick data d for the security s and connection object c for a specific date t d timeseries c s StartDate EndDate returns raw tick data for the date range defined by StartDate and EndDate d timeseries c s t b f returns tick data in intervals of b minutes for the field f Intraday tick data requested over a certain interval is returned with columns representing Time Open High Low Last Price Volume of Ticks Number of Ticks and Total Tick Value in the bar d timeseries c s t f api val returns tick data for the field f The cell array of api options can include any of includeConditionCodes includeExchangeCodes and includeBrokerCodes You can set the corresponding cell array of values to true or false For better performance add the Bloomberg file blpapi3 jar to the MATLAB static Java class path by modifying the file MATLAB toolbox local classpath txt For more information about the static Java class path see The Static Path e You cannot retrieve Bloomberg intraday tick data for a date more than 140 days ago e Bloomberg V3 intraday tick data supports additional n
45. a for the variable FFED D fetch H FFED Retrieving Variable Data for a Specified Date Range Return data for FFED from 01 01 1997 to 09 01 2007 D fetch H FFED 01 01 1997 09 01 2007 Retrieving Monthly Variable Data for a Specified Date Range Return data for FFED converted to monthly values from 01 01 1997 to 09 01 2007 D fetch H FFED 01 01 1997 09 01 2007 M close get isconnection haver info nextinfo 5 99 get Purpose Syntax Arguments Description Examples See Also 5 100 Retrieve properties from Haver Analytics connection objects lt l get H PropertyName get H lt Il H Haver Analytics connection object created with haver PropertyName A MATLAB string or cell array of strings containing property names The property name is Databasename V get H PropertyName returns a MATLAB structure containing the value of the specified properties for the Haver Analytics connection object V get H returns a MATLAB structure where each field name is the name of a property of H Each field contains the value of the property Establish a Haver Analytics connection HDAILY HDAILY haver d work haver data haverd dat Retrieve the name of the Haver Analytics database V get HDAILY databasename V databasename d work haver data haverd dat close fetch isconnection haver info Purpose Syntax Arguments Desc
46. a server For more information see Retrieving Data on page 4 5 3 Click the Disconnect button to terminate the session highlighted in the Current Connections box For Bloomberg data servers you must also specify the port number and IP address of the server 1 Enter the port number on the data server in the Port Number field 2 Enter the IP address of the data server in the IP Address field 3 To establish a connection to the Bloomberg data server follow steps 1 through 3 above Tip You can also connect to the Bloomberg data server by selecting the Connect button and accepting the default values Retrieving Data The Data tab allows you to retrieve data from the data server as follows 1 Enter the security symbol in the Enter Security field 2 Indicate the type of data to retrieve in the Data Selection field 3 Specify whether you want the default set of data or the full set e Select the Default fields button for the default set of data e Select the All fields button for the full set of data 4 Click the Get Data button to retrieve the data from the data server 5 Optional Click the Override button if you want to set overrides on the data you request from the data server For more information see Setting Overrides on page 4 6 The following figure summarizes these steps 4 5 4 Datafeed Toolbox Graphical User Interface 2a Use to find security symbol if unknown 2 Enter security symbol if k
47. al librarypath txt file that points to the folder containing the following files FDacsLib dll sass3j d1l sipc32 d11 See Also addric close contrib deleteric fetch get history stop rmdsconfig 5 155 addric Purpose Syntax Description Examples See Also 5 156 Create Reuters Instrument Code addric r ric fid fval type addric r ric fid fval type creates a Reuters Instrument Code ric on the service defined by the Reuters session r Supply the field ID or name fid and the field value fval Specify whether the RIC type is live or static default Create a live RIC called myric with the fields trdprc_1 field ID 6 and bid field ID 22 set to initial values of 0 addric r myric trdprc_1 bid 0 0 live Create a live RIC called myric with the fields trdprc_1 and bid set to initial values of 0 addric r myric 6 22 0 0 live reuters contrib deleteric fetch close Purpose Syntax Arguments Description Examples See Also Release connections to Reuters data servers close r r Reuters session object created with reuters close r releases the Reuters connection r Release the connection r to the Reuters data server and unsubscribe all requests associated with it close r reuters 5 157 contrib Purpose Syntax Description Examples See Also 5 158 Contribute data to Reuters datafeed contrib r s fid
48. ame value parameters To access further information on these additional name value parameters see Bloomberg API Developer s Guide documentation available using the WAPI lt GO gt option from the Bloomberg terminal timeseries Examples Return today s time series for the given security d timeseries c ABC US Equity floor now The timestamp and tick value are returned Return today s Trade tick series for the given security aggregated into 5 minute intervals d timeseries c ABC US Equity floor now 5 Trade Return the Trade tick series for the past 50 days for the given security ageregated into 5 minute intervals d timeseries c ABC US Equity floor now 50 floor now 5 Trade Return the Bid Ask and Trade tick series for the security RIM CT Equity on June 22 2011 during a specified 5 minute interval without specifying the aggregation parameter d timeseries c RIM CT Equity 06 22 2011 12 15 00 06 22 2011 12 20 00 Bid Ask Trade Return the Trade tick series for the security RIM CT Equity on June 22 2011 during a specified 5 minute interval Also return the condition codes exchange codes and broker codes d timeseries c RIM CT Equity 06 22 2011 12 15 00 06 22 2011 12 20 00 Trade includeConditionCodes includeExchangeCodes includeBrokerCodes true true true See Also blp history realtime 5 47 dat
49. argument to retrieve NUMRECORDS number of records x rdthloader file retrieves tick data from the Thomson Reuters Tick History file file and stores it in the structure x x rdthloader file date DATE1 retrieves tick data from file with date stamps of value DATE1 rdthloader Examples x rdthloader file date DATE1 DATE2 retrieves tick data from file with date stamps between DATE1 and DATE2 x rdthloader file security SECNAME retrieves tick data from file for the securities specified by SECNAME x rdthloader file start STARTREC retrieves tick data from file beginning with the record specified by STARTREC x rdthloader file records NUMRECORDS retrieves NUMRECORDS number of records from file Retrieve all ticks from the file file csv with date stamps of 02 02 2007 x rdthloader file csv date 02 02 2007 Retrieve all ticks from file csv between and including the dates 02 02 2007 and 02 03 2007 x rdthloader file csv date 02 02 2007 02 03 2007 Retrieve all ticks from file csv for the security XYZ 0 x rdthloader file csv security XYZ 0 Retrieve the first 10 000 tick records from file csv x rdthloader file csv records 10000 Retrieve data from file csv starting at record 100 000 x rdthloader file csv start 100000 Retrieve up to 100 000 tick records from file csv for the securities ABC N and XYZ 0 with date stamps between and i
50. ariable en eso fpi Jen 206 AB cose 5 106 havertool Examples See Also The GUI fields and buttons are e Database The currently selected Haver Analytics database e Browse Allows you to browse for Haver Analytics databases and populates the variable list with the variables in the database you specify e Start Date The data start date of the selected variable e End Date The data end date of the selected variable e Workspace Variable The MATLAB variable to which havertool writes data for the currently selected Haver Analytics variable e Close Closes all current connections and the Haver Analytics GUI Establish a Haver Analytics connection H H haver d work haver data haverd dat Open the graphical user interface GUI demonstration havertool H haver 5 107 Purpose Syntax Description Examples See Also 5 108 Connect to Interactive Data Pricing and Reference Data s RemotePlus data servers Connect idc Connect idc connects to the Interactive Data Pricing and Reference Data s RemotePlus server Connect is a connection handle used by other functions to obtain data Connect to an Interactive Data Pricing and Reference Data s RemotePlus server c idc close fetch get isconnection close Purpose Syntax Arguments Description Examples See Also Close connections to Interactive Data Pricing and Reference Data s RemotePl
51. assword cid fsid close fetch get isconnection 5 75 close 5 76 Purpose Syntax Arguments Description See Also Close connection to FactSet close Connect Connect FactSet connection object created with factset close Connect closes the connection to FactSet data factset fetch Purpose Syntax Arguments Request data from FactSet data fetch Connect data fetch Connect Library data fetch Connect Security Fields data fetch Connect Security Fields FromDate ToDate data fetch Connect Security FromDate ToDate Period Connect Library Security Fields Date FromDate FactSet connection object created with the factset function FactSet formula library A MATLAB string or cell array of strings containing the names of securities in a format recognizable by the FactSet server A MATLAB string or cell array of strings indicating the data fields for which to retrieve data Date string or serial date number indicating date for the requested data If you enter today s date fetch returns yesterday s data Beginning date for date range Note You can specify dates in any of the formats supported by datestr and datenum that display a year month and day 5 77 fetch 5 78 Description ToDate End date for date range Period Period within date range Period values are e
52. astream Purpose Establish connections to Thomson Reuters Datastream API Syntax Connect datastream UserName Password Source URL Arguments UserName User name Password User password Source To connect to the Thomson Reuters Datastream API enter Datastream in this field URL Web URL Note Thomson Reuters assigns the values for you to enter for each argument Enter all arguments as MATLAB strings Description Connect datastream UserName Password Source URL makes a connection to the Thomson Reuters Datastream API which provides access to Thomson Reuters Datastream software content Examples Establish a connection to the Thomson Reuters Datastream APITI Connect datastream User1 Pass1 Datastream http dataworks thomson com Dataworks Enterprise 1 0 Note If you get an error connecting verify that your proxy settings are correct in MATLAB by selecting Preferences gt Web in the MATLAB Toolstrip See Also datastream close datastream fetch datastream get datastream isconnection 5 48 datastream close Purpose Syntax Arguments Description See Also Close connections to Thomson Reuters Datastream data servers close Connect Connect Thomson Reuters Datastream connection object created with the datastream function close Connect closes a connection to a Thomson Reuters Datastream data server datastream 5 49 fetch Purpose
53. berg terminal Anchor Date The anchor date is the date to which all other reported dates are related For blp history for periodicities other than daily ToDate is the anchor date For example if you set the period to weekly and the ToDate is a Thursday every reported data point would also be a Thursday or the nearest prior business day to Thursday Similarly if you set the period to monthly and the ToDate is the 20th of a month each reported data point would be for the 20th of each month in the date range Return the closing price for the given dates for the given security using the default period of the data d sec history c ABC US Equity LAST_PRICE 8 01 2010 8 10 2010 Return the monthly closing price for the given dates for the given security d sec history c ABC US Equity LAST_PRICE 8 01 2010 12 10 2010 monthly Return the monthly closing price converted to US dollars for the given dates for the given security d sec history c ABC US Equity LAST_PRICE 8 01 2010 12 10 2010 monthly USD history Return the daily closing price converted to US dollars for the given dates for the given security d sec history c ABC US Equity LAST_PRICE 8 01 2010 8 10 2010 daily actual all_calendar_days nil_value USD Return the weekly closing price converted to US dollars for the given dates for the
54. by Datastream Note The Thomson Reuters Datastream interface returns all data as strings For example it returns Price data to the MATLAB workspace as a cell array of strings within the structure There is no way to determine the data type from the Datastream interface Retrieving Time Series Data Return the trailing one year price time series for the instrument ICI with the default value P for the Fields argument using the command data fetch Connect ICI Or the command data fetch Connect ICI P Retrieving Opening and Closing Prices Return the closing and opening prices for the instruments ICI on the date September 1 2007 fetch See Also data fetch Connect ICI P PO 09 01 2007 Retrieving Monthly Opening and Closing Prices for a Specified Date Range Return the monthly closing and opening prices for the securities ICI and IBM from 09 01 2005 to 09 01 2007 data fetch Connect ICI IBM P PO 09 01 2005 09 01 2007 M Retrieving Static Data Return the static fields NAME and ISIN data fetch Connect IBM REP NAME ISIN You can also return SECD in this way Retrieving Russell 1000 Constituent List Return the Russell 1000 Constituent List russell fetch Connect LFRUSS1L LIST UserName where UserName is the username for the Datastream connection close datastream get isconnection 5 53 get Purpose Sy
55. ch string list Datafeed Securities Lookup Lookup Security ORD e g Intl Ford AT amp T MOTOR Choose Market Equity v 1 Indicate choice of market 3 Click to send request to data server 4 10 FORDA NA FU NA 1411Zz SW iF US FDMTF US FG IX FZ IX 5 Enter selected securities on Data tab Functions Alphabetical List dftool 5 2 Purpose Syntax Description Examples Datafeed dialog box dftool The Datafeed dialog box establishes the connection with the data server and manages data retrieval Use this dialog box to connect to and retrieve data from the following service providers e Bloomberg e Interactive Data Pricing and Reference Data s RemotePlus e Yahoo To display this dialog box enter the dftool command in the MATLAB Command Window The Datafeed dialog box consists of two tabs e The Connection tab establishes communication with a data server For more information see Connecting to Data Servers on page 4 4 The Data tab specifies the data request For more information see Retrieving Data on page 4 5 e You can also set overrides for the data you retrieve For more information see Setting Overrides on page 4 6 dftool dftool Data Source Connection History 17 41 48 Connect to Yahoo conn yahoo http download finance yahoo com Yahoo Port Number Using default port I
56. com bloomberglp blpapi Session For example return just the connection handle with the ipaddress argument ip get c ipaddress ip localhost 2 5 2 Communicate with Financial Data Servers 2 6 Note A single property is not returned as a structure Retrieve Data on a Security Establish a connection b to a Bloomberg data server c blp Use timeseries to return data on a security d timeseries c IBM US Equity floor now To return data on a particular field for a range of dates use history data history c IBM US Equity Last_Price 07 15 2009 08 02 2009 Disconnect from Data Servers Disconnect from Data Servers To close a data server connection and disconnect use close with the format close c You must have previously created the connection object with one of the connection functions 2 7 2 Communicate with Financial Data Servers 2 8 Example Retrieve Bloomberg Data e About This Example on page 3 2 e Retrieve Field Data on page 3 3 e Retrieve Time Series Data on page 3 4 e Retrieve Historical Data on page 3 5 3 Example Retrieve Bloomberg Data About This Example The following example illustrates the use of the blp functions to retrieve data from a Bloomberg data server Note If you have not used the blp function before you will need to add the file blpapi3 jar to the MATLAB Java classpath Use the javaaddpath
57. connection r See Also rdth 5 130 fetch Purpose Syntax Description Tips Request Thomson Reuters Tick History data gt l fetch r sec fetch r sec tradefields daterange reqtype messtype exchange domain x fetch r sec tradefields daterange reqtype messtype exchange domain marketdepth gt Il x fetch r sec returns information about the security sec such as the code currency exchange and name r is the Thomson Reuters Tick History connection object xX fetch r sec tradefields daterange reqtype messtype exchange domain returns data for the request security sec based on the type request and message types reqtype and messtype respectively Data for the fields specified by tradefields is returned for the data range bounded by daterange Specifying the exchange of the given security improves the speed of the data request domain specifies the security type x fetch r sec tradefields daterange reqtype messtype exchange domain mat additionally specifies the depth of level 2 data marketdepth to return for a MarketDepth request type marketdepth must be a numeric value between 1 and 10 returning up to 10 bid ask values for a given security Note Do not use date ranges for end of day requests You can specify a range of hours on a single day but not a multiple day range To obtain more information request and message types and their associated field lists use the co
58. ders By integrating these data feeds into MATLAB you can develop realistic models that reflect current financial and market behaviors The toolbox also provides functions to export MATLAB data to some data service providers You can establish connections from MATLAB to retrieve historical data or subscribe to real time streams from data service providers With a single function call the toolbox lets you customize queries to access all or selected fields from multiple securities over a specified time period You can also retrieve intraday tick data for specified intervals and store it as time series data Key Features e Current intraday historical and real time market data access e Customizable data access by security lists time periods and other fields e Intraday tick data retrieval as a time series e Real time security data access e Bloomberg Thomson Reuters and other data server provider support e Haver Analytics and Federal Reserve Economic Data FRED economic data support 1 2 About Data Servers and Data Service Providers About Data Servers and Data Service Providers In this section Supported Data Service Providers on page 1 3 Data Server Connection Requirements on page 1 4 Supported Data Service Providers This toolbox supports connections to financial data servers that the following corporations provide Bloomberg L P http www bloomberg com Note Only Blo
59. e Override values Override fields ku Load Save Delete Cancel 1 Select field to override 4a Apply overrides and close 4 Apply overrides to current dialog Return to previous session dialog box 4 8 Obtain Ticker Symbol with the Datafeed Securities Lookup Dialog Box Obtain Ticker Symbol with the Datafeed Securities Lookup Dialog Box When requesting data from Bloomberg or Interactive Data Pricing and Reference Data s RemotePlus servers you can use the Datafeed Securities Lookup dialog box to obtain the ticker symbol for a given security if you know only part of the security name 1 Click the Lookup button on the Datafeed dialog box Data tab The Securities Lookup dialog box opens 2 Specify your choice of market in the Choose Market field 3 Enter the known part of the security name in the Lookup field 4 Click Submit All possible values of the company name and ticker symbol corresponding to the security name you specified display in the Security and Symbol list 5 Select one or more securities from the list and then click Select The selected securities are added to the Selected Securities list on the Data tab The following figure summarizes these steps 4 Datafeed Toolbox Graphical User Interface 4 Search results returned from data server This field displays all possible values of company name and ticker symbol Select desired securities from 2 Enter lookup sear
60. e stop stop Purpose Syntax Description Input Arguments Examples See Also Cancel real time request stop F T stop F T cancels a real time request This function cleans up resources associated with real time requests that are no longer needed F Connection object object structure Connection object specified using fds T Real time request tag nonnegative integer Real time request tag specified using realtime Data Types double Cancel FDS Real Time Request Terminate a FSD real time request T f realtime FDS1 GOOG USA f stop T fds close realtime 5 87 close 5 88 Purpose Syntax Description Input Arguments Examples See Also Disconnect from FactSet Data Server close F close F disconnects from the FactSet Data Server or local workstation given the connection object F F Connection object object structure Connection object specified using fds Close FDS Connection Close the FDS connection F f realtime FDS1 GOOG USA close F fds realtime stop fred Purpose Syntax Arguments Description Examples See Also Connect to FRED data servers Connect fred URL Connect fred URL Create a connection using a specified URL Connect fred URL establishes a connection to a FRED data server Connect fred verifies that the URL http research stlouisfed org fred2 is accessible and creates a connection
61. e timeseries getdata isconnection Purpose true if valid Bloomberg V3 connection Syntax x isconnection c Description x isconnection c returns true if c is a valid Bloomberg V3 connection and false otherwise isconnection is not recommended Use b1p instead See Also blp close getdata 5 37 realtime 5 38 Purpose Syntax Description Examples Bloomberg V3 real time data retrieval d realtime c sec fields subs t realtime c sec fields api d realtime c sec fields returns the data for the given connection c security list sec and requested fields fields subs t realtime c sec fields api returns the subscription list subs and the timer t associated with the real time callback for the subscription list Given connection c the realtime function subscribes to a security or securities sec and requests fields fields to update in real time while running a function api Subscribe to a Security and Request Field Updates while Running v3stockticker Subscribe to the security ABC US Equity Request that the fields Last_Trade and Volume update in real time while the function v3stockticker is running subs t realtime c ABC US Equity Last_Trade Volume v3stockticker realtime returns only the most recent event that is data for a single security when you use it in snapshot mode with no callback To get data for multiple securities use x
62. e type Trade and the requestType of the Trade message the command v get r MessageTypes returns v RequestType 31x1 cell Name 31x1 cell Fields 31x1 cell The command v Name then returns ans 5 125 rdth 5 126 C amp E Quote Short Sale Fund Stats Economic Indicator Convertibles Transactions FI Quote Dividend Trade Stock Split Settlement Price Index Open Interest Correction Quote OTC Quote Stock Split Market Depth Dividend Stock Split Market Maker Dividend Stock Split Intraday 1Sec Dividend Intraday 5Min Intraday 1Min Intraday 10Min Intraday 1Hour Stock Split End Of Day Dividend The command find strcmp v Name Trade returns rdth j 8 The command v Name j returns ans Trade The command v RequestType 8 returns ans TimeAndSales The command v Fields j returns ans Exchange ID Price Volume Market VWAP Accumulative Volume Turnover Buyer ID Seller ID Qualifiers Sequence Number Exchange Time Block Trade Floor Trade PE Ratio 5 127 rdth 5 128 Yield Implied Volatility Trade Date Tick Direction Dividend Code Adjusted Close Price Price Trade Through Exempt Flag Irregular Trade Thr
63. e strcemp v InstrumentTypes Name j v AssetDomains Name returns 5 133 fetch See Also 5 134 ans EQU Knowing the security exchange and domain helps the interface to resolve the security symbol and return data more quickly For a NasdaqLevel2 request type enter Aap1TickData fetch R AAPL O Nominal Value now 05 now NasdaqLevel2 Nominal Value NSQ EQU To use a MarketDepth level of 3 enter AaplTickData fetch R AAPL O Bid Price Bid Size now 05 now MarketDepth Market Depth NSQ EQU 3 rdth close get get Purpose Syntax Description Get Thomson Reuters Tick History connection properties v get r propertyname get r lt Il v get r propertyname returns the value of the specified properties for the rdth connection object PropertyName is a string or cell array of strings containing property names v get r returns a structure where each field name is the name of a property of r and each field contains the value of that property Properties include e AssetDomains e BondTypes Class Countries e CreditRatings Currencies Exchanges e FuturesDeliveryMonths e InflightStatus e InstrumentTypes MessageTypes e OptionExpiryMonths Quota RestrictedPEs e Version 5 135 get Examples 5 136 To create a Thomson Reuters Tick History connection the command r rdth user c
64. ed parameters as empty You can enter sync as 0 default for asynchronous commands and as 1 for synchronous commands 5 117 exec Examples See Also 5 118 Retrieve the data in the table trade using the connection to the Kx Systems Inc kdb database K k kx localhost 5001 Use the exec command to sort the data in the table trade in ascending order exec k date xasc trade Subsequent data requests also sort returned data in ascending order After running q tradedata q p 5001 at the DOS prompt the commands k kx localhost 5001 exec k DATE XASC TRADE sort the data in the table trade in ascending order Data later fetched from the table will be ordered in this manner fetch insert kx fetch Purpose Syntax Arguments Description Examples Request data from Kx Systems Inc kdb databases d fetch k ksql d fetch k ksql p1 p2 p3 k Kx Systems Inc kdb connection object created with kx ksql The Kx Systems Inc kdb command p1 p2 p3 Input parameters for the ksql command d fetch k ksql returns data from a Kx Systems Inc kdb database in a MATLAB structure where k is the Kx Systems Inc kdb object and ksql is the Kx kdb command ksq1 can be any valid kdb command The output of the fetch function is any data resulting from the command specified in ksql d fetch k ksql p1 p2 p3 executes the command specified in ksql with one or more input pa
65. editor rmdsconfig rmdsconfig opens the Reuters Market Data System configuration editor reuters rnseloader Purpose Syntax Arguments Description Retrieve data from Reuters Newscope sentiment archive file rnseloader file rnseloader file date DATE1 rnseloader file date DATE1 DATE2 rnseloader file security SECNAME rnseloader file start STARTREC rnseloader file records NUMRECORDS rnseloader file fieldnames F lt x XxX XxX K KK X li Specify the following arguments as name value pairs You can specify any combination of name value pairs in a single call to rnseloader file Reuters Newscope sentiment archive file from which to retrieve data date Use this argument with DATE1 DATE2 to retrieve data between and including the specified dates Specify the dates as numbers or strings security Use this argument to retrieve data for SECNAME where SECNAME is a cell array containing a list of security identifiers for which to retrieve data start Use this argument to retrieve data beginning with the record STARTREC where STARTREC is the record at which rnseloader begins to retrieve data Specify STARTREC as a number records Use this argument to retrieve NUMRECORDS number of records x rnseloader file retrieves data from the Reuters Newscope sentiment archive file file and stores it in the structure x x rnseloader file
66. er string Data source or supplier specified as a string Example FDS1 Data Types char Sec Security symbol string Security symbol specified as a string Example ABCD USA Data Types char Cb Event handler 5 85 realtime 5 86 Output Arguments Examples See Also function handle Event handler specified as a function handle requests real time or streaming data from the service FDS If Cb is not specified the default message event handler factsetMessageEventHandler is used Example varargin myMessageEventHandler varargin Data Types function_handle T Real time data tag nonnegative integer Real time data tag returned as a nonnegative integer from FDS Request FDS Real Time Data with User Defined Event Handler To request real time or streaming data for the symbol ABDC USA from the service FDS1 a user defined event handler myMessageEventHand1ler is used to process message events using this syntax t f realtime FDS1 ABCD USA varargin myMessageEventHandler varargin Request FDS Real Time Data Using Default Event Handler To request real time or streaming data for the symbol ABDC USA from the service FDS1 using this syntax t f realtime FDS1 ABCD USA The default event handler is used which returns a structure X to the base MATLAB workspace containing the latest data for the symbol ABCD USA X is updated as new message events are received fds clos
67. er Analytics database H haver Databasename Databasename Local path to the Haver Analytics database H haver Databasename establishes a connection to a Haver Analytics database Create a connection to the Haver Analytics database at the path d work haver data haverd dat H haver d work haver data haverd dat close fetch get isconnection 5 95 aggregation Purpose Set Haver Analytics aggregation mode Syntax X aggregation C X aggregation C V Description X aggregation C returns the current aggregation mode X aggregation C V sets the current aggregation mode to V The following table lists possible values for V Value of v Aggregation Behavior of aggregation function mode 0 strict aggregation does not fill in values for missing data 1 relaxed aggregation fills in missing data based on data available in the requested period 2 forced aggregation fills in missing data based on some past value 1 Not aggregation resets V to its last valid recognized setting See Also haver close fetch get info isconnection nextinfo 5 96 close Purpose Syntax Arguments Description Examples See Also Close Haver Analytics database close H H Haver Analytics connection object created with haver close H closes the connection to the Haver Analytics database Establish a connection H to a Haver Analytics database H haver d wor
68. eriod Optional String or cell array of strings containing override field list Default Optional String or cell array of strings containing override field values Date string serial date number or cell array of dates that specifies dates for the time series data Specify now to retrieve today s time series data Optional Numeric value for tick interval in minutes You cannot specify a fractional value for Minutes The smallest value you can specify is 1 Optional You can specify a string or numeric value for this field For example TickField Trade or TickField 1 return data for ticks of type Trade Use the command dftool ticktypes to return the list of intraday tick fields Beginning date for historical data Note You can specify dates in any of the formats supported by datestr and datenum that display a year month and day End date for historical data Optional Period of the data A MATLAB three part string with the format Frequency Days Data Frequency Values e d Daily default e w Weekly e m Monthly e q Quarterly e s Semiannually e y Yearly fetch Currency Days Values e o Omit all days for which there is no data default e i Include all trading days e a Include all calendar days Data Values e b Report missing data using Bloomberg default e s Show missing data as last found value e n Report missing data as NaN For example dan
69. erties p p get c Port IPAddress port 8194 ipaddress 111 222 33 444 get See Also bloomberg close fetch isconnection 5 15 isconnection 5 16 Purpose Syntax Arguments Description Examples See Also Verify whether connections to Bloomberg data servers are valid bloomberg is not recommended Use b1p instead x isconnection Connect Connect Bloomberg connection object created with the bloomberg function x isconnection Connect returns x 1 if the connection to the Bloomberg data server is valid and x 0 otherwise Establish a connection c to a Bloomberg data server c bloomberg Verify that c is a valid connection x isconnection c x 1 bloomberg close fetch get isfield Purpose Syntax Description Examples See Also Verify if valid Bloomberg field bloomberg is not recommended Use b1p instead x isfield c f x isfield c f returns true if specified field f is a valid Bloomberg field and false otherwise f can be a cell array of strings c is the Bloomberg connection handle x isfield c LAST_PRICE VOLUME OPEN HIGH returns x 1 1 1 1 bloomberg close bloomberg fetch bloomberg get bloomberg isconnection 5 17 lookup Purpose Syntax Description Examples See Also Bloomberg security search bloomberg is not recommended Use b1p instead d lookup c s market d looku
70. etch 5 x 6 9536e 007 See Also reuters close stop 5 162 get Purpose Syntax Arguments Description See Also Retrieve properties of Reuters session objects oO l get r get r f oO Il r Reuters session object created with reuters f Reuters session properties list e get r returns Reuters session properties for the Reuters session object r e get r f returns Reuters session properties specified by the properties list f for the Reuters session object r reuters 5 163 history Purpose Syntax Description 5 164 Request data from Reuters Time Series One history r s history r s p history r s f history r s f p history r s d history r s startdate enddate history r s startdate enddate p history r s f startdate enddate history r s f startdate enddate p agaqaqaqaqaaa Il d history r s returns all available daily historical data for the RIC s for the Reuters session object r d history r s p returns all available historical data for the RIC s for the Reuters session object r p specifies the period of the data e d daily default e w weekly e m monthly Note Reuters Time Series One will only return two years of daily data five years of weekly data or ten years of monthly data from the current date d history r s f returns all available historical data for the RIC s and fields f
71. etch Connect Series D1 D2 returns all data for Series using the connection object Connect for the date range D1 to D2 Note You can specify dates in any of the formats supported by datestr and datenum that show a year month and day 5 91 fetch Examples Fetch all available daily U S dollar to euro foreign exchange rates d fetch f DEXUSEU Title U S Euro Foreign Exchange Rate SeriesID DEXUSEU Source Board of Governors of the Federal Reserve System Release H 10 Foreign Exchange Rates SeasonalAdjustment Not Applicable Frequency Daily Units U S Dollars to One Euro DateRange 1999 01 04 to 2006 06 19 LastUpdated 2006 06 20 9 39 AM CT Notes Noon buying rates in New York City for cable transfers payable in foreign currencies Data 1877x2 double Fetch data for 01 01 2007 through 06 01 2007 d fetch f DEXUSEU 01 01 2007 06 01 2007 d Title U S Euro Foreign Exchange Rate SeriesID DEXUSEU Source Board of Governors of the Federal Reserve System Release H 10 Foreign Exchange Rates SeasonalAdjustment Not Applicable Frequency Daily Units U S Dollars to One Euro DateRange 1999 01 04 to 2006 06 19 LastUpdated 2006 06 20 9 39 AM CT Notes Noon buying rates in New York City for cable transfers payable in foreign currencies Data 105x2 double See Also close get isconnection 5 92 get Purpose Syn
72. for historical data 5 110 fetch Description Examples See Also Period Period within date range GUICategory GUI category Possible values are e F All valid field categories e S All valid security categories data fetch Connect Security Fields returns data for the indicated fields of the designated securities Load the file idc idcfields to see the list of supported fields data fetch Connect Security Fields FromDate ToDate returns historical data for the indicated fields of the designated securities data fetch Connect Security Fields FromDate ToDate Period returns historical data for the indicated fields of the designated securities with the designated dates and period Consult the Remote Plus documentation for a list of valid Period values data fetch Connect GUILookup GUICategory opens the Interactive Data Pricing and Reference Data s RemotePlus dialog box for selecting fields or securities Open the dialog box to look up securities D fetch Connect GUILookup S Open the dialog box to select fields D fetch Connect GUILookup F close get idc isconnection 5 111 get Purpose Syntax Arguments Description See Also 5 112 Retrieve properties of Interactive Data Pricing and Reference Data s RemotePlus connection objects value get Connect PropertyName value get Con
73. fval contrib r s fid fval contributes data to a Reuters datafeed r is the Reuters session object and s is the RIC Supply the field IDs or names fid and field values fval Contribute data to the Reuters datafeed for the Reuters session object r and the RIC myric Provide a last trade price of 33 5 contrib r myric trdprc_1 33 5 Contribute an additional bid price of 33 8 contrib r myric trdprce_1 bid 33 5 33 8 Submit value 33 5 for field 6 trdprc_1 contrib r myric 6 33 5 Add the value 33 8 to field 22 bid contrib r myric 6 22 33 5 33 8 reuters addric deleteric fetch deleteric Purpose Syntax Description Examples See Also Delete Reuters Instrument Code deleteric r ric deleteric r ric fid deleteric r ric deletes the Reuters Instrument Code ric and all associated fields r is the Reuters session object deleteric r ric fid deletes the fields specified by fid for the ric Delete myric and all of its fields deleteric r myric Delete the fields fid1 and fid2 from myric deleteric r myric fid1 fid2 reuters addric contrib fetch 5 159 fetch Purpose Syntax Arguments Description Examples 5 160 Request data from Reuters data servers d fetch r s d fetch r s callback d fetch r s f r Reuters session object created with reuters s Reuters security object callback MATLAB function
74. g data server use blp To retrieve connection properties use get To terminate a connection use close You can communicate with other supported data servers using a similar set of toolbox functions The table below lists functions used to connect to different data servers Data Server Toolbox Function Bloomberg blip eSignal esig FactSet factset or fds FRED fred Haver Analytics haver Interactive Data idc IQFEED iqf Kx Systems Inc kx SIX T inancial Information tlkrs Thomson Reuters datastream or reuters Yahoo yahoo To retrieve connection properties use get To terminate a connection use close Connect to the Bloomberg Data Server Connect to the Bloomberg Data Server This example shows how to use the b1p function to connect to the Bloomberg data server 1 If you have not used the blp function before you will need to add the file blpapi3 jar to the MATLAB Java classpath Use the javaaddpath function or edit your classpath txt file Note With the Bloomberg V3 release there is a Java archive file from Bloomberg that you need to install for blp and other commands work correctly If you already have blpapi3 jar downloaded from Bloomberg you can find it in your Bloomberg folders at blp api APIv3 JavaAPI lib blpapi3 jar or b1lp api APIv3 JavaAPI v3 3 1 0 lib blpapi3 jar If blpapi3 jar is not downloaded from Bloomberg you can download it as follo
75. given security Note that the anchor date is dependent on the date 12 23 1999 in this case Because this date is a Thursday each previous value will be reported for the Thursday of the week in question d sec history c ABC US Equity k LAST_PRICE 11 01 2010 12 23 2010 t weekly USD Return the closing price converted to US dollars for the given dates for the given security using the default period of the data The default period of a security is dependent on the security itself and not set in this function d sec history c ABC US Equity LAST_PRICE 8 01 2010 9 10 2010 USD Return the closing price converted to US dollars for the given dates for the given security using the default period of the data The prices are adjusted for normal cash and splits d sec history c ABC US Equity LAST_PRICE 8 01 2010 8 10 2010 daily USD adjustmentNormal true adjustmentSplit true 5 35 history 5 36 See Also When specifying Bloomberg override fields use the overrideOption The overrideOption argument must be an n by 2 cell array where the first column is the override field and the second column is the override value reqData3 history conn AKZA NA Equity BEST_EPS MEDIAN datenum 01 10 2010 dd mm yyyy datenum 30 10 2010 dd mm yyyy daily calendar overrideOption BEST_FPERIOD OVERRIDE BF CapChg true blp realtim
76. h field name is the name of a property of k and the associated value of the property Get the properties of the connection to the Kx Systems Inc kdb database K V v handle 1x1 c ipaddress localhost port 5001 get k close exec fetch insert kx 5 121 insert Purpose Syntax Arguments Description Examples See Also 5 122 Write data to Kx Systems Inc kdb databases insert k tablename data x insert k tablename data sync k The Kx Systems Inc kdb connection object created with kx tablename The name of the Kx Systems Inc kdb Tablename data The data that insert writes to the Kx Systems Inc kdb Tablename insert k tablename data writes the data data to the Kx Systems Inc kdb table tablename x insert k tablename data sync writes the data data to the Kx Systems Inc kdb table tablename synchronously For asynchronous calls enter sync as 0 default and for synchronous calls enter sync as 1 For the connection to the Kx Systems Inc kdb database k write data from ACME to the specified table insert k trade ACME 133 51 250 6 4 2006 10 24 close fetch get tables isconnection Purpose Syntax Arguments Description Examples See Also Verify whether connections to Kx Systems Inc kdb databases are valid x isconnection k k Kx Systems Inc kdb connection object created with kx x isconnection k
77. ication strings c is the SIX Financial Information connection object f is the field list and typ denotes the field Options for the field include market market time and sales tass and history history market fields are used with getdata tass fields are used with timeseries and history fields are used with history Retrieve pricing data associated with specified identification strings Connect to SIX Telekurs c tlkrs US12345 userapid01 userapidi0 Convert field names to identification strings ids tkfieldtoid c bid ask last market Retrieve data associated with the identification strings d getdata c 1758999 149 134 275027 148 184 ids tlkrs getdata history timeseries tkidtofield tkidtofield Purpose SIX Financial Information identification string to field name Syntax D tkidtofield c f typ Description D tkidtofield c f typ converts SIX Financial Information field identification strings to their corresponding field names c is the SIX Financial Information connection object f is the ID list and typ denotes the fields Options for the fields include market market time and sales tass and history history market fields are used with getdata tass fields are used with timeseries and history fields are used with the history Examples When you retrieve output from SIX Financial Information it appears as follows d XRF 1x1 struct IL 1x1
78. ies the periodicity and can be input as e Daily default os elistener Function handle that specifies the function used fo Weeklfor data on the IQFEED Lookup port ecallback Puhldidih lyandle that specifies the function that processes data event Create the variableIQFeedHistoryData to return monthly data in the MATLAB workspace in the variable I FeedHistoryData 5 65 history 5 66 See Also history q ABC floor now 100 floor now Monthly openvar IQFeedHistoryData Create the variableIQFeedHistoryData to return the last 10 days of daily data in the MATLAB workspace in the variable IQFeedHistoryData history q ABC 10 Daily openvar IQFeedHistoryData Create the variableIQFeedHistoryData to return a date range of data with the default periodicity and specifying the event listener and handler Display the results in the MATLAB workspace in the variable IQFeedHistoryData history q GOOG floor now 10 floor now iqhistoryfeedlistener iqhistoryfeedeventhandler openvar IQFeedHistoryData iqf close marketdepth realtime timeseries marketdepth Purpose Syntax Description Arguments Examples IQFEED asynchronous level 2 data marketdepth Q S marketdepth Q S elistener ecallback marketdepth Q S returns asynchronous level 2 data using the uses the default socket listener and event handler marketdepth Q S elistener ecallback returns as
79. ined socket listener and event handler Q IQFEED connection handle created using iaqf S is a single security input F F is the field list If no field list is specified or it is input as empty the default IQFEED level 1 field will be updated with each tick elistener Function handle that specifies the function used to listen for data on the IQFEED Lookup port ecallback Function handle that specifies the function that processes data event Return level 1 data for security ABC using the default socket listener and event handler and display the results in the MATLAB workspace in the variable IQFeedLevelOneData realtime q ABC openvar IQFeedLevelOneData 5 71 realtime 5 72 See Also Return level 1 data for security ABC using a field list and the defaults for socket listener and event handler and display the results in the MATLAB workspace in the variable IQ FeedLevelOneData realtime q ABC Symbol Exchange ID Last Change Incremental Volume openvar IQFeedLevelOneData Return level 1 data for security ABC using the function handles iqfeedlistener and iqfeedeventhandler Display the results in the MATLAB workspace in the variable IQ FeedLevelOneData realtime q ABC Symbol Exchange ID Last Change Incremental Volume iqfeedlistener iqfeedeventhandler openvar IQFeedLevelOneData iqf close history marketdepth timeseries timeseries
80. ing values with NaN d sec history c s f FromDate ToDate per cur returns the historical data for the security list s for the fields f for the dates FromDate to ToDate based on the given currency cur d sec history c s f FromDate ToDate per cur Name Value returns the historical data for the security list s for the fields f for the dates FromDate to ToDate based on the given currency cur Name Value pair arguments are used for additional Bloomberg request settings e Historical requests made before the market opens on the current date that include the current date as the end date may have missing or skewed data For example if the last_price and volume are requested the last_price may not be returned and the volume data for the last current date may be shifted into the last_price column e For better performance add the Bloomberg file blpapi3 jar to the MATLAB static Java class path by modifying the file MATLAB toolbox local classpath txt For more information about the static Java class path see The Static Path e Bloomberg V3 historical data supports additional name value parameters such as adjustmentNormal adjustmentAbnormal 5 33 history 5 34 Definitions Examples adjustmentSplit and adjustmentFollowDPDF To access further information on additional name value parameters see Bloomberg API Developer s Guide documentation available using the WAPI lt GO gt option from the Bloom
81. ining columns are the total return prices for each security y is the Yahoo connection handle s is a cell array of security identifiers d1 and d2 are the start and end dates for the data request and p is the periodicity flag p can be entered as e d for daily values e w for weekly values e m for monthly values e Data providers report price action and dividend data differently Verify that the data returned by the builduniverse function contains the expected results Compute a total return price series and convert to daily total returns yahoo X lt oe Load security list A B C n oe Get a daily total return price series for securities Calculated from prices splits and dividends Universe builduniverse y s 1 15 2007 floor now oe Convert to daily total returns Universe periodicreturns Universe d fetch trpdata close Purpose Syntax Arguments Description See Also Close connections to Yahoo data servers close Connect Connect Yahoo connection object created with yahoo close Connect closes the connection to the Yahoo data server yahoo 5 187 fetch Purpose Request data from Yahoo data servers Syntax data fetch Connect Security data fetch Connect Security Fields data fetch Connect Security Date data fetch Connect Security Fields Date data fetch Connect Security
82. ion x isconnection Connect returns x 1 if the connection is a valid Yahoo connection and x 0 otherwise Examples Connect to a Yahoo data server c yahoo Verify that the connection c is valid x isconnection c x 1 See Also close fetch get yahoo 5 193 trpdata Purpose Syntax Description Tips 5 194 Total return price series data prc act div trpdata y s d1 d2 p prc act div trpdata y s d1 d2 p where y is the Yahoo connection handle s is the security string d1 is the start date d2 is the end date and p is the periodicity flag for Yahoo generates a total return price series prc is the price act is the action and div is the dividend returned in the total return price series e Data providers report price action and dividend data differently Verify that the data returned by the trpdata function contains the expected results Bloomberg connection object 2 3 Bloomberg 5 4 blp Bloomberg 5 19 C category Bloomberg 5 22 close 5 130 Bloomberg 5 5 5 23 FRED 5 90 Haver Analytics 5 97 Interactive Data Pricing and Reference Data s RemotePlus 5 109 Kx Systems Inc 5 116 Reuters 5 157 Thomson Reuters Datastream 5 49 Yahoo 5 187 connection object 2 3 CUSIP number 5 9 D data servers disconnecting from 2 7 retrieving connection properties 2 5 data services connection requirements 1 4 for FactSet data server 1 5 for Reuters data se
83. k haver data haverd dat Close the connection close H haver 5 97 fetch 5 98 Purpose Syntax Arguments Description Request data from Haver Analytics database D fetch H S D fetch H S Startdate Enddate D fetch H S Startdate Enddate P H Haver Analytics connection object created withhaver S Haver Analytics variable Startdate MATLAB string or date number indicating the startdate from which to retrieve data Enddate MATLAB string or date number indicating the enddate of the date range P A specified period You can enter the period as e D for daily values e W for weekly values e M for monthly values e Q for quarterly values e A for annual values fetch returns historical data via a Haver Analytics connection object D fetch H S returns data for the Haver Analytics variable S using the connection object H D fetch H S Startdate Enddate returns data for the Haver Analytics variable S using the connection object H between the dates Startdate and Enddate fetch Examples See Also D fetch H S Startdate Enddate P returns data for the Haver Analytics variable S using the connection object H between the dates Startdate and Enddate in time periods specified by P Establish a Connection to a Haver Analytics Database Connect to the Haver Analytics daily demonstration database haverd dat H haver d work haver data haverd dat Retrieving Variable Data Return dat
84. lue of the connection s user property get Connect user ans Fast_User close fetch factset isconnection 5 81 isconnection 5 82 Purpose Syntax Arguments Description Examples See Also Verify whether connections to FactSet are valid x isconnection Connect Connect FactSet connection object created with factset x isconnection Connect returns x 1 if the connection to the FactSet is valid and x 0 otherwise Establish a connection c to FactSet data c factset Verify that c is a valid connection x isconnection c xX 1 close fetch factset get fds Purpose Syntax Description Input Arguments Create FactSet Data Server connection Connect fds UserName Password Connect fds UserName Password Finfo Connect fds UserName Password connects to the FactSet Data Server or local workstation using the field information file rt_fields xml found on the MATLAB path The file rt_fields xml can be obtained from FactSet Connect fds UserName Password Finfo connects to the FactSet Data Server or local workstation using the specified field information file Finfo UserName User login name string User login name to FDS specified as a string Data Types char Password User password string User password to FDS specified as a string Data Types char Finfo Field information string Field information specified as a stri
85. lysis data study and element definitions with additional options specified by one or more Name Value pair arguments c Bloomberg connection identifier s Specified security fromdate Starting date for the historical analysis todate Ending date for the historical analysis studychoice Study for the historical analysis per Periodicity for the historical analysis For example per daily calendar returns daily data for all calendar days reporting missing data as NaNs 5 41 tahistory per actual returns the data using the default periodicity and default calendar reporting missing data as NaNs Note that the anchor date is dependent on the todate input argument Supported values for per daily Daily weekly Weekly monthly Monthly quarterly Quarterly semi_annually Semi annually yearly Yearly actual Anchor date specification calendar Anchor date specification fiscal Anchor date specification 5 42 tahistory Name Value Pair Arguments Examples non_trading_weekdays Non trading weekdays all_calendar_days Return all calendar days active_days_only Active trading days only previous_value Fill missing values with previous values nil_value Fill missing values with NaN Specify optional comma separated pairs of Name Value arguments Name is the argument name and Value is the corresponding value Name must appear
86. mand if you require DACS authentication Connecting to Reuters Data Servers Connect to a Reuters data server with session name myNS remoteSession and service name dIDN_RDF 5 145 reuters 5 146 r reuters myNS remoteSession dIDN_RDF r session 1x1 com reuters rfa internal session SessionImpl user serviceName dIDN_RDF standardPI 1x1 com reuters rfa common StandardPrincipallidentity eventQueue Error marketDataSubscriber 1x1 com reuters rfa internal session MarketDataSubscriberImp1 marketDataSubscriberInterestSpec 1x1 com reuters rfa session MarketDataSubscriber InterestSpec client 1x1 com mathworks toolbox datafeed MatlabReutersClient mdsClientHandle 1x1 com reuters rfa internal common HandleImp1 Note If you do not use the Reuters DACS authentication functionality the following error message appears com reuters rfa internal connection ConnectionImpl initializeEntitlementsINFO com reuters rfa connection ssl myNS RemoteConnection DACS disabled for connection myNS RemoteConnection Connecting to Reuters Data Servers Using DACS Authentication 1 Connect to a Reuters data server using DACS authentication with session name myNS remoteSession service name dIDN_RDF user id ab123 and data server IP address 111 222 333 444 net reuters r reuters myNS remoteSession dIDN_RDF ab123 111 222 333 444 net BD RFA Configuration Edito
87. mmand get r 5 131 fetch Examples 5 132 To create a Thomson Reuters Tick History connection the command r rdth user company com mypassword returns r client 1x1 com thomsonreuters tickhistory webservice client RDTHApiClient user user company com password Lii To get information pertaining to a particular security the command d fetch r GOOG 0 Volume Price Exchange ID 09 05 2008 12 00 00 09 05 2008 12 01 00 TimeAndSales Trade NSQ EQU returns data starting with not all data is shown d RIC Date L Time L Type Ex Cntrb ID Price GOOG 0 05 SEP 2008 12 00 01 178 Trade NAS 443 86 Volume 200 The command d fetch r GO0G 0 Volume Last 09 05 2008 EndOfDay End Of Day NSQ EQU returns d RIC Date L Time L Type Last Volume GO00G 0 05 SEP 2008 23 59 00 000 fetch End Of Day 444 25 4538375 For x fetch r GOOG 0 for example the exchange of the security is x Exchange or NSQ To determine the asset domain of the security use the value of x Type in this case 113 Using the information from v get r j find v InstrumentTypes Value 113 returns j 46 The command v InstrumentTypes Value j returns ans 113 The command v InstrumentTypes Name j returns ans Equities The command v AssetDomains Valu
88. n gt remoteRTICwithDacs Messages like the following may appear in the MATLAB Command Window when you establish a DACs enabled connection These messages are informational and can be ignored safely Oct 5 2007 2 27 14 PM com reuters rfa internal connection ConnectionImpl1 ConnectionEstablishmentThread runImpl INFO com reuters rfa connection sass3 myNS RTICwithDacs Connection successful componentName myNS RTICwithDacs subscriberRVConnection service 9453 network 192 168 107 0 225 2 2 8 daemon tcp 192 168 107 131 9450 Oct 5 2007 2 27 14 PM com reuters rfa internal connection sass3 Sass3LoggerProxy log INFO com reuters rfa connection sass3 myNS RTICwithDacs SASS3JUNI Received advisory from RV session reuters 9453 192 168 107 0 225 2 2 8 tcp 192 168 107 131 9450 _RV INFO SYSTEM RVD CONNECTED Oct 5 2007 2 27 14 PM com reuters rfa internal connection ConnectionImpl makeServiceInfo WARNING com reuters rfa connection sass3 myNS RTICwithDacs Service list configuration has no alias defined for network serviceName IDN_RDF If messages like the following appear in the MATLAB Command Window when you establish a DACs enabled connection SEVERE com reuters rfa entitlements Default Global DACS initialization failed com reuters rfa dacs AuthorizationException Cannot start the DACS Library thread due to Cannot locate JNI library RFADacsLib Then add an entry to the MATLAB toolbox 1loc
89. n security D history E ABC close high 6 01 2009 11 10 2009 M Return all fields for the given dates for the given security using the default period of the data The fields are returned in the following order Time Open High Low Close Volume OI Flags TickBid TickAsk TickTrade D history E ABC 8 01 2009 8 10 2009 esig close getdata timeseries timeseries Purpose Syntax Description Tips Examples eSignal intraday tick data D timeseries E S F startdate enddate per D timeseries E S F startdate D timeseries E S F startdate enddate per returns the intraday data for the given inputs Inputs include the security list S the fields F the dates startdate and enddate and the periodicity per Valid fields for F are Time Open High Low Close Volume OI Flags TickBid TickAsk and TickTrade The periodicity per is optional and specifies the period of the data For example if you enter the value 1 for per the returned data will be aggregated into 1 minute bars Enter 30 for 30 minute bars and 60 for 60 minute bars D timeseries E S F startdate returns raw intraday tick data for the date range starting at startdate and ending with current day Note that the date range can only extend back for a period of 10 days from the current day For intraday tick requests made with a period argument per the following fields are valid Time Open High Low
90. ncluding the dates 02 02 2007 and 02 03 2007 x rdthloader file csv records 100000 date 02 02 2007 02 03 2007 5 143 rdthloader security ABC N XYZ 0 See Also reuters rnseloader 5 144 reuters Purpose Syntax Arguments Description Examples Create Reuters sessions r reuters sessionName serviceName reuters sessionName serviceName user position r Reuters session object created with reuters sessionName Name of the Reuters session of the form myNameSpace mySession serviceName Name of the service you use to connect to the data server user User ID you use to connect to the data server position IP address of the data server to which you connect to retrieve data You must configure your environment before you use this function to connect to a Reuters data server For more information see Reuters Data Service Requirements on page 1 5 r reuters sessionName serviceName starts a Reuters session where sessionName is of the form myNameSpace mySession and serviceName specifies the name of the service you use to connect to the data server r reuters sessionName serviceName user position starts a Reuters session where sessionName is of the form myNameSpace mySession and serviceName is the service to use user is the user ID and position is the IP address of the machine to which you connect to retrieve data Use this form of the com
91. nd printing Online only Online only Third printing Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only New for MATLAB 5 3 Release 11 Revised for Version 1 2 Revised for Version 1 3 Revised for Version 1 4 Revised for Version 1 5 Release 14 Revised for Version 1 6 Release 14 Revised for Version 1 7 Release 14SP3 Revised for Version 1 8 Release 2006a Revised for Version 1 9 Release 2006b Revised for Version 2 0 Release 2007a Revised for Version 3 0 Release 2007b Revised for Version 3 1 Release 2008a Revised for Version 3 2 Release 2008b Revised for Version 3 3 Release 2009a Revised for Version 3 4 Release 2009b Revised for Version 3 5 Release 2010a Revised for Version 4 0 Release 2010b Revised for Version 4 1 Release 2011a Revised for Version 4 2 Release 2011b Revised for Version 4 3 Release 2012a Revised for Version 4 4 Release 2012b Revised for Version 4 5 Release 2018a Getting Started 1 Product Description KK KK RR KK KK KK KK k 1 2 Key Hea tures Xeyda n E di zer hod Key ee naka A kek 1 2 About Data Servers and Data Service Providers 1 3 Supported Data Service Providers 00 eee 1 3 Data Server Connection Requirements 1 4 Communicate with Financial Data Servers 2 Communicate with Data Servers 00055 2 2
92. nect Connect Interactive Data Pricing and Reference Data s RemotePlus connection object created with idc PropertyName Optional A MATLAB string or cell array of strings containing property names Property names are e Connected e Connection e Queued value get Connect PropertyName returns the value of the specified properties for the Interactive Data Pricing and Reference Data s RemotePlus connection object PropertyName is a string or cell array of strings containing property names value get Connect returns a MATLAB structure Each field name is the name of a property of Connect and each field contains the value of that property close idc isconnection isconnection Purpose Syntax Arguments Description Examples See Also Verify whether connections to Interactive Data Pricing and Reference Data s RemotePlus data servers are valid x isconnection Connect Connect Interactive Data Pricing and Reference Data s RemotePlus connection object created with idc x isconnection Connect returns x 1 if the connection is a valid Interactive Data Pricing and Reference Data s RemotePlus connection and x 0 otherwise Establish an Interactive Data Pricing and Reference Data s RemotePlus connection c c idc Verify that c is a valid connection x isconnection c x 1 close fetch get idc 5 113 Purpose Syntax Arguments Description Examples 5
93. ng Example C Program Files x86 FactSet FactSetDataFeed fdsrt 2 etc rt_fields xml 5 83 fds Data Types char Output Connect Connection object Arguments object structure Connection object for FDS returned as an object for class FDS Examples Create FDS Connection Connect to the FDS Data Server f fds USER 123456 This creates the connection object C using the field information file rt_fields xml found on the MATLAB path You can obtain the file rt_fields xml from FactSet Create FDS Connection Using Finfo Connect to the FDS Data Server using the optional Finfo input argument f fds USER 123456 C Program Files x86 FactSet FactSetDataFeed fdsrt 2 etc rt_fields xml This creates the connection object C See Also close realtime stop 5 84 realtime Purpose Syntax Description Input Arguments Obtain real time data from FactSet Data Server T realtime F Srv Sec Cb T realtime F Srv Sec T realtime F Srv Sec Cb asynchronously requests real time or streaming data from the FactSet Data Server or local workstation T realtime F Srv Sec asynchronously requests real time or streaming data from the FactSet Data Server or local workstation When Cb is not specified the default message event handler factsetMessageEventHandler is used F FDS connection object object structure FDS connection object specified using fds Srv Data source or suppli
94. nown For Bloomberg and or click Add button to add Interactive Data Pricing and Reference Data security to Selected Securities list data servers only Security fields Datafeed Connection Data Enter S curity et Data Selection Current nan fe Default Fiflds All Fields ookup Intraday Ticks After_Hours_Change_Real_tim a au Dere i Annualized_Gain eee Ask Selected Securities Ask _Real_time Ask_Size Average_Daily_Yolume Bid History From Date Load Save Delete To Date Period Current Connections Yahoo Variable in MATLAB Data retrieved 1 Click to retrieve data workspace from the connection Setting Overrides To set overrides on retrieved data 1 Click the Override button The Override values dialog box opens 4 6 Retrieve Data with the Datafeed Dialog Box 2 Select the field to override from the Override fields selection list 3 Enter the desired override value in the Override value field 4 Click Add to add the field to override to the Override field settings list 5 Click Apply to apply overrides to the current session and keep the Override values dialog box open or click OK to apply the overrides and close the dialog box The following figure summarizes these steps 4 Datafeed Toolbox Graphical User Interface 3 Click Add to add the field 2 Enter desired override value to the Override field settings list Lists data to overrid
95. ntax Arguments Description See Also 5 54 Retrieve properties of Thomson Reuters Datastream connection objects value get Connect PropertyName value get Connect Connect Thomson Reuters Datastream connection object created with the datastream function PropertyName Optional A MATLAB string or cell array of strings containing property names Valid property names include user e datasource endpoint e wsdl sources e systeminfo e version value get Connect PropertyName returns the value of the specified properties for the Thomson Reuters Datastream connection object value get Connect returns a MATLAB structure where each field name is the name of a property of Connect Each field contains the value of the property close datastream fetch isconnection isconnection Purpose Syntax Arguments Description Examples See Also Verify whether connections to Thomson Reuters Datastream data servers are valid x isconnection Connect Connect Thomson Reuters Datastream connection object created with the datastream function x isconnection Connect returns x 1 if the connection is a valid Thomson Reuters Datastream connection and x 0 otherwise Establish a connection to the Thomson Reuters Datastream API c datastream Verify that c is a valid connection x isconnection c x 1 close datastream fetch get 5 55 esig 5 56
96. od Last 3x1 double FastFood Last ans 42 96 45 71 23 70 Retrieving a Closing Price on a Specified Date Obtain the closing price for Coca Cola on April 6 2010 c yahoo ClosePrice fetch c ko Close Apr 6 2010 ClosePrice 1 0e 005 7 3058 0 0005 See Also close get isconnection yahoo 5 191 get Purpose Syntax Arguments Description Examples See Also 5 192 Retrieve properties of Yahoo connection objects value get Connect PropertyName value get Connect Connect Yahoo connection object created with yahoo PropertyName Optional A MATLAB string or cell array of strings containing property names Currently the only property name recognized is url value get Connect PropertyName returns the value of the specified properties for the Yahoo connection object value get Connect returns a MATLAB structure where each field name is the name of a property of Connect Each field contains the value of the property Connect to a Yahoo data server e Il yahoo url http download finance yahoo com ip port Retrieve the URL of the connection get c url ans http download finance yahoo com close fetch isconnection yahoo isconnection Purpose Verify whether connections to Yahoo data servers are valid Syntax x isconnection Connect Arguments Connect Yahoo connection object created with yahoo Descript
97. of a particular security run d history Connect Security Field FromDate ToDate history returns data for the date range from FromDate to ToDate For example to obtain the closing price for IBM for the dates July 15 2009 to August 2 2009 using the connection c enter c blp data history c IBM US Equity Last _Price 07 15 2009 08 02 2009 3 Example Retrieve Bloomberg Data Datafeed Toolbox Graphical User Interface e Introduction on page 4 2 e Retrieve Data with the Datafeed Dialog Box on page 4 3 e Obtain Ticker Symbol with the Datafeed Securities Lookup Dialog Box on page 4 9 4 Datafeed Toolbox Graphical User Interface Introduction You can use the Datafeed Toolbox Graphical User Interface GUI to connect to and retrieve information from some supported data service providers This GUI consists of two dialog boxes e The Datafeed dialog box e The Securities Lookup dialog box Retrieve Data with the Datafeed Dialog Box Retrieve Data with the Datafeed Dialog Box The Datafeed dialog box establishes the connection with the data server and manages data retrieval Use this dialog box to connect to and retrieve data from the following service providers e Bloomberg e Interactive Data Pricing and Reference Data s RemotePlus e Yahoo To display this dialog box enter the dftool command in the MATLAB Command Window The Datafeed dialog box consists of t
98. omberg Desktop API is supported eSignal http www esignal com FactSet Research Systems Inc http www factset com Federal Reserve Economic Data FRED http research stlouisfed org fred2 Haver Analytics http www haver com Interactive Data http www interactivedata prd com IQFEED http www iqfeed net Kx Systems Inc http www kx com SIX Financial Information http www six financial information com Thomson Reuters http www thomsonreuters com Yahoo http finance yahoo com See the MathWorks Web site for the system requirements for connecting to these data servers 1 Getting Started 1 4 Data Server Connection Requirements To connect to some of these data servers additional requirements apply Additional Software Requirements The following data service providers require you to install proprietary software on your PC e Bloomberg Note You must have a Bloomberg software license for the host on which the Datafeed Toolbox and MATLAB software are running e Interactive Data Pricing and Reference Data s RemotePlus e Haver Analytics e Kx Systems Inc Reuters e IQFEED You must have a valid license for required client software on your machine If you do not the following error message appears when you try to connect to a data server Invalid MEX file For more information about how to obtain required software contact your data
99. ompany com mypassword returns r client 1x1 com thomsonreuters tickhistory webservice client RDTHApiClient user user company com password Ikkx k k kxkk xk kk kxk To get a listing of properties for the rdth connection the command v get r returns V AssetDomains 1x1 struct BondTypes 255x1 cell Class class com thomsonreuters tickhistory webservice client RDTHApiClient Countries 142x1 cell CreditRatings 82x1 cell Currencies 1x1 struct Exchanges 1x1 struct FuturesDeliveryMonths 12x1 cell InflightStatus 1x1 com thomsonreuters tickhistory webservice types InflightStatus InstrumentTypes 1x1 struct MessageTypes 1x1 struct OptionExpiryMonths 12x1 cell Quota 1x1 com thomsonreuters tickhistory webservice types Quota RestrictedPEs 2758x1 cell Version 1x1 com thomsonreuters get tickhistory webservice types Version See Also rdth fetch 5 137 isconnection Purpose Syntax Description Examples See Also 5 138 Verify whether Thomson Reuters Tick History connections are valid gt Il isconnection r x isconnection r returns 1 if r is a valid rdth client and 0 otherwise Verify that r is a valid connection r rdth user company com mypassword x isconnection r X 1 rdth close fetch get status Purpose Syntax Description Examples Status of FTP request for Thomson Reuters Tick History data
100. on ssl myNS RemoteConnection DACS disabled for connection myNS RemoteConnection DACs enabled Make an RTIC TIC RMDS Edition DACS enabled connection to a Reuters data server with session name myNS remoteRTICWithDACs service name IDN_RDF user id ab123 and data server IP address 111 222 333 444 net r reuters myNS remoteRTICWithDACs IDN_RDF ab123 111 222 333 444 net reuters BD RFA Configuration Editor Dj xj File Edit View Setting Help Ee Key EE p connectionType SASS3 dacs_CbeEnabled true dacs __SbePubEnabled false lacs s SbeSubEnabled false E downloadDataDict true sericeList _JROF SubscriberRV Connection RVconnection remoteRTICwithDacs po is uaua U ln ar linfo RTICwithDacs exported to i weutersconfig xml E X This RTIC connection depends on the key subscriber RVConnection Your RVConnection configuration should look as follows 5 153 reuters 5 154 BD RFA Configuration Editor File Edit View Setting Help gt System Usery com reuters 9 ma _System 9 mys Connections Key connectionType dacs_SbePubEnabled dacs_SbeSubEnabled daemon network service Value RV false false tcp 111 222 333 131 9450 111 222 333 0 225 2 2 8 9453 RTICconnection oe i lt tc RemoteConnection i F Sessions remoteRTICSession remoteSessio
101. onnection object r x submitftp r sec tradefields daterange reqtype messtype exchange domain submits an FTP request for the request security sec based on the type request and message types reqtype and messtype respectively Data for the fields specified by tradefields is returned for the data range bounded by daterange Specifying the exchange or the given security improves the speed of the data request domain specifies the security type x submitftp r sec tradefields daterange reqtype messtype exchange domain marketdepth additionally specifies the depth of level 2 data marketdepth to return for a MarketDepth request type marketdepth must be a numeric value between 1 and 10 returning up to 10 bid ask values for a given security To monitor the status of the FTP request enter the command s qp status r x The status function returns a status message and queue position When S Complete download the resulting compressed csv file from the TRTH servers Once the csv file has been saved to disk use rdthloader filename to load the data into the MATLAB workspace To obtain more information request and message types and their associated field lists use the command get r submitftp Examples See Also Specify parameters for FTP request submitftp r IBM N GOOG 0 Open Last Low High floor now 100 floor now EndOfDay End Of Day NSQ EQU For a NasdaqLevel
102. ough Exempt Flag TRF Price Sub Market ID TRE Irregular Price Sub Market ID To request the Exchange ID Price and Volume of a security s intra day tick for a given day and time range the command x fetch r ABCD 0O Exchange ID Price Volume 09 05 2008 12 00 06 09 05 2008 12 00 10 TimeAndSales Trade NSQ EQU returns data similar to xX ABCD O 05 SEP 2008 12 00 08 535 Trade NAS 85 25 100 ABCD O 05 SEP 2008 12 00 08 569 Trade NAS 85 25 400 To request the Exchange ID Price and Volume of a security s intraday tick data for an entire trading day the command x fetch r ABCD O Exchange ID Price Volume 09 05 2008 TimeAndSales Trade NSQ EQU returns data similar to xX rdth See Also ABCD 0 05 SEP 2008 08 00 41 142 Trade NAS 51 100 ABCD O 05 SEP 2008 08 01 03 024 Trade NAS 49 35 100 ABCD O 05 SEP 2008 19 37 47 934 Trade NAS 47 5 1200 ABCD O 05 SEP 2008 19 37 47 934 Trade NAS 47 5 300 ABCD O 05 SEP 2008 19 59 33 970 Trade NAS 47 173 To clean up any remaining requests associated with the rdth connection use close r close fetch get 5 129 close Purpose Close Thomson Reuters Tick History connection Syntax close r Description close r closes the Thomson Reuters Tick History
103. p c s market returns the list of matching securities given the security search string s and market m The lookup function uses the Bloomberg ActiveX interface The command D LOOKUP c Intl Bus Mac Equity returns the securities along with their ticker symbols matching the search string Intl Bus Mac for the Equity market Valid market types are e Comdty Commodities Corp Corporate bonds Equity Equities Govt Government bonds e Index Indexes e M Mkt Money Market securities Mtge Mortgage backed securities e Muni Municipal bonds Pfd Preferred stocks fetch bip Purpose Syntax Description Bloomberg V3 communications server connection c blp blp P IP etimeout fo Il c blp makes a connection to the local Bloomberg V3 communications server You must have a Bloomberg software license for the host on which the Datafeed Toolbox and MATLAB software are running c blp P IP etimeout makes a connection to the local Bloomberg communications server P is the port number and IP is the IP address of the local machine etimeout is the time out value in milliseconds specifying how long the connection is attempted before timing out if the connection cannot be made 5 19 bip 5 20 Examples Note With the Bloomberg V8 release there is a Java archive file from Bloomberg that you need to install for b1p and other Bloomberg commands to work correctly If
104. r aji Key connectionType SSL dacs_CbeEnabied false dacs_GenerateLocks false dacs_SbePubEnabled false dacs_SbeSubEnabled false downloadDataDict e portNumber 8101 _ serverList 111 222 333 134 userName mw335 5 147 reuters FI RFA Configuration Editor 1 5 xl File Edit View Setting Help gt System F Key Value Usery connectionList RemoteConnection com reuters ma Connections RTICconnection RVconnection RemoteConnection Sessions TickByTickSession remoteSession 2 Add the following to your connection configuration dacs_CheEnabled false dacs SbePubEnabled false dacs SbeSubEnabled false 3 If you are running an SSL connection add the following to your connection configuration dacs _GenerateLocks false Connecting to Reuters Data Servers Without DACS Authentication Connect to a Reuters data server with session name myNS remoteSession and service name dIDN_RDF without using DACS r reuters myNS remoteSession dIDN_RDF 5 148 reuters Establishing an RTIC TIC RMDS Edition Connection to Reuters Data Servers e Non DACs enabled Make an RTIC TIC RMDS Edition connection to a Reuters data server without DACS authentication with session name myNS remoteRTICSession service name IDN_RDF r reuters myNS remoteRTICSession IDN_RDF E RFA Confquration dtor TE File Edi
105. rameters and returns the data from this command Run the following command from a DOS prompt to specify the port number 5001 q tradedata q p 5001 Connect to a Kx Systems Inc server using IP address LOCALHOST and port number 5001 k kx localhost 5001 Retrieve data using the command select from trade d fetch k select from trade d 5 119 fetch See Also 5 120 sec 5000x1 cell price 5000x1 double volume 5000x1 int32 exchange 5000x1 double date 5000x1 double Retrieve data passing an input parameter ACME to the command select from trade d d fetch k totalvolume ACME volume 1253x1 int32 This is the total trading volume for the security ACME in the table trade The function totalvolume is defined in the sample Kx Systems Inc kdb file tradedata q exec insert kx get Purpose Syntax Arguments Description Examples See Also Retrieve Kx Systems Inc kdb connection object properties lt l get k PropertyName get k lt Il k Kx Systems Inc kdb connection object created with kx PropertyName A string or cell array of strings containing property names The property names are e handle e ipaddress e port v get k PropertyName returns a MATLAB structure containing the value of the specified properties for the Kx Systems Inc kdb connection object v get k returns a MATLAB structure where eac
106. ription Examples Retrieve information about Haver Analytics variables D info H S H Haver Analytics connection object created with haver S Haver Analytics variable D info H S returns information about the Haver Analytics variable S Establish a Haver Analytics connection H H haver d work haver data haverd dat Request information for the variable after FFED D info H FFED2 The following output is returned VarName FFED2 StartDate 01 Jan 1991 EndDate 31 Dec 1998 NumberObs 2088 Frequency D DateTimeMod 02 Apr 2007 20 46 37 Magnitude 0 DecPrecision 2 DifType 1 AggType AVG DataType Group ZO05 Source FRB Descriptor Federal Funds Effective Rate p a 5 101 info ShortSource History LongSource Historical Series See Also close get isconnection haver nextinfo 5 102 isconnection Purpose Syntax Arguments Description Examples See Also Verify whether connections to Haver Analytics data servers are valid X isconnection H H Haver Analytics connection object created with haver X isconnection H returns X 1 if the connection is a valid Haver Analytics connection and X 0 otherwise Establish a Haver Analytics connection H H HAVER d work haver data haverd dat Verify that H is a valid Haver Analytics connection X isconnection H X 1 close fetch get haver 5 103 nextinfo
107. rns the eSignal basic quote data for the security S E is a connection object created by esig Return the eSignal basic quote data for the security ABC D getdata E ABC esig close history timeseries getfundamentaldata Purpose Syntax Description Examples See Also Current eSignal fundamenal data D getfundamentaldata E S D getfundamentaldata E S returns the eSignal fundamental data for the security S Return the eSignal fundamental data for the security ABC D getfundamentaldata E ABC esig close getdata history timeseries 5 59 history 5 60 Purpose Syntax Description Examples See Also eSignal historical data D history E S F startdate enddate per D history E S F startdate enddate per returns the historical data for the given inputs Input arguments include the security list S the fields F the dates startdate and enddate and the periodicity per Valid fields are Time Open High Low Close Volume OI Flags TickBid TickAsk and TickTrade The input argument per is optional and specifies the period of the data Possible values for per are D daily the default W weekly and M monthly Return the closing price for the given dates for the given security using the default period of the data D history E ABC CLOSE 8 01 2009 8 10 2009 Return the monthly closing and high prices for the given dates for the give
108. rride fields 0 with corresponding override values ov d sec getdata c s f o0 ov name value returns the data for the fields f for the security list s using the override fields o with corresponding override values ov name value pairs are used for additional Bloomberg request settings getdata Tips Examples See Also e Bloomberg V3 data supports additional name value parameters To access further information on these additional name value parameters see Bloomberg API Developer s Guide documentation available using the WAPI lt GO gt option from the Bloomberg terminal Return today s current and open price of the given security D SEC getdata c ABC US Equity LAST_PRICE OPEN Return the requested fields given override fields and values D SEC getdata c O30096AF8 Corp YLD_YTM_ASK ASK OAS_SPREAD_ASK OAS_VOL_ASK OAS_VOL_ASK 14 000000 Return a request for IBM using its CUSIP number D getdata b cusip 459200101 LAST_PRICE blp history realtime timeseries 5 31 history 5 32 Purpose Syntax Description Bloomberg V3 historical data d sec history c s f FromDate ToDate d sec history c s f FromDate ToDate per d sec history c s f FromDate ToDate per cur d sec history c s f FromDate ToDate per cur Name Value d sec history c s f FromDate ToDate returns the historical da
109. rver 1 5 for Thomson Reuters Datastream data server 1 8 proxy information 1 4 software 1 4 data service providers 1 3 Datafeed Dialog Box starting 4 3 5 2 datastream 5 48 dftool 4 3 5 2 disconnecting from data servers 2 7 display Bloomberg 5 24 eqs Bloomberg 5 25 eSignal 5 56 to 5 61 exec Kx Systems Inc 5 117 F FactSet 5 75 5 77 5 80 5 82 FactSet close 5 76 Federal Reserve Economic Data FRED 5 89 fetch 5 131 Bloomberg 5 6 FRED 5 91 Haver Analytics 5 98 Interactive Data Pricing and Reference Data s RemotePlus 5 110 Kx Systems Inc 5 119 Reuters 5 160 Thomson Reuters Datastream 5 50 Yahoo 5 188 fieldinfo Bloomberg 5 27 fieldsearch Bloomberg 5 28 fred 5 89 ftstool 5 2 functions Bloomberg bloomberg 5 4 close 5 5 fetch 5 6 Index 1 Index Index 2 get 5 14 isconnection 5 16 isfield 5 17 lookup 5 18 close 5 57 5 64 5 76 esig 5 56 factset 5 75 FactSet close 5 88 fds 5 83 realtime 5 85 stop 5 87 fetch 5 77 FRED close 5 90 fetch 5 91 fred 5 89 get 5 93 isconnection 5 94 get 5 80 getdata 5 58 getfundamentaldata 5 59 Haver Analytics aggregation 5 96 close 5 97 fetch 5 98 get 5 100 haver 5 95 havertool 5 106 info 5 101 isconnection 5 103 nextinfo 5 104 history 5 60 5 65 Interactive Data Pricing and Reference Data s RemotePlus close 5 109 fetch 5 110 get 5 112 ide 5 108 isconnection 5 113 iqf 5 63 isconnection 5 82 Kx
110. struct I 1x1 struct M 1x1 struct P 1x1 struct The instrument IDs are found in d I and the pricing data is found in d P The output for d P k appears like this ans 33 2 1 33 3 1 9441 47 33 2 1 33 3 1 3 1 1 Convert the field IDs in d P k to their field names with tkidtofield d P k tkidtofield c d P k market 5 183 tkidtofield Load the file tlkrs tkfields mat for a listing of the field names and their corresponding field IDs See Also tlkrs getdata history timeseries tkfieldtoid 5 184 yahoo Purpose Syntax Description Examples See Also Connect to Yahoo data servers Connect yahoo Connect yahoo verifies that the URL http download finance yahoo com is accessible and creates a connection handle Connect to the Yahoo data server Connect Connect url http download finance yahoo com yahoo builduniverse close fetch get isconnection trpdata 5 185 builduniverse Purpose Syntax Description Tips Examples See Also 5 186 Portfolio matrix with total return price data from Yahoo X builduniverse y s d1 d2 p X builduniverse y s d1 d2 p builds a portfolio matrix using Yahoo data to compute a total return price series X is an m by n 1 matrix where m refers to the number of records of data and n refers to the number of securities Column 1 of the matrix contains MATLAB date numbers and the rema
111. t Activity Last RQ005 LAST_PRICE Last Trade Last Price Double Market Activity Last PR186 NY_LAST_DATE 1x34 char Datetime category fieldinfo getdata history realtime timeseries get Purpose Syntax Description See Also Get Bloomberg V3 connection properties v get c PropertyName v get c v get c PropertyName returns the value of the specified properties for the Bloomberg V3 connection object PropertyName is a string or cell array of strings containing property names The property names are session ipaddress and port v get c returns a structure where each field name is the name of a property of c and each field contains the value of that property getdata history realtime timeseries blp 5 29 getdata 5 30 Purpose Syntax Description Current Bloomberg V3 data d sec getdata c s f d sec getdata c s f 0 0ov d sec getdata c s f 0 ov name value d sec getdata c s f returns the data for the fields f for the security list s sec is the security list that maps the order of the return data The return data d and sec is sorted to match the input order of s You can return securities with any of the following IDs e cats buid cins common e cusip e isin e sedolt e sedol2 sicovam e svm e ticker default wpk d sec getdata c s f o0 ov returns the data for the fields f for the security list s using the ove
112. t View Setting Help gt System B Key Value a Usery connectionType SASS3 com dacs_CbeEnabied false reuters dacs_SbePubEnabled false t ta dacs_SbeSubEnabled false _System l my NS downloadDataDict true Connections serviceList ROF subscriberRV_Connection RVconnection RICwinhDacs RVconnection RemoteConnection F Sessions TickByTickSession remoteRTICSession remoteRTiCwithDacs remoteSession HE HT This RTIC connection depends on the key subscriber RVConnection Your RVConnection configuration should look as follows 5 149 reuters at Key pi connectionType dacs_SbePubEnabled RV 1 false dacs_SbeSubEnabled daemon network sonico false htep 111 222 333 131 9450 111 222 333 0 225 2 28 a453 remoteRTICSession remoteSession remoteRTICwithDacs The RTICConnection configuration is referenced by the session remoteRTICSession as shown in the following figure 5 150 reuters BD RFA Configuration Editor 4 Key RTICconnection k tonnectionList 5 151 reuters 5 152 Messages like the following may appear in the MATLAB Command Window when you establish a non DACs enabled connection These messages are informational and can safely be ignored Oct 5 2007 2 28 31 PM com reuters rfa internal connection ConnectionImpl initializeEntitlements INFO com reuters rfa connecti
113. ta for the security list s and the connection object c for the fields f for the dates FromDate to ToDate Date strings can be input in any format recognized by MATLAB sec is the security list that maps the order of the return data The return data d and sec is sorted to match the input order of s d sec history c s f FromDate ToDate per returns the historical data for the field f for the dates FromDate to ToDate per specifies the period of the data For example per daily calendar returns daily data for all calendar days reporting missing data as NaNs per actual returns the data using the default periodicity and default calendar reporting missing data as NaNs The default periodicity depends on the security If a security is reported on a monthly basis the default periodicity is monthly The default calendar is actual trading days The possible values of per are as follows Value Time Period daily Daily weekly Weekly monthly Monthly quarterly Quarterly semi_annually Semi annually yearly Yearly history Tips Value Time Period actual Anchor date specification calendar Anchor date specification fiscal Anchor date specification non_trading weekdays Non trading weekdays all_calendar_days Return all calendar days active_days_only Active trading days only Fill missing values with previous values previous value nil_value Fill miss
114. tax Arguments Description Examples See Also Retrieve properties of FRED connection objects value get Connect PropertyName value get Connect Connect FRED connection object created with fred PropertyName A MATLAB string or cell array of strings containing property names Property names are e url e ip e port value get Connect PropertyName returns a MATLAB structure containing the value of the specified properties for the FRED connection object value get Connect returns the value for all properties Establish a connection c to a FRED data server c fred http research stlouisfed org fred2 Retrieve the port and IP address for the connection p get c port ip p port 8194 ip 111 222 33 444 close fetch isconnection 5 93 isconnection 5 94 Purpose Syntax Arguments Description Examples See Also Verify whether connections to FRED data servers are valid x isconnection Connect Connect FRED connection object created with fred x isconnection Connect returns x 1 if a connection to the FRED data server is valid and x 0 otherwise Establish a connection c toa FRED data server c fred http research stlouisfed org fred2 Verify that c is a valid connection x isconnection c x 1 close fetch get haver Purpose Syntax Arguments Description Examples See Also Connect to local Hav
115. tax close k Arguments k Kx Systems Inc kdb connection object created with kx Description close k closes the connection to the Kx Systems Inc kdb database Examples Close the connection k to the Kx Systems Inc kdb database close k See Also kx 5 116 exec Purpose Syntax Arguments Description Run Kx Systems Inc kdb commands exec exec exec exec exec exec k command k command p1 p2 p3 k command p1 k command p1 p2 k command p1 p2 p3 k command p1 p2 p3 sync OAR OR k Kx Systems Inc kdb connection object created with kx command Kx Systems Inc kdb command issued using the Kx Systems Inc kdb connection object created with the kx function p1 p2 p3 Input parameters for Command exec k command executes the specified command in Kx Systems Inc kdb without waiting for a response exec k command p1 p2 p3 executes the specified command with one or more input parameters without waiting for a response exec k command p1 executes the given command with one input parameter without waiting for a response exec k command p1 p2 executes the given command with two input parameters without waiting for a response exec k command p1 p2 p3 executes the given command with three input parameters without waiting for a response exec k command p1 p2 p3 sync executes the given command with three input parameters synchronously and waits for a response from the database Enter unus
116. that runs for each data event that occurs d fetch r s returns the current data for the security s given the Reuters session object r d fetch r s callback uses the Reuters session object r to subscribe to the security s MATLAB runs the callback function for each data event that occurs d fetch r s f requests the given fields f for the security s given the Reuters session object r Retrieving Current Securities Data Retrieve the current data for the security GOOG 0 using the Reuters session object r d fetch r GO0OG 0 Following is a partial listing of the returned security data d PROD_PERM 74 00 fetch RDNDISPLAY 66 00 DSPLY_NAME DELAYED 15GOOGLE RDN_EXCHID 0 TRDPRC_1 474 28 TRDPRC_2 474 26 TRDPRC_3 474 25 TRDPRC_4 474 25 TRDPRC_5 474 25 NETCHNG 1 4 73 HIGH_1 481 35 LOW_1 472 78 PRCTCK_1 1 CURRENCY 840 TRADE_DATE 30 APR 2007 Subscribing to a Security To subscribe to a security and process the data in real time specify a callback function MATLAB runs this function each time it receives a real time data event from Reuters In this example the callback function rtdemo returns the subscription handle associated with this request to the base MATLAB workspace A The openvar function is then called to display A in the Variables editor A partial list of the data included in A appears in the figure d fetch r GOOG 0 rtdemo openvar A 5 161 f
117. today s trade time series aggregated into five minute intervals enter data fetch Connect Security TIMESERIES now 5 Trade data fetch Connect Security HISTORY Fields FromDate ToDate Period Currency Ident returns historical data for the specified field for the date range FromDate to ToDate You can set the time period with the optional Period argument to return a more specific data set You can further specify returned data by appending the Currency or Ident argument Note If a call to the fetch function with the HISTORY argument encounters an invalid security in a list of securities to retrieve it returns no data for any securities in the list ticker fetch Connect SearchString LOOKUP Market uses SearchString to find the ticker symbol for a security trading in a designated market The output ticker is a column vector of possible ticker values Note If you supply Ident without a period or currency enter for the missing values data fetch Connect Security REALTIME Fields MATLABProg subscribes to a given security or list of securities requesting the indicated fields and runs any specified MATLAB fetch Arguments Connect Security Flag Currency Ident Fields function See pricevol showtrades or stockticker for information on the data returned by asynchronous Bloomberg events
118. uity Screen Data Using sname Argument Using connection object b and using sname Core Capital Ratios return equity screening data d eqs b Core Capital Ratios Return Equity Screen Data Using sname and Group Arguments Using connection object b sname and Group return equity screening data d eqs b Core Capital Ratios Matlab Drivers 5 25 eqs See Also blp getdata tahistory 5 26 fieldinfo Purpose Bloomberg V3 field information Syntax d fieldinfo c f Description d fieldinfo c f returns field information on Bloomberg V3 connection object c given a field mnemonic f The data returned is a M by 5 cell array containing the field help field ID field mnemonic field name and field data type See Also category fieldsearch getdata history realtime timeseries 5 27 fieldsearch 5 28 Purpose Syntax Description Examples See Also Bloomberg V3 field search Qa I fieldsearch c f d fieldsearch c f returns field information on Bloomberg V3 connection object c given a search string f The data returned is an N by 5 cell array containing categories field IDs field mnemonics field names and field data types Return Data for Search String LAST_PRICE Using connection object b return data for search string LAST_PRICE fieldsearch b LAST_PRICE d d 1 3 ans Market Activity Last PROOS PX_LAST Last Price Double Marke
119. urns all available daily data for the date range 01 03 2009 to 02 24 2009 Note that only two years worth of daily data five years worth of weekly data and 10 years of monthly data from today s date is made available by Reuters d history r WXYZ 0 close volume 01 03 2009 02 24 2009 returns all available daily data for the date range 01 03 2009 to 02 24 2009 for the fields date close and volume d history r WXYZ O t close volume 01 03 2009 02 24 2009 w 5 165 history returns all available weekly data for the date range 01 03 2009 to 02 24 2009 for the fields date close and volume See Also reuters fetch 5 166 stop Purpose Syntax Arguments Description Examples See Also Unsubscribe securities stop r stop r d r Reuters session object created with reuters d Subscription handle returned by fetch stop r unsubscribes all securities associated with the Reuters session object r stop r d unsubscribes the securities associated with the subscription handle d where d is the subscription handle returned by reuters fetch Unsubscribe securities associated with a specific request d and a Reuters connection object r stop r d Unsubscribe all securities associated with the Reuters connection object r stop r reuters fetch 5 167 rm dsconfig 5 168 Purpose Syntax Description See Also Reuters Market Data System configuration
120. us data servers close Connect Connect Interactive Data Pricing and Reference Data s RemotePlus connection object created with idc close Connect closes the connection to the Interactive Data Pricing and Reference Data s RemotePlus server Establish an Interactive Data Pricing and Reference Data s RemotePlus connection C c idc Close this connection close c idc 5 109 fetch Purpose Request data from Interactive Data Pricing and Reference Data s RemotePlus data servers Syntax data fetch Connect Security Fields data fetch Connect Security Fields FromDate ToDate data fetch Connect Security Fields FromDate ToDate Period data fetch Connect GUILookup GUICategory Arguments Connect Interactive Data Pricing and Reference Data s RemotePlus connection object created with idc Security A MATLAB string containing the name of a security in a format recognizable by the Interactive Data Pricing and Reference Data s RemotePlus server Fields A MATLAB string or cell array of strings indicating specific fields for which to provide data Valid field names are in the file idc idcfields mat The variable bbfieldnames contains the list of field names FromDate Beginning date for historical data Note You can specify dates in any of the formats supported by datestr and datenum that show a year month and day ToDate End date
121. wo tabs e The Connection tab establishes communication with a data server For more information see Connecting to Data Servers on page 4 4 The Data tab specifies the data request For more information see Retrieving Data on page 4 5 e You can also set overrides for the data you retrieve For more information see Setting Overrides on page 4 6 The following figure summarizes how to connect to data servers and retrieve data using the Datafeed dialog box 4 3 4 Datafeed Toolbox Graphical User Interface 4 After the connection is made click the Data tab to begin data retrieval 3 Click to establish a connection to the data server Datafeed rj x Connection Data Data Source Connection History Yahoo X F 11 14 55 51 Connect to Yahoo conn yahoo Port Number sing default port IP Address Using default IP Address Current Connections gt l Disconnect Se ee 5 Click to close the highlighted connection 2 Enter IP address of data server or use the default values Bloomberg data servers only 1 Enter port number on data server Bloomberg data servers only The Datafeed Dialog Box Connecting to Data Servers 1 Click the Connect button to establish a connection 4 4 Retrieve Data with the Datafeed Dialog Box 2 When the Connected message appears in the Status field click the Data tab to begin the process of retrieving data from the dat
122. ws a In your Bloomberg terminal type WAPI GO to display the Desktop Server API screen b Select SDK Download Center and then click Desktop v3 x API c Once you have blpapi3 jar on your system add it to the MATLAB Java classpath using javaaddpath This is must be done for every session of MATLAB To avoid repeating this at every session you can add javaaddpath to your startup m file or you can add the full path for blpapi3 jar to your classpath txt file 2 Enter the following command c blp You are now connected to the Bloomberg Data Server Your output appears as follows cC session 1x1 com bloomberglp blpapi Session 2 Communicate with Financial Data Servers ipaddress localhost port 8194 00 2 4 Connection Object Properties Connection Object Properties In this section Retrieve Connection Properties on page 2 5 Retrieve Data on a Security on page 2 6 The syntax for the Bloomberg V3 connection object constructor is c blp Retrieve Connection Properties To retrieve the properties of a connection object use the get function This function returns different values depending upon which data server you are using get c session 1x1 com bloomberglp blpapi Session ipaddress localhost port 8194 00 You can get the values of the individual properties by using the property names get c port session ans port 8194 00 session 1x1
123. ynchronous level 2 data using an explicitly defined socket listener and event handler Q IQFEED connection handle created using iqf S S is a single security input elistener Function handle that specifies the function used to listen for data on the level 2 port ecallback Function handle that specifies the function that processes data event Return level 2 data using the default socket listener and event handler and display the results in the MATLAB workspace in the variable TaFeedLevelTwoData marketdepth q ABC openvar IQFeedLevelTwoData Initiate a watch on the security ABC for level 2 data using the function handles iqfeedlistener and iqfeedeventhandler Display the results in the MATLAB workspace in the variable IQFeedLevelTwoData marketdepth q ABC iqfeedmarketdepthlistener iqfeedmarketdeptheventhandler openvar IQFeedLevelTwoData 5 67 marketdepth See Also igf close history realtime timeseries 5 68 news Purpose Syntax Description Arguments Examples IQFEED asynchronous news data news Q S news Q S elistener ecallback news Q S returns asynchronous news data using the default socket listener and event handler news Q S elistener ecallback returns asynchronous news data using an explicitly defined socket listener and event handler The syntax news Q true turns on news updates for the list of currently subscribed level 1 securities and news Q false
Download Pdf Manuals
Related Search
Related Contents
Hilfe als PDF-Datei - SerialLetterAndFax Safety Function: Safety Mat Stop User Manual irCUE Pioneer User Manual do manual - Mercedes-Benz Cub Cadet Ex32002 Parts list Promate Safari S6161-MX-FSE-010 - Equipment Catalog Copyright © All rights reserved.
Failed to retrieve file