Enablements Required:
CQG API Streaming
- Create a new project.
- Add COM reference to CQG 4.0 Type Library - Revised.
- Create the CQGCEL object.
- Configure the CQGCEL object using CQGCEL.APIConfiguration.
If your application is always available to receive CQGCEL events; set CQGAPIConfig.ReadyStatusCheck to rscOff.
The ReadyStatusCheck is commonly used if the application has compute-intensive work and will not respond promptly or if it is used from MS Excel. In these cases, set CQGAPIConfig.ReadyStatusCheck to rscOn and handle the CQGCEL.IsReady event. - Start the CQGCEL by calling the CQGCEL.Startup method.
- Wait for the CQGCEL.CELStarted event. If CQGIC is not started, a CQGCEL.DataError event will be fired, notifying about that.
- Handle the CQGCEL.DataConnectionStatusChanged event.
- If the CQGCEL.Environment.DataConnectionStatus is csConnectionUp, subscribe to the instrument you want to place orders on using the CQGCEL.NewInstrument method.
- When the instrument subscription succeeds, the CQGCEL.InstrumentSubscribed event is fired and a corresponding CQGInstrument object is created in the CQGInstruments collection.
- Whenever an update to the instrument is received, a CQGCEL.InstrumentChanged event will be fired with two collections of the updated quotes and instrument properties respectively.