|
JFOREX-1366: Wrong TP order + getLabel() returns null |
[bilbao]
|
Post subject: JFOREX-1366: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Tue 01 Dec, 2009, 14:41
|
|
User rating: 0
Joined: Wed 17 Dec, 2008, 11:19 Posts: 29
|
Hi,
I have a problem with a filled order
1) getLabel() returns null, but this order has a label displayed in JForex
2) creating a TP order on this filled order creates a wrong TP order: a) it is not attached to the filled order b) a TP order already exists for this filled order
1) and 2) are linked. I have no problem with other filled orders.
Yous can see that on the screenshot attached.
Thanks for your help
Attachments: |
bug_jforex_tp.jpg [97.71 KiB]
Downloaded 674 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.
|
|
|
|
|
|
[Michel]
|
Post subject: Re: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Thu 03 Dec, 2009, 23:32
|
|
User rating: 0
Joined: Thu 17 Sep, 2009, 23:29 Posts: 7
|
I have the same problem : for(final IOrder order : engine.getOrders(instrument)){ if(!order.getLabel().startsWith(EAName,0)) continue; "order.getLabel()" cause a null pointer exception, which crashes the strategy. The order is a TP limit with a blank EXT.ID; it was enter manually. I may run several strategies on the same pairs, so they need to recognize their own orders by the labels, So the question is : do the manual orders have a label ? Is there a workaround or do I have to check first that the order label is not null ? Thank you, Michel
|
|
|
|
|
[bilbao]
|
Post subject: Re: JFOREX-1366: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Sun 06 Dec, 2009, 19:24
|
|
User rating: 0
Joined: Wed 17 Dec, 2008, 11:19 Posts: 29
|
I think manual orders have no label.
My problem concerns an order submitted by a strategy which gives a label at creation.
|
|
|
|
|
API Support
|
Post subject: Re: JFOREX-1366: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Tue 08 Dec, 2009, 09:52
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Unfortunately we do not know how to create an order without an External id. Could you please describe how to reproduce the problem?
|
|
|
|
|
[Michel]
|
Post subject: Re: JFOREX-1366: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Tue 08 Dec, 2009, 22:43
|
|
User rating: 0
Joined: Thu 17 Sep, 2009, 23:29 Posts: 7
|
Support wrote: Unfortunately we do not know how to create an order without an External id. Could you please describe how to reproduce the problem? Really I don't know how to reproduce it, but here is the picture: Attachment:
Empty Ext. ID.jpg [26.63 KiB]
Downloaded 622 times
|
|
|
|
|
[bilbao]
|
Post subject: Re: JFOREX-1366: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Wed 09 Dec, 2009, 02:36
|
|
User rating: 0
Joined: Wed 17 Dec, 2008, 11:19 Posts: 29
|
This is the pseudo code I use to create (update, to be exact) TP orders:
onBar(){ double open=0, tp=0; for(IOrder order:engine.getOrders()) if(order!=null) if(order.getState()==IOrder.State.FILLED) { open=order.getOpenPrice(); tp=open+...; if(tp!=order.getTakeProfitPrice()) order.setTakeProfitPrice(tp); } }
Usually it works fine. But not for the filled order I mentionned in my first post: a second TP order is created (with no ext ID) !
The problem should be in order:engine.getOrders().
|
|
|
|
|
API Support
|
Post subject: Re: JFOREX-1366: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Wed 09 Dec, 2009, 09:27
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
It seems the TP was opened manually. In this case, there was no Ext ID being attached to the TP order.
|
|
|
|
|
[bilbao]
|
Post subject: Re: JFOREX-1366: Wrong TP order + getLabel() returns null |
Post rating: 0
|
Posted: Thu 10 Dec, 2009, 21:13
|
|
User rating: 0
Joined: Wed 17 Dec, 2008, 11:19 Posts: 29
|
But why do I have 2 TP orders attached to the same filled order (see screenshot in first post) ?
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|