i only want to subscribe to 2 symbols from my strategy. however my output shows that i have subscribed to 7 symbols. mind u i have all of those symbols on the charts. how do i fix it.
14:41:48 instruments after subscription + EUR/USD, EUR/JPY, AUD/USD, USD/CHF, USD/CAD, GBP/USD, USD/JPY, EUR/GBP,
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();
Set<Instrument> instruments = new HashSet<Instrument>();
instruments.add(Instrument.EURUSD);
instruments.add(Instrument.AUDUSD);
context.setSubscribedInstruments(instruments);
// wait max 5 seconds for the instruments to get subscribed
int i = 5;
while (!context.getSubscribedInstruments().containsAll(instruments)) {
console.getOut().println(" not subscribed yet");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
console.getOut().println(e.getMessage());
}
i--;
}
console.getOut().print("instruments after subscription + ");
for (Instrument in : context.getSubscribedInstruments()) {
console.getOut().print( in + ", ");
}
console.getOut().println();
}