Hi support.
I have an indicator with 2 outputs:
double [][] outputs = new double [2][];
By the loop in method calculate(int startIndex, intendIndex) fill myOutput array. This output is calculated with lookBack()=0
outputs[1] is moving average of myOutputs with specific period.
so:
ma.setInputParameter(0, myOutput);
ma.setOptInputParameter(0, timePeriod);
ma.setOutputParameter(0, outputs[1]);
IndicatorResult maResult = ma.calculate(0, myOutput.length-1);
if (maResult.getNumberOfElements() == 0) {
//ma returned 0 values
return new IndicatorResult(0, 0);
}
System.arraycopy(myOutput, maResult.getFirstValueIndex(), outputs[0], 0, maResult.getNumberOfElements());
return new IndicatorResult(smaResult.getFirstValueIndex(), maResult.getNumberOfElements());
Indicator returns less values then expected. Can you help me with this?
It is necessary that the method getLookBack() returns timePeriod?
Thank you