I have a simple strategy based on Stochastic oscillator see below.
My questions:
1) How can i have slowK and slowD drawn to the screen? I have seen the wiki article about drawOutput() by i dont see any example.
2) When i try to test the strategy below and add a Stochastic indicator to the chart, i get different results between what is drawn to the screen and the the calculated slowk/slowD.
Thanks!
@Configurable("Instrument") public Instrument confInstrument = Instrument.EURUSD;
@Configurable("Period") public Period confPeriod = Period.FOUR_HOURS;
public void onBar(Instrument instrument, Period period, IBar askbar,
IBar bidbar) throws JFException {
double[] s1 = indicators.stoch(instrument, period, OfferSide.ASK,
40, 10, MaType.SMA, 20, MaType.SMA, 1)
double slowK= s1[0];
double slowD = s1[1];
}