Main Content

cqg

CreateCQGconnection object

Description

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

Creation

Syntax

Description

example

c= cqgcreates a CQG connection objectc.

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

startUp CreateCQGconnection
shutDown CloseCQGconnection
close CloseCQGconnection
createOrder CreateCQGorder
history RequestCQGhistorical data
realtime Subscribe toCQGinstrument
timeseries RequestCQGintraday 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 objectHandleand the API configuration type library specificationAPIConfig.

Display theHandleproperty ofc.

c.Handle
ans = COM.CQG_CQGCEL_4

After creating thecqgconnection object, you can retrieve historical, real-time, and intraday tick data. For details, seehistory,realtime, andtimeseries, respectively.

Close the CQG connection.

close(c)
Introduced in R2013b