private void SessionOnAccountChanged(eAccountChangeType changeType, CQGAccount cqgAccount, CQGPosition cqgPosition) { }
/// <summary> /// This event is fired when the account or position information is changed. /// </summary> /// <param name="change">Account change type which allows to differentiate the occurred changes.</param> /// <param name="account">A CQGAccount object representing the account /// to which the current change refers.</param> /// <param name="position">A CQGPosition object representing the position /// to which the current change refers.</param> private void cel_AccountChanged(eAccountChangeType change, CQGAccount account, CQGPosition position) { try { switch (change) { case eAccountChangeType.actAccountChanged: // no action break; case eAccountChangeType.actAccountsReloaded: FillAccountsMap(); try { driverLog.Info("cel_AccountChanged:Will requiery orders"); foreach (CQGAccount acc in m_CQGHostForm.CQGApp.Accounts) { CQGOrdersQuery oq = m_CQGHostForm.CQGApp.QueryOrders(acc); } } catch { } break; case eAccountChangeType.actPositionChanged: case eAccountChangeType.actPositionAdded: if (position != null) { handlePosition(position); } break; case eAccountChangeType.actPositionsReloaded: if (account != null) { foreach (CQGPosition posn in account.Positions) { handlePosition(posn); } } break; default: driverLog.Error("cel_AccountChanged: Change type not processed:" + change.ToString()); break; } } catch (Exception ex) { log.Error("cel_AccountChanged", ex); } }