|
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.
help getbar is exception!!! |
grosskt
|
Post subject: help getbar is exception!!! |
Post rating: 0
|
Posted: Fri 19 Oct, 2018, 06:03
|
|
User rating: 0
Joined: Mon 11 Dec, 2017, 03:30 Posts: 26 Location: China,
|
com.dukascopy.api.JFException: Could not load bar for instrument [USD/JPY], period [30 Mins], side [Ask], start time [2018.10.19 07:30:00 000], current bar start time [2018.10.19 08:00:00 000] at com.dukascopy.api.impl.n.a(L:295) at com.dukascopy.api.impl.n.getBar(L:255) at COM.Mystrategies.StrategyTest.getbar_test(StrategyTest.java:77) at COM.Mystrategies.StrategyTest.onBar(StrategyTest.java:70) at com.dukascopy.api.impl.execution.m.cy(L:85) at com.dukascopy.api.impl.execution.m.call(L:63) at com.dukascopy.api.impl.execution.m.call(L:23) at java.util.concurrent.FutureTask.run(Unknown Source) at com.dukascopy.api.impl.execution.f$a.e(L:904) at com.dukascopy.api.impl.execution.f$a.run(L:926) at java.lang.Thread.run(Unknown Source) package jforex;
import java.util.*;
import com.dukascopy.api.*; import java.text.SimpleDateFormat;
public class StrategyTest implements IStrategy { @Configurable("Instrument") public Instrument Curinstrument = Instrument.USDJPY; @Configurable("Amount") public double NewOrderAmount = 0.061; private IEngine engine; private IConsole console; private IHistory history; private IContext context; private IIndicators indicators; private IUserInterface userInterface; private final SimpleDateFormat gmtSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public double DailyHighPrice,DailyLowPrice,newDailyHighPrice,newDailyLowPrice; public long LpriceCreateTime,HpriceCreateTime; public void onStart(IContext context) throws JFException { this.engine = context.getEngine(); this.console = context.getConsole(); this.history = context.getHistory(); this.context = context; this.indicators = context.getIndicators(); this.userInterface = context.getUserInterface(); Set<Instrument> instruments = new HashSet<Instrument>();
instruments.add(Curinstrument); context.setSubscribedInstruments(instruments, true); }
@Override public void onAccount(IAccount account) throws JFException { }
@Override public void onMessage(IMessage message) throws JFException { }
@Override public void onStop() throws JFException { }
@Override public void onTick(Instrument instrument, ITick tick) throws JFException { } @Override public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException { if (!instrument.equals(this.Curinstrument)) { return;
} if (period.equals(Period.ONE_MIN)) { getbar_test(); } } public void getbar_test() throws JFException { IBar curThirtBar = history.getBar(Curinstrument, Period.THIRTY_MINS, OfferSide.ASK, 0); IBar preThirtBar = history.getBar(Curinstrument, Period.THIRTY_MINS, OfferSide.ASK, 1); print(String.format("pre bar time=%s cur bar time=%s\n",gmtSdf.format(preThirtBar.getTime()),gmtSdf.format(curThirtBar .getTime()))); } private void print(Object o) { console.getOut().println(o); }
|
|
|
|
|
ASLOG2002
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Sat 20 Oct, 2018, 12:27
|
|
User rating: 1
Joined: Mon 16 Jul, 2012, 04:14 Posts: 31
|
Hi support! the same problem JFException !!!! int szVolume = 5; double[] volume = new double[szVolume];
public void initVolume() throws JFException {
for (int i = 0; i < szVolume; i++) { volume[i] = 0; Err("i=" + i +" " ); try { volume[i] = ((IBar) context.getHistory().getFeedData(feedDescriptor, i)).getVolume(); } catch (JFException e) {
Err( e.getMessage()); e.printStackTrace(); }
} } 11:13:52 Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.20 23:56:00 000], current bar start time [2018.10.21 00:00:00 000] 11:13:52 i=4 11:13:52 Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.20 23:57:00 000], current bar start time [2018.10.21 00:00:00 000] 11:13:52 i=3 11:13:52 Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.20 23:58:00 000], current bar start time [2018.10.21 00:00:00 000] 11:13:52 i=2 11:13:52 Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.20 23:59:00 000], current bar start time [2018.10.21 00:00:00 000] 11:13:52 i=1 11:13:52 i=0 The current version JForex API is 2.13.60. In the previous version, the code above worked fine.
|
|
|
|
|
API Support
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Tue 23 Oct, 2018, 10:36
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Problem detected, will be fixed in next release.
|
|
|
|
|
ASLOG2002
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Tue 23 Oct, 2018, 16:28
|
|
User rating: 1
Joined: Mon 16 Jul, 2012, 04:14 Posts: 31
|
Hi support! You must provide the ability to return to the previous version! You cause damage by your actions!
|
|
|
|
|
flashroyal
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Wed 24 Oct, 2018, 21:35
|
|
User rating: 0
Joined: Fri 22 Nov, 2013, 23:34 Posts: 3 Location: Ukraine,
|
JForex ver.3.4.6 JForex API ver.2.13.60 19:47:01 com.dukascopy.api.JFException: Could not load bar for instrument [EUR/USD], period [4 Hours], side [Ask], start time [2018.10.24 20:00:00 000], current bar start time [2018.10.25 00:00:00 000] @ Bot1M_082018CE.ACSignal(Bot1M_082018CE.java:505) private int ACSignal(Period _ACTimeFrame,int _AC)throws JFException{ int rezult=0; int ACFastPeiod=5 ,ACSlowPeiod=34; IBar prevBar = history.getBar(instr, _ACTimeFrame, OfferSide.ASK, 1); ....................
All my strategy stoped by this bug! Above example from one of them. ASLOG2002 wrote: Hi support! You must provide the ability to return to the previous version! You cause damage by your actions! Yes, is true!
|
|
|
|
|
JFR
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Mon 29 Oct, 2018, 14:28
|
|
User rating: 1
Joined: Fri 18 Jan, 2013, 11:22 Posts: 21
|
Every few minutes since I updated I get the following errors and my strategy crashes - PLEASE FIX URGENTLY
12:58:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:58:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:58:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:58:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:58:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:58:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:58:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:58:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:01 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:01 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:01 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:01 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:57:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:56:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [EUR/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:55:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:54:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:54:00 [ERROR] Could not load bar for instrument [USD/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:54:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:54:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:54:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000] 12:54:00 [ERROR] Could not load bar for instrument [GBP/JPY], period [1 Min], side [Bid], start time [2018.10.29 12:59:00 000], current bar start time [2018.10.29 13:00:00 000]
|
|
|
|
|
JFR
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Tue 30 Oct, 2018, 08:25
|
|
User rating: 1
Joined: Fri 18 Jan, 2013, 11:22 Posts: 21
|
When is the fix being released?
|
|
|
|
|
API Support
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Tue 30 Oct, 2018, 09:14
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
JFR wrote: When is the fix being released? In next platform release this week. But on old version application restart should help.
|
|
|
|
|
JFR
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Tue 30 Oct, 2018, 11:07
|
|
User rating: 1
Joined: Fri 18 Jan, 2013, 11:22 Posts: 21
|
API Support wrote: JFR wrote: When is the fix being released? In next platform release this week. But on old version application restart should help. How do I get that?
|
|
|
|
|
JFR
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Tue 30 Oct, 2018, 12:30
|
|
User rating: 1
Joined: Fri 18 Jan, 2013, 11:22 Posts: 21
|
Dukascopy have just said ...
For temporary solution you can adapt getBar() method as shown below.
WAS: IBar curThirtBar = history.getBar(Curinstrument, Period.THIRTY_MINS, OfferSide.ASK, 0);
FIX: IBar preThirtBar = history.getBars(Curinstrument, Period.THIRTY_MINS, OfferSide.ASK, Filter.NO_FILTER, 2, curThirtBar.getTime(), 0).get(0);
Unfortunately I didn't code my strategy so dont know how to do this...
Please provide link to previous working version ASAP
|
|
|
|
|
ASLOG2002
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Tue 30 Oct, 2018, 18:12
|
|
User rating: 1
Joined: Mon 16 Jul, 2012, 04:14 Posts: 31
|
What happened this time? I downloaded version 3.4.9 and my strategy stopped working !!!!! 16:51:19 Strategy "CatSpy16" is stopped at 2018-10-30 16:51:19.109 GMT on the local computer with parameters "Instrument"=[FeedDescriptor [dataType=TIME_PERIOD_AGGREGATION, instrument=GBP/USD, offerSide=Bid, period=1 Min, filter=NO_FILTER]], "Lots"=[26.0], "takeProfit in pips"=[2], "stopLoss in pips"=[2], "slippage in pips"=[5], "slippage in pips LIMIT"=[5], "Close All"=[true], "Use TP and SL orders"=[true]. Reason: Stopped on exception caught 16:51:19 Stopping "CatSpy16" strategy at 2018-10-30 16:51:19.109 GMT on the local computer 16:51:19 Strategy "CatSpy16" Strategy ID: B6835D1A80823A5D010F8BB87E2B1700 is started at 2018-10-30 16:51:19.107 GMT on the local computer with parameters "Instrument"=[FeedDescriptor [dataType=TIME_PERIOD_AGGREGATION, instrument=GBP/USD, offerSide=Bid, period=1 Min, filter=NO_FILTER]], "Lots"=[26.0], "takeProfit in pips"=[2], "stopLoss in pips"=[2], "slippage in pips"=[5], "slippage in pips LIMIT"=[5], "Close All"=[true], "Use TP and SL orders"=[true] 16:51:19 Starting "CatSpy16" strategy at 2018-10-30 16:51:19.093 GMT on the local computer 16:51:12 Compilation successful. Strategy ID: B6835D1A80823A5D010F8BB87E2B1700 16:51:11 Compiling CatSpy16.java
No adequate diagnostics! Reason: Stopped on exception caught
|
|
|
|
|
ASLOG2002
|
Post subject: help me! I can not work !!! |
Post rating: 0
|
Posted: Tue 30 Oct, 2018, 18:29
|
|
User rating: 1
Joined: Mon 16 Jul, 2012, 04:14 Posts: 31
|
How to return the previous version?
|
|
|
|
|
ASLOG2002
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Wed 31 Oct, 2018, 05:53
|
|
User rating: 1
Joined: Mon 16 Jul, 2012, 04:14 Posts: 31
|
My strategy does not start! Additional information: an exception occurs before calling the method onStart. See previos my post. The strategy in this form has worked for more than two years !!! Simple strategy starts successfully.
|
|
|
|
|
JFR
|
Post subject: Re: help getbar is exception!!! |
Post rating: 0
|
Posted: Fri 02 Nov, 2018, 07:38
|
|
User rating: 1
Joined: Fri 18 Jan, 2013, 11:22 Posts: 21
|
Version 3.4.10, 2.13.61 still has the problem
20:36:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.11.01 20:35:00 000], current bar start time [2018.11.01 20:36:00 000] 20:36:00 [ERROR] Could not load bar for instrument [GBP/USD], period [1 Min], side [Bid], start time [2018.11.01 20:35:00 000], current bar start time [2018.11.01 20:36:00 000]
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|