Dukascopy
 
 
Wiki JStore Search Login

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.

why does these two exceptions occur? any detail and how to
 Post subject: why does these two exceptions occur? any detail and how to Post rating: 0   New post Posted: Tue 08 Feb, 2011, 09:24 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
why does these two exceptions happen? any detail and how to debug?

05:41:47 com.dukascopy.charts.data.datacache.DataCacheException: Cannot execute request for data for instrument [EUR/USD] period [1 Min] side [Bid] from [2011.02.08 05:39:00 000] to [2011.02.08 05:39:00 000] attempt [5] @ com.dukascopy.charts.data.datacache.u.a(Unknown Source)


05:41:47 com.dukascopy.charts.data.datacache.DataCacheException: Cannot execute request for data for instrument [EUR/USD] period [1 Min] side [Bid] from [2011.02.08 05:39:00 000] to [2011.02.08 05:39:00 000] attempt [5] @ com.dukascopy.charts.data.datacache.u.a(Unknown Source)

i have written a strategy and it seems running well but just throw out exceptions stochastically as posted above . i have dig wiki and have not found information about these error. so can support team explain in detail and give me a solution ?

by the way, since any one of the two error occur ,my strategy will stop forever so can support give me another strategy B that will look after my strategy A which is supposed not to stop stochastically ,and once strategy A stop running ,B will automatically make A running on local machine?


 
 Post subject: Re: why does these two exceptions occur? any detail and how Post rating: 0   New post Posted: Thu 10 Feb, 2011, 15:33 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
no answers ,shall i upload my sourcecode?


 
 Post subject: Re: why does these two exceptions occur? any detail and how Post rating: 0   New post Posted: Sat 12 Feb, 2011, 05:21 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
com.dukascopy.api.JFException: Cannot close order in CREATED, CLOSED or CANCELED state, current state - [CREATED]
at com.dukascopy.dds2.greed.agent.strategy.tester.an.close(Unknown Source)
at jforex.breakema7.onBar(breakema7.java:147)
at com.dukascopy.dds2.greed.agent.strategy.tester.o.run(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.o.ww(Unknown Source)
at com.dukascopy.dds2.greed.actions.StrategyTesterAction.uH(Unknown Source)
at com.dukascopy.dds2.greed.actions.StrategyTesterAction.uh(Unknown Source)
at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

============================================
can anyone explain this information?and give me solutions please


 
 Post subject: Re: why does these two exceptions occur? any detail and how Post rating: 0   New post Posted: Thu 17 Feb, 2011, 14:00 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
You can close an order if it is in the Filled or in the Opened state. Please consider the following code:
for (IOrder order : engine.getOrders()) {
    if (order.getState().equals(IOrder.State.FILLED) || order.getState().equals(IOrder.State.OPENED)){
        order.close();
    }
}


 

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