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.

Rounding Order Amount for XAU/USD and XAG/USD
 Post subject: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Mon 31 Mar, 2014, 10:55 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Wiki states that order amount gets round while submitting: Order Amounts.

But for XAU/USD and XAG/USD instruments the order amount gets truncated:

Image


Attachments:
amounts.PNG [19.91 KiB]
Downloaded 834 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Tue 01 Apr, 2014, 16:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Are the amounts ok from within the strategy?


 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Tue 01 Apr, 2014, 19:33 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
API Support wrote:
Are the amounts ok from within the strategy?
What do you mean?


 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Sat 05 Apr, 2014, 23:14 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Hi, Support Team!

Do you confirm this bug?


 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Sun 06 Apr, 2014, 15:36 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
hebasto wrote:
API Support wrote:
Are the amounts ok from within the strategy?
What do you mean?
What he or she is asking is for you to pull these values out of the Strategy Order objects in order to confirm as claimed (while only observing the Event log) that the underlying values in question have indeed been truncated. As it stands now, if there is an issue, it is not clear whether this is with the Order APIs/Server or whether it is the presentation code displaying the event log that is responsible for the discrepancies raised.


 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Sun 06 Apr, 2014, 16:52 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
CriticalSection wrote:
What he or she is asking is for you to pull these values out of the Strategy Order objects in order to confirm as claimed (while only observing the Event log) that the underlying values in question have indeed been truncated. As it stands now, if there is an issue, it is not clear whether this is with the Order APIs/Server or whether it is the presentation code displaying the event log that is responsible for the discrepancies raised.
Wiki - Order Amounts:
Dukascopy wrote:
Order amount minimum increment is one unit.
So, amounts have indeed been truncated, not rounded.


 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Mon 07 Apr, 2014, 10:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The issue has been registered


 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 1   New post Posted: Sat 17 May, 2014, 22:22 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Additional info: submitOrder method does not round amount for any instrument (not only for metals).
To replicate this issue run the attached strategy in Historical Tester and look into the end of the generated report.

package jforex;

import com.dukascopy.api.*;
import java.util.EnumSet;

public class TestAmountRounding implements IStrategy {

    public void onStart(IContext context) throws JFException {
        if (context.getEngine().getType() == IEngine.Type.TEST) {
            context.setSubscribedInstruments(EnumSet.of(Instrument.EURUSD, Instrument.XAGUSD), true);
            context.getEngine().submitOrder("order1", Instrument.EURUSD, IEngine.OrderCommand.BUY, 0.00123456789);
            context.getEngine().submitOrder("order2", Instrument.XAGUSD, IEngine.OrderCommand.BUY, 0.000056789);
        }
        context.stop();
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {}
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
    public void onMessage(IMessage message) throws JFException {}
    public void onAccount(IAccount account) throws JFException {}
    public void onStop() throws JFException {}
}


Attachments:
File comment: Run this strategy in Historical Tester
TestAmountRounding.java [997 Bytes]
Downloaded 337 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Rounding Order Amount for XAU/USD and XAG/USD Post rating: 0   New post Posted: Thu 07 Aug, 2014, 15:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Fixed with the JForex-API 2.9.12.


 

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