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?
API Support
Post subject: Re: How calc Order real profit or loss
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.
API Support
Post subject: Re: How calc Order real profit or loss
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.
API Support
Post subject: Re: How calc Order real profit or loss
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.