If I understand you correctly, you can implement something like this.
public class TickMultipleCurrency implements IStrategy {
private IEngine engine;
private IConsole console;
private IHistory history;
private IContext context;
private IIndicators indicators;
private IUserInterface userInterface;
HashSet<Instrument> myInstruments;
Instrument firstCurrency = Instrument.EURUSD;
Instrument secondCurrency = Instrument.USDCHF;
Instrument thirdCurrency = Instrument.GBPJPY;
ITick firstCurrencyLastTick, secondCurrencyLastTick, thirdCurrencyLastTick;
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();
myInstruments = new HashSet<>(Arrays.asList(firstCurrency, secondCurrency, thirdCurrency));
context.setSubscribedInstruments(myInstruments);
}
public void onAccount(IAccount account) throws JFException {
}
public void onMessage(IMessage message) throws JFException {
}
public void onStop() throws JFException {
}
public void onTick(Instrument instrument, ITick tick) throws JFException {
if (!myInstruments.contains(instrument)) {
return;
}
if (instrument.equals(firstCurrency)) {
firstCurrencyLastTick = tick;
}
else if (instrument.equals(secondCurrency)) {
secondCurrencyLastTick = tick;
}
else if (instrument.equals(thirdCurrency)) {
thirdCurrencyLastTick = tick;
}
}
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
}
}