Dukascopy
 
 
Wiki JStore Search Login

Order Amount in Java jForex
 Post subject: Order Amount in Java jForex Post rating: 0   New post Posted: Fri 30 Oct, 2020, 14:30 
User avatar

User rating: 0
Joined: Fri 17 Jan, 2014, 18:13
Posts: 72
Location: NetherlandsNetherlands
I'm confused, maybe someone can help me out.

instrument.getMinTradeAmount() – gives the start amount for an instrument
instrument.getTradeAmountIncrement() – gives the increment

For EURUSD that is 1000 and 1.
For XAUUSD that is 1 and 1
For XAGUSD that is 50 and 1.
For DEU.IDX that is 0.1 and 0.1

In Java however I have to give a value related to 1.000.000 for Forex.
engine.submitOrder("label", Instrument.EURUSD, OrderCommand.SELL, 0.001);

For EURUSD that is a minimum of 0.001 – the increment however is also 0.001, because 0.001001 gives an error. So increment is not 1 but 1000.
This gets stranger for Coffee or Silver or DEU.IDX.
In the settings things are also different and indices are not mentioned there.

QUESTION: how do I do this without testing for each and every instrument? There must be a logical and programmable way.

Image


Attachments:
File comment: Settings jForex.
Screenshot.png [203.7 KiB]
Downloaded 352 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: Order Amount in Java jForex Post rating: 0   New post Posted: Mon 09 Nov, 2020, 14:26 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Greetings.

In the Platform Preferences you can set Amount in Units and default Amount to 1001.

Strategy submitOrder should work fine with 0.001001 amount.
Please specify what exactly error do you get.

Regards.


 

Jump to:  

cron
  © 1998-2024 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