Hi Everyone,
first, I create OBV indicator like this.
Time = history.getBar(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID,1).getTime();
double obvh[] = indicators.obv(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.BID, IIndicators.AppliedPrice.CLOSE,OfferSide.BID, Filter.ALL_FLATS, 1, Time, 0);
My code works when I start the indicator, but value is wrong. my OBV value less than the real OBV value on chart.
for this case, i suggest API Support recommended to set IndicatorInfo.setRecalculateAll(true) for indicator. Somebody can show me the sample code for this. please sample code that return OBV value like value from chart.
and I still get error message
java.lang.ArrayIndexOutOfBoundsException: 1 for this line.
Object[] result = indicators.calculateIndicator(Instrument.EURUSD, Period.ONE_HOUR, new OfferSide[] {OfferSide.BID}, "OBV", new IIndicators.AppliedPrice[]{IIndicators.AppliedPrice.CLOSE}, new Object[]{}, 1);
I just need correct value for OBV indicator, Somebody help me for this?.
Thank you for your help in advance.
Apologize for my English.