timeseries(c,s,startdate,enddate)
requests CQG® raw intraday tick data asynchronously between
startdate and enddate for
CQG instrument name s with CQG connection c.
timeseries(c,s,startdate,enddate,[],x)
requests CQG raw intraday tick data asynchronously without timed bar data using
additional request properties x.
To request intraday tick data for an instrument, create the
connection c using cqg and
startUp. Register an event handler for tracking events
associated with connection status. Set up the API configuration properties.
Then, register an event handler for tracking events associated with building and
initializing the output data structure. For an example demonstrating these
activities, see Request CQG Intraday Tick Data. See
CQG API Reference Guide to learn more about event
handlers and the API configuration properties.
Request intraday tick data for instrument XYZ.XYZ for
the last 2 days. XYZ.XYZ is a sample instrument name. To
request intraday tick data for your instrument, substitute the symbol name
in instrument.
cqgTickData returns intraday tick data for the
specified instrument.
Display the data in the Timestamp property of
cqgTickData.
cqgTickData.Timestamp
ans =
'4/17/2013 2:14:00 PM'
'4/18/2013 2:14:00 PM'
Close the CQG connection.
close(c)
Request CQG Intraday Tick Data with Additional Properties
To request intraday tick data for an instrument with an
additional property, create the connection c using
cqg and startUp. Register an event
handler for tracking events associated with connection status. Set up the API
configuration properties. Then, register an event handler for tracking events
associated with building and initializing the output data structure. For an
example demonstrating these activities, see Request CQG Intraday Tick Data. See
CQG API Reference Guide to learn more about event
handlers and the API configuration properties.
Pass an additional optional request property by creating the structure
x, and setting the optional property. To see only bid
tick data, for example, set TickFilter to
'tfBid'.
x.TickFilter = 'tfBid';
TickFilter and SessionsFilter are
the only valid additional optional properties for calling
timeseries without a timed bar request. For
additional property values you can set, see CQG API Reference Guide.
Request intraday tick data for instrument XYZ.XYZ for
the last 2 days using the additional optional request property
x. XYZ.XYZ is a sample instrument
name. To request intraday tick data for your instrument, substitute the
symbol name in instrument.
cqgTickData returns intraday tick data for the
specified instrument.
Display the data in the Timestamp property of
cqgTickData.
cqgTickData.Timestamp
ans =
'4/17/2013 2:14:00 PM'
'4/18/2013 2:14:00 PM'
Close the CQG connection.
close(c)
Request CQG Timed Bar Data
To request timed bar data for an instrument, create the
connection c using cqg and
startUp. Register an event handler for tracking events
associated with connection status. Set up the API configuration properties.
Then, register an event handler for tracking events associated with building and
initializing the output data structure. For an example demonstrating these
activities, see Request CQG Intraday Tick Data. See
CQG API Reference Guide to learn more about event
handlers and the API configuration properties.
Request timed bar data for instrument XYZ.XYZ for the
last fraction of a day. XYZ.XYZ is a sample instrument
name. To request timed bar data for your instrument, substitute the symbol
name in instrument.
cqgTimedBarData returns timed bar data for the
specified instrument. The columns of cqgTimedBarData
display data corresponding to the timestamp, open price, high price, low
price, close price, mid-price, HLC3, average price, and tick volume.
Close the CQG connection.
close(c)
Request CQG Timed Bar Data with Additional Properties
To request timed bar data for an instrument with an
additional property, create the connection c using
cqg and startUp. Register an event
handler for tracking events associated with connection status. Set up the API
configuration properties. Then, register an event handler for tracking events
associated with building and initializing the output data structure. For an
example demonstrating these activities, see Request CQG Intraday Tick Data. See
CQG API Reference Guide to learn more about event
handlers and the API configuration properties.
Pass an additional optional request property by creating the structure
x, and setting the optional property.
x.UpdatesEnabled = false;
For additional optional properties you can set, see CQG API Reference Guide.
Request timed bar data for instrument XYZ.XYZ for the
last fraction of a day using the additional optional request property
x. XYZ.XYZ is a sample instrument
name. To request timed bar data for your instrument, substitute the symbol
name in instrument.
cqgTimedBarData returns timed bar data for the
specified instrument. The columns of cqgTimedBarData
display data corresponding to the timestamp, open price, high price, low
price, close price, mid-price, HLC3, average price, and tick volume.
CQG connection, specified as a CQG connection object
created using cqg.
s — CQG instrument name character vector | string scalar
CQG instrument name, specified as a character vector or string scalar that
identifies the instrument or security. For a list of CQG instrument names, see Tradable
Symbols.
Data Types: char | string
startdate — Start date character vector | string scalar | numeric scalar
Start date, specified as a character vector, string scalar, or numeric scalar.
Data Types: double | char | string
enddate — End date character vector | string scalar | numeric scalar
End date, specified as a character vector, string scalar, or numeric scalar.
Data Types: double | char | string
intraday — Aggregated bar value numeric scalar | []
Aggregated bar value, specified as a numeric scalar from 1.0 to 1440.0. If
you want to call timeseries to return intraday tick data
with additional properties without timed bar data, then enter
[] for this argument.
Data Types: double
x — CQG request properties request properties structure
CQG request properties, specified as a CQG request
properties structure. Create this structure by writing MATLAB code
to set additional optional request properties. For additional optional
properties you can set, see CQG API Reference Guide.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.