Hi Njoan,
Would you be able to provide a little more detail or an example of what it is that you are trying to do?
Sure:
Say that there is an IntegerDescriptor called "selection", and the user is supposed to enter an int from 1 to 3.
Is it possible then to create an Instrument object based on their input, without them having to explicitly choose an instrument themselves with an InstrumentDescriptor? ie. is there a way to do something similar to the following:
Java:
Integer selection = getSettings().getInteger(Inputs.INPUT);
Instrument s;
switch (selection):
case 1: s.setSymbol("IBM");
break;
case 2: s.setSymbol("FB");
break;
case 3: s.setSymbol("GE");
break;
Or, if that is not possible, is it possible that an Instrument object's symbol be changed within the calculate method? Ie. something like the following:
Code:
// In the initialize method:
settinggroup.addRow(new InstrumentDescriptor(Inputs.INSTRUMENT, "Selection"));
// In the calculate method:
Instrument i1 = getSettings().getInstrument(Inputs.INSTRUMENT);
if (series.getClose(i1) < 40.0) i1.setSymbol("FB");
Finally if none of these are possible, is there a way to simply set the default symbol for an InstrumentDescriptor?
Thanks for bearing with me