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.

Exception explanation during receive previous bar
 Post subject: Exception explanation during receive previous bar Post rating: 0   New post Posted: Fri 06 May, 2016, 08:37 
User avatar

User rating: 0
Joined: Fri 06 May, 2016, 08:28
Posts: 8
Location: PolandPoland
In my demo account i run two strategies. The strategies are the same only with one difference: it works on different instruments (EURUSD, EURGBP). The following exception occurs:

com.dukascopy.api.JFException: Could not load bar for instrument [EUR/USD], period [15 Mins], side [Bid], start time [2016.05.05 13:15:00 000], current bar start time [2016.05.05 13:30:00 000]
   at com.dukascopy.api.impl.History.getHistoryBarBlocking(History.java:236)
   at com.dukascopy.api.impl.History.getBar(History.java:201)
   at singlejartest.StrategyEURUSD.onBar(StrategyEURUSD.java:190)
   at com.dukascopy.api.impl.execution.TaskOnBar.postData(TaskOnBar.java:85)
   at com.dukascopy.api.impl.execution.TaskOnBar.call(TaskOnBar.java:63)
   at com.dukascopy.api.impl.execution.TaskOnBar.call(TaskOnBar.java:23)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at com.dukascopy.api.impl.execution.ScienceThreadPoolExecutor$Worker.runTask(ScienceThreadPoolExecutor.java:904)
   at com.dukascopy.api.impl.execution.ScienceThreadPoolExecutor$Worker.run(ScienceThreadPoolExecutor.java:926)
   at java.lang.Thread.run(Thread.java:745)


It is wired because this exception did not occurs every time. The strategies works for example for two days without any problem and then the exception occurs.
StrategyEURUSD.java:190:
double previousClose = history.getBar(myInstrument, Period.FIFTEEN_MINS, OfferSide.BID, 1).getClose();

I do not understand this because I only want to get the previous bar on every 15min bar. Only one thing comes to my mind why the code throw exception, maybe because of run two strategies. Please help me :)


 
 Post subject: Re: Exception explanation during receive previous bar Post rating: 0   New post Posted: Mon 09 May, 2016, 12:29 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We were unable to reproduce this. Please, Is there a sample strategy that would reproduce this issue?


 
 Post subject: Re: Exception explanation during receive previous bar Post rating: 0   New post Posted: Mon 09 May, 2016, 14:13 
User avatar

User rating: 0
Joined: Fri 06 May, 2016, 08:28
Posts: 8
Location: PolandPoland
No it is not a sample strategy. As i said i run my strategy about three weeks on demo account and this exception occurred only twice. Is any another way to get the previous 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