|
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.
order amount is empty or zero related order |
moritzg74
|
Post subject: order amount is empty or zero related order |
Post rating: 0
|
Posted: Wed 06 Feb, 2013, 17:05
|
|
User rating: 0
Joined: Sun 20 Nov, 2011, 22:34 Posts: 10
|
Hi,
I have a java program that uses the JForex API to control a number of accounts. DEMO and LIVE accounts. For the demo accounts however changing the StopLoss or TakeProfit levels always result in the following error message:
INFO: Message type ORDER_CHANGED_REJECTED VALIDATION_ERROR-Your order has been rejected due to validation failure. order amount is empty or zero related order ORDERLABEL state FILLED
The exactly same application works with no problems when connected to a live account.
Doe anyone have an idea what this is related to and how we can fix this?
Thanks for any clues
Moritz
|
|
|
|
 |
API Support
|
Post subject: Re: order amount is empty or zero related order |
Post rating: 0
|
Posted: Mon 11 Feb, 2013, 08:17
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please provide an example strategy which replicates the problem. Also please provide all the relevant launch conditions.
|
|
|
|
 |
moritzg74
|
Post subject: Re: order amount is empty or zero related order |
Post rating: 0
|
Posted: Mon 04 Mar, 2013, 09:53
|
|
User rating: 0
Joined: Sun 20 Nov, 2011, 22:34 Posts: 10
|
Hi,
sorry for answering so late.
The problem appears on the live system since this morning. This is critical.
my Stand-Alone application starts a strategy which, in its onStart() method adds a barListener for EUR/USD just to get the timing right (handle trades every ten minutes when a 10min bar is finished).
@Override public void onStart(IContext arg0) throws JFException { context = arg0; HashSet<Instrument> iset = new HashSet<Instrument>(instruments); arg0.setSubscribedInstruments(iset); arg0.subscribeToBarsFeed(Instrument.EURUSD, Period.TEN_MINS, OfferSide.ASK, listener); }
context is stored statically in my application to access the dukascopy system from other parts of my application. the onBar Method of that listener will then try to submit or close orders and possibly change StopLosses of existing orders. All from within the onBar method.
Could it be a problem with storing the context locally?
Thanks
Moritz
|
|
|
|
 |
API Support
|
Post subject: Re: order amount is empty or zero related order |
Post rating: 0
|
Posted: Mon 04 Mar, 2013, 10:05
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please provide a full example strategy.
|
|
|
|
 |
moritzg74
|
Post subject: Re: order amount is empty or zero related order |
Post rating: 0
|
Posted: Mon 04 Mar, 2013, 10:06
|
|
User rating: 0
Joined: Sun 20 Nov, 2011, 22:34 Posts: 10
|
Hi,
I was able to generate a very small program to demonstrate this problem. See attached file. In this example, the onBar method of the strategy takes the fist open order and tries to change its stoploss level. And this is the output I get.
Mrz 04, 2013 10:04:38 AM de.indexrennen.jforex.client.TradeClientTest$1 onStart INFO: Strategy started: 33 Mrz 04, 2013 10:04:44 AM de.indexrennen.jforex.client.TradeClientTest$2 onBar INFO: Strategys on Bar Called GBP/USD 1362387870000[2013-03-04 09:04:30.000+0000] O: 1.50426 C: 1.50417 H: 1.50426 L: 1.50417 V: 11.72 Your order has been rejected due to validation failure. order amount is empty or zero Mrz 04, 2013 10:04:44 AM de.indexrennen.jforex.client.TradeClientTest$2 onMessage INFO: Message type ORDER_CHANGED_REJECTED VALIDATION_ERROR-Your order has been rejected due to validation failure. order amount is empty or zero related order POFFER_245_0840_1 state FILLED
M.
Attachments: |
TradeClientTest.java [4.97 KiB]
Downloaded 285 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.
|
|
|
|
|
 |
moritzg74
|
Post subject: Re: order amount is empty or zero related order |
Post rating: 0
|
Posted: Mon 04 Mar, 2013, 10:28
|
|
User rating: 0
Joined: Sun 20 Nov, 2011, 22:34 Posts: 10
|
I added some more output to my onBar method to see what amount the order has. The problem is still there.
I have the following dependencies in my pom.xml.
<dependency> <groupId>com.dukascopy.dds2</groupId> <artifactId>JForexClientLibrary</artifactId> <version>2.17.12</version> <exclusions> <exclusion> <artifactId>ecj</artifactId> <groupId>eclipse</groupId> </exclusion> <exclusion> <artifactId>jcalendar</artifactId> <groupId>jcalendar</groupId> </exclusion> <exclusion> <artifactId>JForex-API</artifactId> <groupId>com.dukascopy.api</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.dukascopy.api</groupId> <artifactId>JForex-API</artifactId> <version>2.7.8</version> </dependency>
M.
@Override public void onBar(Instrument arg0, Period arg1, IBar arg2, IBar arg3) throws JFException { if (context.getEngine().getOrders().size() > 0) { IOrder order = context.getEngine().getOrders().get(0); if (order.getInstrument().equals(arg0)) { LOGGER.info ("Strategys on Bar Called " + arg0 + " " + arg2 + " order Amount " + order.getAmount()); order.setStopLossPrice(order.getStopLossPrice() + order.getInstrument().getPipValue()); } } }
Mrz 04, 2013 10:23:15 AM de.indexrennen.jforex.client.TradeClientTest$2 onBar INFO: Strategys on Bar Called GBP/USD 1362388980000[2013-03-04 09:23:00.000+0000] O: 1.50555 C: 1.50563 H: 1.50563 L: 1.50555 V: 13.5 order Amount 0.146447 Your order has been rejected due to validation failure. order amount is empty or zero Mrz 04, 2013 10:23:16 AM de.indexrennen.jforex.client.TradeClientTest$2 onMessage INFO: Message type ORDER_CHANGED_REJECTED VALIDATION_ERROR-Your order has been rejected due to validation failure. order amount is empty or zero related order POFFER_245_0840_1 state FILLED
|
|
|
|
 |
moritzg74
|
Post subject: Re: order amount is empty or zero related order |
Post rating: 0
|
Posted: Mon 04 Mar, 2013, 10:43
|
|
User rating: 0
Joined: Sun 20 Nov, 2011, 22:34 Posts: 10
|
I think I found the problem. The maven dependency to jForexClient was causing the trouble.
<groupId>com.dukascopy.dds2</groupId> <artifactId>JForexClientLibrary</artifactId> <version>2.17.12</version>
Replacing it with
<dependency> <groupId>com.dukascopy.dds2</groupId> <artifactId>DDS2-jClient-JForex</artifactId> <version>2.24</version> </dependency>
seems to have helped.
M.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|