This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Create CQG connection object


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.



c = cqg



c = cqg creates a CQG connection object c.


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


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.

ans =

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.


Introduced in R2013b