public OCInstrument(string[] fields, ref int i)
        {
            string instrumentType = fields[i];

            ++i;

            _instrumentType = InstrumentType.UNKNOWN;
            if (instrumentType.Equals("C"))
            {
                _instrumentType = InstrumentType.CALL;
                _instrument     = new Option(fields, ref i);
            }
            else if (instrumentType.Equals("P"))
            {
                _instrumentType = InstrumentType.PUT;
                _instrument     = new Option(fields, ref i);
            }
            else if (instrumentType.Equals("F"))
            {
                _instrumentType = InstrumentType.FUTURE;
                _instrument     = new Future(fields, ref i);
            }
            else if (instrumentType.Equals("E"))
            {
                _instrumentType = InstrumentType.EQUITY;
                _instrument     = new Equity(fields, ref i);
            }
            else if (instrumentType.Equals("I"))
            {
                _instrumentType = InstrumentType.INDEX;
                _instrument     = new Index(fields, ref i);
            }
            else if (instrumentType.Equals("S"))
            {
                _instrumentType = InstrumentType.SPREAD;
                _instrument     = new Spread(fields, ref i);
            }
        }
Exemple #2
0
 public void OnInstrumentFound(PDInstrument instrument)
 {
     AddInstrumentItem(instrument.ToString());
     tsStatus.Text = string.Format("Instruments: {0}", ++_instrumentCount);
 }