Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

getBaseEquity method
 Post subject: getBaseEquity method Post rating: 0   New post Posted: Mon 23 Dec, 2013, 17:01 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
According to API docs the getBaseEquity method of the IAccount interface must return the same value as the getEquity method if there are no open positions.
In my case after the merging of opposite equal positions (result position is zero and closed) and awaiting for more then 5 seconds the getBaseEquity method returns unpredictable value.

How does exactly the getBaseEquity method work?


 
 Post subject: Re: getBaseEquity method Post rating: 0   New post Posted: Tue 07 Jan, 2014, 15:21 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The value gets corrected with any following account update.


 
 Post subject: Re: getBaseEquity method Post rating: 0   New post Posted: Tue 07 Jan, 2014, 16:49 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
API Support wrote:
The value gets corrected with any following account update.
What exactly events cause account update?


 
 Post subject: Re: getBaseEquity method Post rating: 0   New post Posted: Tue 07 Jan, 2014, 16:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Any equity change.


 
 Post subject: Re: getBaseEquity method Post rating: 1   New post Posted: Tue 07 Jan, 2014, 18:16 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
API Support wrote:
Any equity change.
That is the case! The value returned by getEquity method gets updated while value returned by getBaseEquity method does not get updated at the same time.


 
 Post subject: API server account equity vs DEMO platform Post rating: 0   New post Posted: Thu 23 Jan, 2014, 16:40 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Hi Guys !

EDIT: Oops !! My mistake. The server used account.getBalance() instead
of account.getEquity() which I should have used. Sorry.....

<this post is incorrect>

I'm running an API Client on a linux server, which operates about 8 concurrent Strategies.
I notice that the Demo platform equity doesn't seem to agree with what
the API server sees.

You can see the server thinks the account equity is $49,822.50, but
the platform says about $49,749.90 in the same demo account. This is
when all positions are flat in the same account.

The API server gets the value in the Strategy's onAccount, using
account.getEquity() and the currency symbol is USD.

The Demo JForex platform is running in the U.S. on my local computer, and the server
is an Amazon EC2 instance in the EU (Ireland) Amazon region. I double
checked that they are logged into the same demo account.

I must be misinterpreting something. Why would there be a difference?
I believe both are calculated in USD currency.

HyperScalper

Image


Attachments:
EquityDisagreementServerVSPlatform.PNG [270.4 KiB]
Downloaded 567 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: API server account equity vs DEMO platform Post rating: 0   New post Posted: Thu 23 Jan, 2014, 17:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
hyperscalper wrote:
This is
when all positions are flat in the same account.
This has already been registered.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com