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.

What's the difference between “history.getEquity()” and “account.getEquity()”
 Post subject: What's the difference between “history.getEquity()” and “account.getEquity()” Post rating: 0   New post Posted: Fri 19 Apr, 2013, 05:16 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
Numerical their output, just a different code, I want to know, they still have what distinction?

public void onAccount(IAccount account) throws JFException {
        MyLastEquity1 = history.getEquity();
        MyLastEquity2 = account.getEquity();
        console.getOut().println("1 is"+MyLastEquity1);
        console.getOut().println("2 is"+MyLastEquity2);
    }


 
 Post subject: Re: What's the difference between “history.getEquity()” and “account.getEquity()” Post rating: 0   New post Posted: Fri 19 Apr, 2013, 07:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IHistory.html#getEquity()
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IAccount.html#getEquity()


 
 Post subject: Re: What's the difference between “history.getEquity()” and “account.getEquity()” Post rating: 0   New post Posted: Fri 19 Apr, 2013, 07:33 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:




I see..
but why it is updated about every 10 seconds,isn't 5 seconds.
this is my code .

public void onAccount(IAccount account) throws JFException {
        MyLastEquity2 = account.getEquity();
       
    }

public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        console.getOut().println("2是"+MyLastEquity2);
    }


Image


Attachments:
QQ截图20130419143107.jpg [80.07 KiB]
Downloaded 506 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.
 
The Best Answer  Post subject: Re: What's the difference between “history.getEquity()” and “account.getEquity()” Post rating: 0   New post Posted: Fri 19 Apr, 2013, 07:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See onBar description in:
https://www.dukascopy.com/wiki/#Strategy_API


 
 Post subject: Re: What's the difference between “history.getEquity()” and “account.getEquity()” Post rating: 0   New post Posted: Fri 19 Apr, 2013, 08:06 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:



OK,I get it ! I know what I need!

onTick :Here one would implement a strategy logic which is related to price change.

onbar :Here one would implement a strategy logic which is related to time period.


 

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