// Please note that your 'Using declarations' section needs to have
//
// using System.Collections.ObjectModel;
//
//added in order for this example to compile correctly
// instantiate a list of instruments
Collection<cbi.instrument> instrumentsToClose = new Collection<instrument>();
// add instruments to the collection
instrumentsToClose.Add(Instrument.GetInstrument("AAPL"));
instrumentsToClose.Add(Instrument.GetInstrument("MSFT"));
// pass the instrument collection to the Flatten() method to be flattened
Account.Flatten(instrumentsToClose);