API Support Forum
OEC API > API Support > Not Receiving Account Balance and Position Updates
Author Topic: Not Receiving Account Balance and Position Updates
(5 messages, Page 1 of 1)
Moderators: VPfau
CKane3211
Posts: 6
Joined: May 26, 2017


Posted: Apr 09, 2020 @ 02:31 PM             Msg. 1 of 5
Good afternoon,

I was curious if there are any known issues with account balance and position updates. My application is not receiving either. It had been previously.

For reference, I am registering event handlers with this:

client.Accounts.AccountSummaryChanged += Accounts_AccountSummaryChanged;
client.Accounts.BalanceChanged += Accounts_BalanceChanged;
client.Accounts.AvgPositionChanged += Accounts_AvgPositionChanged;
client.Accounts.DetailedPositionChanged += Accounts_AvgPositionChanged;

I know these are being called because they are between the registration of my tick and DOM event handlers and my order change event handlers (both of which are working normally).

The event handler methods are only being called when a position is entered or exited, and not at intervals in between.

EDIT: I also realized that client.Subscriptions.Price.PriceChanged and client.Subscriptions.Price.PriceTick event handlers are also not being called.

Any insight you can provide would be greatly appreciated.

Thanks,
Chris
Edited by CKane3211 on Apr 12, 2020 08:47 PM
Edited by CKane3211 on Apr 12, 2020 08:47 PM
JSmith5611
Posts: 187
Joined:


Posted: Apr 13, 2020 @ 10:07 AM             Msg. 2 of 5
Here are what should be triggering these events:

AccountSummaryChanged:
- When a currency rate changes and an account has a balance in that currency
- When contract margins change
- When Client.Margins.SetUseHypoPL(bool useHypoPL) is called (with a different value than currently set)
- When Client.Options.PLMode is changed
- When a price for a contract a position exists for updates
- when a fill occurs
- when a new position is entered

BalanceChanged:
- When commissions charged
- SettleP&L recalculated
- Position rolled
- Fill occurs (P&L)

AvgPositionChanged:
- When a currency rate changes and an account has a balance in that currency
- When contract margins change
- When Client.Margins.SetUseHypoPL(bool useHypoPL) is called (with a different value than currently set)
- When Client.Options.PLMode is changed
- when a fill occurs
- when a new position is entered

DetailedPositionChanged:
- When a currency rate changes and an account has a balance in that currency
- When Client.Margins.SetUseHypoPL(bool useHypoPL) is called (with a different value than currently set)
- When Client.Options.PLMode is changed
- when a fill occurs

If these events are not being triggered there may be a problem with your application.

are you calling Client.Threading.Advance() manually, or using GF.Api.Threading.GFClientRunner()?
Jason Smith
CKane3211
Posts: 6
Joined: May 26, 2017


Posted: Apr 13, 2020 @ 11:36 AM             Msg. 3 of 5
Jason,

Thanks for the response. I am using GFClientRunner.
JSmith5611
Posts: 187
Joined:


Posted: Apr 13, 2020 @ 01:04 PM             Msg. 4 of 5
Looking through change logs, the only thing that has changed with these events recently is the
"When a price for a contract a position exists for updates' update for AccountSummaryChanged was being triggered multiple times for the same account for one update.

Does this (and the previous comment) explain the behavior, or do you need further assistance?
Jason Smith
CKane3211
Posts: 6
Joined: May 26, 2017


Posted: Apr 13, 2020 @ 01:34 PM             Msg. 5 of 5
Jason,

I just tried building against the latest version of the library (4.0.3.28). That solved the problem. No other changes were made on my end. It would appear that there is a bug in version 4.0.3.16 (the version I had been running against).

Thanks for the help,
Chris