Hi,
I'm writing a strategy that runs on more than one currency. How can I enable the user to choose more than one instrument in the configuration dialogue?
I know you can do this:
@Configurable("Instrument")
public Instrument selectedInstrument = Instrument.EURUSD;
I tried the following without success (nothing shown on the config box):
@Configurable("Instruments")
public Instrument[] selectedInstruments;
I'd like to loop over the instruments later like that:
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
for(int a = 0; a < this.selectedInstruments.length; a++) {
if (!instrument.equals(this.selectedInstruments[a]) || !period.equals(this.selectedPeriod)) return;
// Do something!
}
}
}
Any clues?
Thanks in advance!
Kind regards,
Roberto