Hello!
Unfortunately there is no functionality that allows you to get chart objects selected before strategy run.
Maybe something like that can solve the problem:
1. Run strategy
2. Strategy adds listener to all object on all charts
3. Needed object is manually selected and gets processed by listener as needed
Here is example:
public class SelectedObjectExample extends ChartObjectAdapter implements IStrategy {
private IContext context;
private IConsole console;
public void onStart(IContext context) throws JFException {
this.context = context;
this.console = context.getConsole();
for (IChart chart : context.getCharts()) {
for (IChartObject chartObject : chart.getAll()) {
chartObject.setChartObjectListener(this);
}
}
}
@Override
public void selected(ChartObjectEvent e) {
IChartObject object = (IChartObject) e.getSource();
console.getOut().println(object);
}
@Override
public void onAccount(IAccount account) throws JFException {
}
@Override
public void onMessage(IMessage message) throws JFException {
}
@Override
public void onStop() throws JFException {
}
@Override
public void onTick(Instrument instrument, ITick tick) throws JFException {
}
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
}
}