Hi support,
I've create a strategy that add on chart two indicators like this:
public void onStart(IContext context) throws JFException {
this.engine = context.getEngine();
this.console = context.getConsole();
this.history = context.getHistory();
this.context = context;
this.indicators = context.getIndicators();
this.userInterface = context.getUserInterface();
_principal=null;
time.add(Calendar.HOUR_OF_DAY, 2);
this._chart=context.getChart(_instrument);
_indBBANDS = indicators.getIndicator("BBANDS");
_indSMA = indicators.getIndicator("SMA");
printIndicatorInfos(_indSMA);
this._chart.addIndicator(_indBBANDS, new Object[]{_bbperiod, _bbup, _bbdown, _bbmatype.ordinal()}, new Color[]{Color.RED, Color.GREEN, Color.RED},new OutputParameterInfo.DrawingStyle[]{OutputParameterInfo.DrawingStyle.LINE, OutputParameterInfo.DrawingStyle.LINE, OutputParameterInfo.DrawingStyle.LINE}, new int[]{1, 1, 1});
this._chart.addIndicator(_indSMA, new Object[]{_smaperiod}, new Color[]{Color.BLUE},new OutputParameterInfo.DrawingStyle[]{OutputParameterInfo.DrawingStyle.LINE}, new int[]{1});
}
Now, if every tick i want read the values from that indicators how I can do?
public void onTick(Instrument instrument, ITick tick) throws JFException {
if (instrument != _instrument) {
return;
}
double SMAvalue=//TODO: get value from _indSMA;
double[]BBANDS=//TODO: get value from _indBBANDS;
}
Thank's