Hi,
I have a custom indicator which has 4 outputs; It is working ok on chart, as expected.
I want now call it from code and get that 4 values calculated for a shift.
I need to use the calculateIndicator() variant with filters and I call it as below. Then I try printout the values but I get a class cast exception errror when it finds (Double)aArr[i] code.
Because I use filter variant with numberOfCandlesBefore/After, I would expect the return data to be in form Object[][] as the built in indicators have this method, but I dont know how to interpret the returned Object[] into my 4 output values. Can you help ?
int aShift = 1;
IBar aBar = getIBar(aTimeFrame,aShift);
Object[] aArr = iStrategy.iIndicators.calculateIndicator(iInstr,aTimeFrame,new OfferSide[] {OfferSide.BID,OfferSide.BID},"MYIND",new IIndicators.AppliedPrice[] {aAppliedPrice}, new Object[]{aTimePeriod,aMaType.ordinal()},Filter.ALL_FLATS,1,aBar.getTime(),0);
if(aArr == null || aArr.length <= 0)
throw new JFException("Indicator not ready.");
for (int i=0;i<aArr.length;i++)
printMessage("output["+i+"]: "+(Double)aArr[i]);