CQG API 4.0 - Revised
AccountChanged Event
See Also  Send Feedback
change_type
Account change type which allows to differentiate the occurred changes
cqg_account

A CQGAccount object representing the account to which the current change refers.

If the change type is actAccountsReloaded this parameter will be either Nothing or a not valid instance of CQGAccount. See Invalid Object for details.

cqg_position

CQGPosition object representing the position to which the current change refers.

If the change type is actAccountsReloaded, actAccountChanged or actPositionsReloaded this parameter will be either Nothing or a not valid instance of CQGPosition. See Invalid Object for details.

CQGCEL Interface : AccountChanged Event

Glossary Item Box

Description

This event is fired when the account or position information is changed.

Syntax

Visual Basic
Public Event AccountChanged( _
   ByVal change_type As eAccountChangeType, _
   ByVal cqg_account As CQGAccount, _
   ByVal cqg_position As CQGPosition _
)

Parameters

change_type
ValueDescription
actAccountChanged

An account-specific change occurred, e.g. date of last statement is changed.

After an event of this type, another AccountChange event of actPositionsReloaded type will be fired.

An event of this type is also fired for each account if the account subscription level is set from aslAccountsOnly to aslAccountsAndUpdates.

actAccountsReloaded

All accounts are reloaded.

This change type is passed in two cases:

  • when the user logs on to CQG Gateway from CQGIC
  • when the user programmatically switches initial account subscription level to aslNone and then back.
actPositionAddedA new position is created.

For example, due to trading new instruments.

actPositionChangedA position-specific change occurred, e.g. position quantity or price is changed.

The number of fired events of this type depends on the FireEventOnChangedPrices configuration setting.

See the FireEventsOnChangedPrices configuration setting for possible options of controlling the flow of position changed events.

actPositionsReloaded
  • All positions of an account are reloaded.

    There are many cases when this change type is passed. For example:

    • when we change position subscription level from pslNoPositions to any other value
    • when an account-specific change occurs for the current account
    • when CQG Gateway environment change occurs, etc.
actTradersReloaded

Authorized traders of accounts are reloaded.

Account change type which allows to differentiate the occurred changes
cqg_account

A CQGAccount object representing the account to which the current change refers.

If the change type is actAccountsReloaded this parameter will be either Nothing or a not valid instance of CQGAccount. See Invalid Object for details.

cqg_position

CQGPosition object representing the position to which the current change refers.

If the change type is actAccountsReloaded, actAccountChanged or actPositionsReloaded this parameter will be either Nothing or a not valid instance of CQGPosition. See Invalid Object for details.

Remarks

If account subscription level is set to aslNone no AccountChanged event will be fired.

For account-specific changes:

If account subscription level is set to aslAccountsOnly only one AccountChanged event will be fired, and that upon the subscription level change.

If account subscription level is set to aslAccountsAndUpdates, an AccountChanged event will be fired on each change.

AccountChanged event firing for position-specific changes is controlled on account level and can be configured for each account separately.

 

Note: if a currency rate is changed obviously it will lead to re-calculations of account summaries. However in this situation only CurrencyRatesChanged event will be fired. The corresponding account changes will be available upon access to account summaries.

Example

The examples below show how to track accounts and positions changes via CQG API.

VB
C#
 
 

See Also