This issue is already reported here
Something wrong with historical testerBug Desciption :
Indicator returning wrong result (affecting all indicator).
Detail:
This is example from my strategy.
/*
* Created by VisualJForex Generator, version 1.31
* Date: 28.12.2013 08:18
*/
......
private void CCI_block_17(Integer flow) {
Instrument argument_1 = defaultInstrument;
Period argument_2 = cciPeriod;
int argument_3 = 1;
int argument_4 = 14;
OfferSide[] offerside = new OfferSide[1];
IIndicators.AppliedPrice[] appliedPrice = new IIndicators.AppliedPrice[1];
offerside[0] = OfferSide.BID;
appliedPrice[0] = IIndicators.AppliedPrice.TYPICAL_PRICE;
Object[] params = new Object[1];
params[0] = 14;
try {
subscriptionInstrumentCheck(argument_1);
long time = context.getHistory().getBar(argument_1, argument_2, OfferSide.BID, argument_3).getTime();
Object[] indicatorResult = context.getIndicators().calculateIndicator(argument_1, argument_2, offerside,
"CCI", appliedPrice, params, Filter.WEEKENDS, argument_3 +1, time, 0);
if ((new Double(((double [])indicatorResult[0])[0])) == null) {
this.cci1 = Double.NaN;
} else {
this.cci1 = (((double [])indicatorResult[0])[0]);
}
} catch (JFException e) {
e.printStackTrace();
}
MultipleAction_block_22(flow);
}
There is logic error at calculateIndicator()
long time = context.getHistory().getBar(argument_1, argument_2, OfferSide.BID, argument_3).getTime();
// Get start of candle timeObject[] indicatorResult = context.getIndicators().calculateIndicator(argument_1, argument_2, offerside,
"CCI", appliedPrice, params, Filter.WEEKENDS,
argument_3 +1, time, 0);
// argument_3 should not be there, time parameter already point to correct shiftArgument_3 will double the shift value
Eg. CCI[0] -> CCI[0] // get CCI with shift 0 would return cci with shift 0 , correct but useless
CCI[1] -> CCI[2] // get CCI with shift 1 would return cci with shift 2 , INCORRECT
CCI[n] -> CCI[N*2] // get CCI with shift N would return cci with shift N*2
FIX:
Object[] indicatorResult = context.getIndicators().calculateIndicator(argument_1, argument_2, offerside,
"CCI", appliedPrice, params, Filter.WEEKENDS, 1, time, 0); // without argument_3 parameter
Does dukascopy already acknowledged that bug, since it's has been a month.
Regards