hello support,
i try to use this wiki :https://www.dukascopy.com/wiki/#Historical_high_values
well it's perfect for my short signal but the strategy don't take a long signal
maybe i do something wrong. i have printed messages with console.getOut and all seem good.
that's my code for values
long lastTickTime = history.getLastTick(instrument).getTime();
long lastBarTime = history.getBarStart(period, lastTickTime);
List<IBar> bars = history.getBars(instrument, period, OfferSide.ASK, Filter.NO_FILTER, 10, lastBarTime, 0);
List<IBar> bars20 = history.getBars(instrument, period, OfferSide.ASK, Filter.NO_FILTER, 20, lastBarTime, 0);
double maxHigh10 = 0;
double maxHigh20 = 0;
double minLow10 = 0;
double minLow20 = 0;
for(IBar bar : bars){
if(maxHigh10 < bar.getHigh()){
maxHigh10 = bar.getHigh();
}
if(minLow10 < bar.getLow()){
minLow10 = bar.getLow();
}
}
for(IBar bar : bars20){
if(maxHigh20 < bar.getHigh()){
maxHigh20 = bar.getHigh();
}
if(minLow20 < bar.getLow()){
minLow20 = bar.getLow();
}
}
that's my code for signal
if (prevBar1.getOpen() < prevBar1.getClose()
&& prevBar.getClose() > prevBar1.getOpen()
&& currBar.getClose() < prevBar1.getLow()
&& ma1 > ma11
&& maxHigh20 > maxHigh10){
sellSign = true;
sellPrice = currBar.getLow() - getPipPrice(pipsBelow);
}
//for buy
if(prevBar1.getOpen() > prevBar1.getClose()
&& prevBar.getClose() < prevBar1.getOpen()
&& currBar.getClose() > prevBar1.getHigh()
/*&& ma1 < ma11*/
&& minLow20 < minLow10){
buySign = true;
buyPrice = currBar.getHigh() + getPipPrice(pipsAbove);
}
so, when i backtest this strategy a error messages appear :
12:53:29 Strategy tester: com.dukascopy.api.JFException: Could not load bar for instrument [EUR/USD], period [15 Mins], side [Ask], start time [2011.04.04 09:00:00 000], current bar start time [2011.04.04 09:15:00 000] @ jforex.strategies.indicators.reversalbar1.onBar(reversalbar1.java:98).
i'm looking for a while the solution but i can't find anything.
could you help me please.
best regards