Dukascopy
 
 
Wiki JStore Search Login

JFOREX-1560: LABEL_NOT_UNIQUE
 Post subject: JFOREX-1560: LABEL_NOT_UNIQUE Post rating: 0   New post Posted: Tue 09 Mar, 2010, 19:14 

User rating: 0
Joined: Tue 09 Mar, 2010, 18:54
Posts: 4
Hello,

When starting out with https://www.dukascopy.com/client/jforexl ... ibrary.zip Main.java, and extending it to run more than one strategy, the strategies run into LABEL_NOT_UNIQUE exceptions when executing orders.
The same strategies run fine if I only launch one strategy from Main.java.

I put a breakpoint on the engine.submitOrder call, and verified that I only open one order. However I am not able to debug into the engine.submitOrder code. Thus for what I understand, for some reason a single call to engine.submitOrder executes several orders, where additional orders are rejected due to having the same label.

In debugging this I also got one exception on instrument not subscribed. From my own code this would not be possible, as I check for the instrument type before submitting any orders, and I only submit orders which pass have the correct instrument type.

The behavior is reproducible 100% of the time. The current workaround I use, is a try-catch or the submitOrder call. I still of course get the exception, however, my strategy does not stop.


 
 Post subject: Re: LABEL_NOT_UNIQUE Exception when running multiple strategies Post rating: 0   New post Posted: Wed 10 Mar, 2010, 15:56 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,
It is not allowed to open several orders with the same label. If both strategies open order with the same label, then one of them will fail. Order label must be unique for all strategies and even more - for your account.


 
 Post subject: Re: LABEL_NOT_UNIQUE Exception when running multiple strategies Post rating: 0   New post Posted: Wed 10 Mar, 2010, 18:16 

User rating: 0
Joined: Tue 09 Mar, 2010, 18:54
Posts: 4
Hello,

Thank you for the quick response.

In order to better illustrate the problem I have attached java files.

As you can see, MA_Play2 does not submit any orders. However, if I run both strategies, I get an LABEL_NOT_UNIQUE exception.

If I only run one strategy, (comment out line 145-146 in Main.java), I do not get this exception.

Also notice that an exception is thrown if line 133 in main.java is commented out.

I hope this enables you to better understand the behavior I am observing.

Kind regards,


Attachments:
MA_Play2.java [2.6 KiB]
Downloaded 437 times
MA_Play.java [3.88 KiB]
Downloaded 436 times
Main.java [5.33 KiB]
Downloaded 442 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: JFOREX-1560: LABEL_NOT_UNIQUE Post rating: 0   New post Posted: Wed 31 Mar, 2010, 02:01 

User rating: -
I think it is most likely a bug. It seems that all trategies registered are trying to send the same order. My two strategies use distinctly different labels. The error even occurs when you try to close an order.


 
 Post subject: Re: JFOREX-1560: LABEL_NOT_UNIQUE Post rating: 0   New post Posted: Wed 07 Apr, 2010, 16:19 

User rating: 0
Joined: Wed 31 Mar, 2010, 22:09
Posts: 6
I can also confirm this error. I register a new client and it's first order of the day is rejected with LABEL NOT UNIQUE.


 
 Post subject: Re: JFOREX-1560: LABEL_NOT_UNIQUE Post rating: 0   New post Posted: Mon 19 Apr, 2010, 15:10 

User rating: 0
Joined: Tue 09 Mar, 2010, 18:54
Posts: 4
@support

Hello,

Are you able to reproduce the behavior with the code posted? Do you consider this to be a bug?

Kind regards


 
 Post subject: Re: JFOREX-1560: LABEL_NOT_UNIQUE Post rating: 0   New post Posted: Tue 20 Apr, 2010, 08:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,
yes this is our bug. It is fixed and will be available with next API release.


 

Jump to:  

  © 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