I dont understand what you mean.
I have just added code to onTick so that it adds a vertical line, but it fails at IVerticalLineChartObject. I assumed that the onStart code on its own would make a chart appear.
What am I doing wrong?
public class aTickChart implements IStrategy {
private IChart chart;
public void onStart(IContext context) throws JFException {
IChart chart = context.getChart(Instrument.EURUSD);
}
public void onTick(Instrument instrument, ITick tick) throws JFException {
double price1 = (tick.getAsk() + tick.getBid()) / 2;
IVerticalLineChartObject vLine = chart.getChartObjectFactory().createVerticalLine();
vLine.setPrice(0, price1);
vLine.setTime(0, tick.getTime());
chart.addToMainChart(vLine);
}
}