Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

hi.support..get last order have bug....
 Post subject: hi.support..get last order have bug.... Post rating: 0   New post Posted: Thu 12 Feb, 2015, 16:14 
User avatar

User rating: 0
Joined: Wed 28 Mar, 2012, 06:41
Posts: 25
Location: China, Beijing
I want to get the current instrument the last "Filled" order .but there are sometimes get thr wrong one.pls handle it..

private IOrder getLastOrder(Instrument instrument)throws JFException {
IOrder o = null;
List<IOrder> ss = engine.getOrders(instrument);
if(ss != null && ss.size() > 0){
for(int i = 0;i<ss.size();i++){
if(o == null && ss.get(i).getState() == IOrder.State.FILLED)
o = ss.get(i);
else if(o != null && o.getFillTime() < ss.get(i).getFillTime() && ss.get(i).getState() == IOrder.State.FILLED)
o = ss.get(i);
}
}

return o;
}


 
 Post subject: Re: hi.support..get last order have bug.... Post rating: 0   New post Posted: Fri 13 Feb, 2015, 11:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Unfortunately we were unable to reproduce this problem.
It would be easier to tell what is happening if you could provide
1) a sample strategy to create the orders and
2) describe how did you notice the problem?

Please note that it is not guaranteed that orders will get filled in the order that they are created.


 
 Post subject: Re: hi.support..get last order have bug.... Post rating: 0   New post Posted: Mon 16 Feb, 2015, 04:47 
User avatar

User rating: 0
Joined: Wed 28 Mar, 2012, 06:41
Posts: 25
Location: China, Beijing
sometimes this bug happen.
the probability in remote run is greater than local run..
you can test it


 

Jump to:  

  © 1998-2025 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