I have a similar, if not the same problem. My indicator does not draw on the chart, but I call it twice from the strategy using different optional inputs. As you can see from the code sample below, I have different IIndicator objects (track2s and track2b) for a custom indicator Track2. Track2 accepts 1 optional input. In code below either 3.5 or 6.5. Despite all this, when I display the first output index from strategy, the values are the same! BUT, if I print from inside the custom indicator, each indicator value is different (correct) because OptionalInputs are different.
This problem is sooooo annoying!
Object[] rngResult = indicators.calculateIndicator(
this.rangeDescriptor,
new OfferSide[] { OfferSide.BID },
track2s.getIndicatorInfo().getName(),
new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE},
new Object[]{ 3.5 },
0
);
loadArrays( rngResult, 0);
Object[] rngResult2 = indicators.calculateIndicator(
this.rangeDescriptor,
new OfferSide[] { OfferSide.BID },
track2b.getIndicatorInfo().getName(),
new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE},
new Object[]{ 6.5 },
0
);
loadArrays( rngResult2, 1);