createRefreshTableRequestByAccount on Summary?

Moderator: Moderator

createRefreshTableRequestByAccount on Summary?

Postby jasond17 » Wed May 06, 2015 3:21 pm

I am trying the following code to refresh the Summary table for a specific account.

O2GRequest request = _session.getRequestFactory().createRefreshTableRequestByAccount(O2GTableType.Summary, _tradeAccount);

The request object comes back as null from this call. There is no error message from getLastError() it is empty. The Summary table gotten from the table manager indicates its status as Initial when I check it.

O2GTableManager tMgr = _session.getTableManagerByAccount(_tradeAccount);

An identical request to refresh the trades table for the account works perfectly.

O2GRequest request = _session.getRequestFactory().createRefreshTableRequestByAccount(O2GTableType.Trades, _tradeAccount);
jasond17
 
Posts: 9
Joined: Wed Aug 14, 2013 2:35 pm

Re: createRefreshTableRequestByAccount on Summary?

Postby Georgiy » Thu May 07, 2015 8:44 am

Hello jasond17,

The table Summary does not get the data from the server. ForexConnect calculates this table itself, according to the Trades table. Therefore, there is no way to refresh the Summary table. If you want to refresh data in the Summary table, refresh the Trade table instead.

Thank you.
Georgiy
FXCodeBase: Initiate
 
Posts: 150
Joined: Tue Jul 29, 2014 4:49 am

Re: createRefreshTableRequestByAccount on Summary?

Postby jasond17 » Thu May 07, 2015 9:07 am

OK. Thanks, I understand. I am refreshing the trades table already, but I see invalid data in the Summary table after refreshing the trades table.

Using this code:

O2GTableManager tMgr = _session.getTableManagerByAccount(_tradeAccount);
var sumTable = (O2GSummaryTable)tMgr.getTable(O2GTableType.Summary);

If I then access the Summary table for the account it does NOT have the correct data.
jasond17
 
Posts: 9
Joined: Wed Aug 14, 2013 2:35 pm

Re: createRefreshTableRequestByAccount on Summary?

Postby jasond17 » Thu May 07, 2015 9:46 am

Sorry, that was my mistake. I see the correct data now. If I wait for the Summary table to show status Refreshed, after refreshing the Trades table. After waiting for this check the tables are correct.

if (sumTable.getStatus() == O2GTableStatus.Refreshed)
jasond17
 
Posts: 9
Joined: Wed Aug 14, 2013 2:35 pm

Re: createRefreshTableRequestByAccount on Summary?

Postby jasond17 » Thu May 07, 2015 1:15 pm

OK, I can now get the per-account Summary data, however, there seems to be a side-effect on the Accounts table. Before accessing the per-account Summary data the Accounts table correctly shows Balance, DayPL, Equity, GrossPL and UseableMargin.

After I refresh the Trades table and read the per-account Summary data the Accounts table values are incorrect.
jasond17
 
Posts: 9
Joined: Wed Aug 14, 2013 2:35 pm

Re: createRefreshTableRequestByAccount on Summary?

Postby Georgiy » Fri May 08, 2015 9:11 am

Hello jasond17,

Unfortunately, we cannot reproduce your issue. Could you please provide us with the source code or part of the code (code should display the refresh and getting of the account Summary data)?
You can do it via email.

gchumakov@gehtsoft.com
Thank you.
Georgiy
FXCodeBase: Initiate
 
Posts: 150
Joined: Tue Jul 29, 2014 4:49 am

Re: createRefreshTableRequestByAccount on Summary?

Postby jasond17 » Tue May 12, 2015 8:01 pm

I was wondering if you received my code sample?
Thanks.
jasond17
 
Posts: 9
Joined: Wed Aug 14, 2013 2:35 pm

Re: createRefreshTableRequestByAccount on Summary?

Postby Georgiy » Wed May 13, 2015 5:31 am

Hello Jason,

Thank you for reporting. I have answered you via email.
The issue will be fixed as soon as possible.
Georgiy
FXCodeBase: Initiate
 
Posts: 150
Joined: Tue Jul 29, 2014 4:49 am

Re: createRefreshTableRequestByAccount on Summary?

Postby Georgiy » Tue Jun 02, 2015 2:54 am

Georgiy
FXCodeBase: Initiate
 
Posts: 150
Joined: Tue Jul 29, 2014 4:49 am

Accounts table stops updating after order execution

Postby Shahar » Thu Oct 01, 2015 12:19 pm

I have written a Java [Win64] application that connects to several different brokers (to duplicate my trades to different accounts). My problem with the ForexConnect API is that every time an order is executed (even if the order was sent by the TradingStation, rather than from my program) I stop getting account balance updates.

This happens both on DEMO and on REAL accounts.

I have tried many things, e.g.
Unlocking table manager updates
instantiating a new table manager, table listener, and accounts Table (and of course subscribing to updates).

Note: the tableManager status shows TABLES_LOADED and the O2GAccountsTable status appears REFRESHED. I don't get any error and can continue sending orders.

I have downloaded and installed the latest API [1.3.3], so I believe that is what I am using.

Any help would be appreciated. Thank you!
Shahar
 
Posts: 8
Joined: Thu Oct 01, 2015 11:12 am

Next

Return to ForexConnect API

Who is online

Users browsing this forum: No registered users and 6 guests