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.

How calc Order real profit or loss
 Post subject: How calc Order real profit or loss Post rating: 0   New post Posted: Tue 04 Dec, 2012, 16:18 

User rating: 0
Joined: Tue 28 Aug, 2012, 14:52
Posts: 16
I use api order.getProfitLossInAccountCurrency() and order.getCommissionInUSD() to calculate the real profit.
But the calculated value is not equal the account profit that i compare the account Equity between order opened and closed.
Now i want to find the way to calc the real profit after order close, but how to do?


 
 Post subject: Re: How calc Order real profit or loss Post rating: 0   New post Posted: Tue 04 Dec, 2012, 16:32 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See the second to last post in the following topic:
viewtopic.php?f=65&t=48455


 
 Post subject: Re: How calc Order real profit or loss Post rating: 0   New post Posted: Wed 05 Dec, 2012, 17:24 

User rating: 0
Joined: Tue 28 Aug, 2012, 14:52
Posts: 16
I have read the topic,but i think it can't resolve my problem.
The important point is that i need calc the real profit when close order.

The algorithm I calc profit :
profit = order.getProfitLossInUSD() - order.getCommissionInUSD()

We find out the result is not equal the real profit == account.getEquity()(before open order) - account.getEquity()(after close order 5s)
Please support a way resolve, thanks.


 
 Post subject: Re: How calc Order real profit or loss Post rating: 0   New post Posted: Thu 06 Dec, 2012, 08:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Did you take notice of the part about overnights and that the order commission gets applied also on order close?


 
 Post subject: Re: How calc Order real profit or loss Post rating: 0   New post Posted: Thu 06 Dec, 2012, 14:12 

User rating: 0
Joined: Tue 28 Aug, 2012, 14:52
Posts: 16
I known we can use order.getCommissionInUSD to get the open Commission.
Truely I don't care of overnight Commission, I just want to get the close order Commission.


 
 Post subject: Re: How calc Order real profit or loss Post rating: 0   New post Posted: Thu 06 Dec, 2012, 14:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
tea123 wrote:
I known we can use order.getCommissionInUSD to get the open Commission.
Truely I don't care of overnight Commission, I just want to get the close order Commission.
The method is the same also for the close commission.


 

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