CQG API Documentation 4.0 - Revised
How to Get Trading Account Details (MVO, NLV, etc.)
Send Feedback

Glossary Item Box

Enablements Required:
CQG API Streaming, CQG API Trading

  1. Create a new project.
  2. Add COM reference to CQG 4.0 Type Library - Revised.
  3. Create the CQGCEL object.
  4. 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.

  5. Start the CQGCEL by calling the CQGCEL.Startup method.
  6. Wait for the CQGCEL.CELStarted event. If CQGIC is not started, a CQGCEL.DataError event will be fired, notifying about that.
  7. Handle the CQGCEL.GWConnectionStatusChanged event. GW Connection status will be changed upon logging in/out of the Gateway account from within CQGIC.
  8. After the CQGCEL.GWConnectionStatusChanged event returns csConnectionUp, set the AccountSubscriptionLevel to aslAccountsAndUpdates.
  9. When the GW Account subscription level change succeeds, the CQGCEL.AccountChanged event is fired where the change parameter is actAccountsReloaded, and corresponding CQGAccount objects are created in the CQGAccounts collection.
  10. In order to have the account's OTE/MVO information calculated in real-time, set the CQGAccount.AutoSubscribeInstruments to True.
    1. To receive updates on positions for a particular account, set CQGAccount.PositionSubcriptionLevel property for that account to pslSnapshotAndUpdates.
    2. To receive updates on positions for all accounts; before calling the CQGCEL.Startup method, set APIConfiguration.DefPositionSubscriptionLevel to pslSnapshotAndUpdates.
    3. You can receive the account’sOTE/MVO values through the CQGAccountSummary interface.
    4. You can also receive a position’s OTE/MVO values through the CQGPosition interface.
    5. When the data connection is down, OTE/MVO will not be updated. Handle the CQGCEL.DataConnectionStatusChanged event to notify the user about that.
  11. When the position subscription level change succeeds, the CQGCEL.AccountChanged event is fired where the change parameter is actPositionsReloaded,and corresponding CQGPosition objects are created in the CQGAccount.CQGPositions collection.
  12. Handle the CQGCEL.AccountChanged event to monitor the account and position properties.