Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2661 Account Equity problem
 Post subject: JFOREX-2661 Account Equity problem Post rating: 0   New post Posted: Thu 20 Jan, 2011, 08:14 

User rating: 0
Joined: Thu 19 Aug, 2010, 13:53
Posts: 62
I repost this here:

I use this simple formula to calculate lots for a order:

Code:
double aK = (iAccount.getEquity() * 25)/100000;
aRetLot = aK/10;
return aRetLot;


When I start strategy and initial equity is 100 000, first order is opened with 2.5k lots, which is correct.
When the order is closed, let's say in profit with 12k, the JForex shows correct equity in bottom bar: 112 000
If the strategy opens a new order using again the above formula the lot returned should be: 2.8k
but it returns again 2.5k. this says to me the iAccount.getEquity() still return 100 000 although meantime
12k were earned and the real equity is 112 000.
I understand there is a a delay until the onAccount() method is called to update info. But how long is this time ?
I did some extensive tests and even after 15 minutes the IAccount.getEquity() still returns 100 000 as initial balance when strategy started although meantime it changed by closed orders in profit/loss.
If current equity reach let's say 95k and I restart the strategy it gets correct initial equity 95k and use this for calculatin as above. While the strategy remains open it keeps getting iAccount.getEquity() = 95k although it changes.
Is this a problem ? Should I consider other things to get current real time equity ?


 

Jump to:  

cron
  © 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