Hi,
I'm trying to use the custom indicator from this topic :
viewtopic.php?f=6&t=191&p=641&hilit=calculateIndicator#p641first I call calculateindicator :
Object[] smarsi = indicators.calculateIndicator(instrument, Period.DAILY, new OfferSide[] {OfferSide.BID}, "SMA_RSI", new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[] {rsi, ema}, Filter.WEEKENDS, 1, tick.getTime(), 0);
When I try to read values :
//getting output on console
for (int i=0;i< smarsi.length;i++){
this.console.getOut().print("smarsi["+i+"]: "+(Double) smarsi[i]);
}
this is what I get :
12:08:20 Strategy tester: java.lang.ClassCastException: [D cannot be cast to java.lang.Double @ Litz.Litz.onTick(Litz.java:172)
Without th cast into Double (this.console.getOut().print(" smarsi["+i+"]: "+smarsi[i]);) I get :
12:10:54 smarsi[0]: [D@276eb37b smarsi[1]: [D@54c96476
How do I get the rsi and sma values from indicator ?