Can someone tell me where is the error in code on the bottom? I supose it's connected with startIndex and endIndex but I'm not sure and I don't know how to fix it.
All the time the same message: "Error in indicator: java.lang.NullPointerException"
I wanted to useichimoku indicator as a input of my own indicator, but first i wanted to check if it works, unfortunatelly it's not working
public IndicatorResult calculate(int startIndex, int endIndex) {
//calculating startIndex taking into account lookback value
if (startIndex - getLookback() < 0) {
startIndex = getLookback();
}
if (endIndex + getLookforward() >= inputs[0][0].length) {
endIndex = inputs[0][0].length - 1 - getLookforward();
}
if (startIndex > endIndex) {
return new IndicatorResult(0, 0);
}
ichi.setInputParameter(0, inputs[0]);
ichi.setOptInputParameter(0, timePeriod1);
ichi.setOptInputParameter(1, timePeriod2);
ichi.setOptInputParameter(2, timePeriod3);
ichi.setOutputParameter(0, outputs[0]);
ichi.setOutputParameter(1, outputs[1]);
ichi.setOutputParameter(2, outputs[2]);
ichi.setOutputParameter(3, outputs[3]);
ichi.setOutputParameter(4, outputs[4]);
ichi.calculate(startIndex, endIndex);
IndicatorResult ir = ichi.calculate(startIndex, endIndex);
return ir;
}