hi everyone
I want to trade a lot of pairs at once.
for simplicity suppose they are only three GBPUSD , EURUSD , USDJPY
I want to choose the tradable pairs by a Boolean variable .see the following image

my question is how to use this Boolean variable as a real filter to choose tradable pairs
consider this code
public class multi_pairs implements IStrategy {
@Configurable("EURUSD")
public boolean EURUSD = false;
@Configurable("GBPUSD")
public boolean GBPUSD = true;
@Configurable("USDJPY")
public boolean USDJPY = false;
public Instrument instrument1 = Instrument.EURUSD;
public Instrument instrument1 = Instrument.GBPUSD;
public Instrument instrument3 = Instrument.USDJPY;
public Instrument[] my_instrument={instrument1, instrument2, instrument3};
public void onStart(IContext context) throws JFException {
Set<Instrument> instruments = new HashSet<Instrument>();
instruments.add(instrument1);
instruments.add(instrument2);
instruments.add(instrument3);
context.setSubscribedInstruments(instruments);
for (int i = 0; i < my_instrument.length; i++)
{
//here comes the question how to code this : if(my_instrument[i] Boolean box is checked to be traded && other conditions)
submitOrder(my_instrument[i],BUY,0);
}
if you can also shorten my code regarding subscribing instruments and the my_instrument array it will be great