|
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.close throw exception.. |
markun
|
Post subject: order.close throw exception.. |
Post rating: 0
|
Posted: Mon 13 Aug, 2012, 16:43
|
|
User rating: 0
Joined: Wed 25 Apr, 2012, 04:59 Posts: 7 Location: TurkeyTurkey
|
I get the below exception while I try to close an order that is enough for me... order is defined with; IOrder order
Method called is order.close(); I need help Best Regards..
java.lang.NoSuchMethodError: com.dukascopy.api.IEngine.createSignal(Lcom/dukascopy/api/IOrder;Lcom/dukascopy/api/ISignal$Type;)V @ com.pinos.system.Strategy.onTick(Strategy.java:141) com.dukascopy.api.IEngine.createSignal(Lcom/dukascopy/api/IOrder;Lcom/dukascopy/api/ISignal$Type;)V: java.lang.NoSuchMethodError: com.dukascopy.api.IEngine.createSignal(Lcom/dukascopy/api/IOrder;Lcom/dukascopy/api/ISignal$Type;)V at com.dukascopy.api.impl.connect.PlatformOrderImpl.close(PlatformOrderImpl.java:358) at com.dukascopy.api.impl.connect.PlatformOrderImpl.close(PlatformOrderImpl.java:485) at com.dukascopy.api.impl.connect.PlatformOrderImpl.close(PlatformOrderImpl.java:489) at com.dukascopy.api.impl.connect.PlatformOrderImpl.close(PlatformOrderImpl.java:493)
|
|
|
|
 |
jlongo
|
Post subject: Re: order.close throw exception.. |
Post rating: 0
|
Posted: Mon 13 Aug, 2012, 18:20
|
|
User rating: 94
Joined: Mon 06 Feb, 2012, 12:22 Posts: 357 Location: Portugal, Castelo Branco
|
hi markun:
Seems to me you have the "order" variable without the corresponding order object...
Hope that helps.
Trade well and prospers in your way.
JL
|
|
|
|
 |
markun
|
Post subject: Re: order.close throw exception.. |
Post rating: 0
|
Posted: Mon 13 Aug, 2012, 20:20
|
|
User rating: 0
Joined: Wed 25 Apr, 2012, 04:59 Posts: 7 Location: TurkeyTurkey
|
Hi,
I get the orders with following method then iterate the array List and close the one that statisfffies the condition? I didnt get what is wrong? I see the order IOrder order object as it responds to order.getProfitLossInAccountCurrency() method but when say .close() it gives the Exception in Exceoption it says no such Method Exceoption! ??
public ArrayList<IOrder> InstrumentpositionsTotal(Instrument instrument) { IEngine engine = Strategy.getInstance().getEngine(); ArrayList<IOrder> PositionsList = new ArrayList<>(); try { for (IOrder order : engine.getOrders()) { if (order.getInstrument() == instrument) { if (order.getState() == IOrder.State.FILLED) { PositionsList.add(order); } } } } catch (JFException ex) { Logger.getLogger(PinosAccount.class.getName()).log(Level.SEVERE, null, ex); } return PositionsList; }
|
|
|
|
 |
jlongo
|
Post subject: Re: order.close throw exception.. |
Post rating: 0
|
Posted: Mon 13 Aug, 2012, 20:36
|
|
User rating: 94
Joined: Mon 06 Feb, 2012, 12:22 Posts: 357 Location: Portugal, Castelo Branco
|
Hi markun:
The fill of the arraylist seems ok to me... At the moment of getting the Profit/Loss the order is in state "filled" ?
You verify if the order don't is closed before order.close() ie: if (order.getState() == IOrder.State.FILLED) { order.close(); } ?
Just an ideia, hope that helps.
Best regards
JL
EDIT: The error started today ??? There is a possibility of a bug on new API as today was released a new API.
|
|
|
|
 |
markun
|
Post subject: Re: order.close throw exception.. |
Post rating: 0
|
Posted: Mon 13 Aug, 2012, 21:07
|
|
User rating: 0
Joined: Wed 25 Apr, 2012, 04:59 Posts: 7 Location: TurkeyTurkey
|
Problem writes as
java.lang.NoSuchMethodError: com.dukascopy.api.IEngine.createSignal(Lcom/dukascopy/api/IOrder;Lcom/dukascopy/api/ISignal$Type;)V @ com.pinos.system.Strategy.onTick(Strategy.java:100)
What may this mean
|
|
|
|
 |
jlongo
|
Post subject: Re: order.close throw exception.. |
Post rating: 0
|
Posted: Mon 13 Aug, 2012, 22:13
|
|
User rating: 94
Joined: Mon 06 Feb, 2012, 12:22 Posts: 357 Location: Portugal, Castelo Branco
|
Hi markun:
That means you are calling a method/function that doesn't exist on line 100 of your code (different line this time relatively to your first post). In this case i supose that is on the "order" object too. That's why i asked you if you have the order object correctly initiated. But can be a bug on new API released today if this problem started today and before is working perfectly. We have to wait to see what support says.
Have you created a user defined signal order ? The problem seems related with orders signals (close as your case) on ISignal interface
Best regards
JL
|
|
|
|
 |
API Support
|
Post subject: Re: order.close throw exception.. |
Post rating: 0
|
Posted: Tue 14 Aug, 2012, 07:34
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Please provide full example straetgy that replicates the problem. If you don't want to make it public, please send it to [email protected].
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|