Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2795 history.getOrdersHistory
 Post subject: JFOREX-2795 history.getOrdersHistory Post rating: 0   New post Posted: Mon 28 Feb, 2011, 13:13 

User rating: 0
Joined: Tue 23 Nov, 2010, 10:03
Posts: 4
I want to get the total profit of closed orders. the code is below:


for (IOrder order: history.getOrdersHistory(instrument, HistoryCheckStart,tick.getTime())) {
label=order.getLabel();
if(label.startsWith("magic111")) res=res+order.getProfitLossInAccountCurrency();
}

In the last week, these code works well, but in this week, it got wrong results. Is there something wrong with my code or Is this another new bug?
:cry: :cry: :cry: :cry:


 
 Post subject: wrong getProfitLossInAccountCurrency() value Post rating: 0   New post Posted: Wed 02 Mar, 2011, 15:03 

User rating: 0
Joined: Tue 07 Sep, 2010, 14:02
Posts: 2
The profit/loss calculation in order history seems to be wrong. order.getProfitLossInAccountCurrency() always returns values close to zero.

for (IOrder order : context.getHistory().getOrdersHistory(instrument, startTime, endTime)) {
   res += order.getProfitLossInAccountCurrency();
}


I just found out, that this Bug is a duplicate to JFOREX-2795. But a software update didn´t fix the problem.


 

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