Main Content

cqg

Create CQG connection object

Description

The cqg function creates a cqg object, which represents a CQG® connection. After you create a cqg object, you can use the object functions to create orders and retrieve historical, real-time, and intraday tick data.

Creation

Syntax

Description

c = cqg creates a CQG connection object c.

example

Properties

expand all

CQG handle, specified as an ActiveX object.

Example: [1x1 COM.CQG_CQGCEL_4]

API configuration type library specification, specified as a configuration object.

Example: [1x1 Interface.CQG_4.0_Type_Library_-_Revised_API.ICQGAPIConfig]

Object Functions

expand all

startUpCreate CQG connection
shutDownClose CQG connection
closeClose CQG connection
createOrderCreate CQG order
historyRequest CQG historical data
realtimeSubscribe to CQG instrument
timeseriesRequest CQG intraday tick data

Examples

collapse all

Create a CQG connection object.

c = cqg
c = 

  cqg with properties:

       Handle: [1x1 COM.CQG_CQGCEL_4]
    APIConfig: [1x1 Interface.CQG_4.0_Type_Library_-_Revised_API.ICQGAPIConfig]

CQG connection object properties reflect the CQG ActiveX object Handle and the API configuration type library specification APIConfig.

Display the Handle property of c.

c.Handle
ans =
 
    COM.CQG_CQGCEL_4

After creating the cqg connection object, you can retrieve historical, real-time, and intraday tick data. For details, see history, realtime, and timeseries, respectively.

Close the CQG connection.

close(c)

Version History

Introduced in R2013b