Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

in the historical Tester getCommission() = 0.0
 Post subject: in the historical Tester getCommission() = 0.0 Post rating: 0   New post Posted: Thu 16 Jul, 2015, 09:30 

User rating: 0
Joined: Mon 31 Mar, 2014, 16:50
Posts: 21
Location: Italy, San Severino Marche MC
Which alternative there is to have the amount of commissions and swap to a closed position in the historical tester?

The instruction ord.getCommission () gives the value 0.0

        List<IOrder> ordersAll = history.getOrdersHistory(_instrument, timeLoadOrder(), ora());
        for (IOrder ord:ordersAll)
        {
            String label = ord.getLabel();
            if (!label.substring(0, _label.length()).equals(_label))
            {
                continue;
            }
            else
            {
                if (cmd(ord) < 2)
                {
                    if (ord.getState() == IOrder.State.CLOSED)
                    {
                        totale += ord.getProfitLossInAccountCurrency() - ord.getCommission();
print ("Load Order closed: " + ord.getLabel() + " profit: " + df2.format(ord.getProfitLossInAccountCurrency()) + " commission: " + df2.format(ord.getCommission()));
                    }
                }
            }
        }


result:

EUR/USD : Load Order closed: EURUSD1437034789915_L1 profit: 0,55 commission: 0

JForex Live 2.45.12
Api 2.12.21


Thanks.


 
 Post subject: Re: in the historical Tester getCommission() = 0.0 Post rating: 0   New post Posted: Wed 12 Aug, 2015, 14:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is fixed and will be available in the next JClient release.


 

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