Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

Account Info for Standalone JForex API
 Post subject: Account Info for Standalone JForex API Post rating: 0   New post Posted: Mon 12 Aug, 2013, 14:14 
User avatar

User rating: 1
Joined: Tue 01 May, 2012, 22:05
Posts: 17
Location: United Kingdom, London
Hello,

I would like to get my account balance using the standalone API, something like client.getAccountBalance() or client.getAccount() would be nice.
I can't find a way to get a IAccount object except for the IContext interface and this you only can get when running a strategy.

I really appreciate any help you can provide.


 
 Post subject: Re: Account Info for Standalone JForex API Post rating: 2   New post Posted: Mon 12 Aug, 2013, 23:36 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
I am aware only of
public void onStart(final IContext context) throws JFException {
    double accountStartBalance = context.getAccount().getBalance();
}
, just as you indicated.
And it is only 'valid' from a strategy indeed.

But, where else do you want to use it if not in a strategy?


 
 Post subject: Re: Account Info for Standalone JForex API Post rating: 0   New post Posted: Tue 13 Aug, 2013, 01:15 
User avatar

User rating: 1
Joined: Tue 01 May, 2012, 22:05
Posts: 17
Location: United Kingdom, London
I would like to have a graphical representation of my equity and account balance using the JForex SDK, the same as the bottom status bar when using JForex.


 
 Post subject: Re: Account Info for Standalone JForex API Post rating: 1   New post Posted: Tue 13 Aug, 2013, 08:39 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

I suggest to contact API Support here. (I am not sure if they monitor this topic...).


 
 Post subject: Re: Account Info for Standalone JForex API Post rating: 0   New post Posted: Tue 13 Aug, 2013, 12:00 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
So what is the problem with running a strategy, which provides you the account information? If you need only to fetch the IAccount interface consider an approach similar to this:
viewtopic.php?f=65&t=48713


 

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