Click or drag to resize

Adapter initialization CQG

The code below demonstrates how to initialize the CqgComMessageAdapter and CqgContinuumMessageAdapter and and send it to Connector.

1. CQG COM, connection by local CQG Integrated Client:

C#
Connector Connector = new Connector();                
...                
var messageAdapter = new CqgComMessageAdapter(Connector.TransactionIdGenerator)
{
    UserName = "<Your Login>",
    Password = "<Your Password>".To<SecureString>(),
};

Connector.Adapter.InnerAdapters.Add(messageAdapter);
...

2. CQG Continuum, connecting directly to the server:

C#
Connector Connector = new Connector();                
...                
var messageAdapter = new CqgContinuumMessageAdapter(Connector.TransactionIdGenerator)
{
    UserName = "<Your Login>",
    Password = "<Your Password>".To<SecureString>(),
    Address = "<Address>".To<IPAddress>(),
};

Connector.Adapter.InnerAdapters.Add(messageAdapter);
...
See Also