I tried this but it does not work.
Output.Process( string.Format("The current ES contract should be '06-18' but the GetNextExpiry method returns: '{0}'", Instrument.GetInstrument("ES") .MasterInstrument.GetNextExpiry(DateTime.Now).ToString("MM-yy")), PrintTo.OutputTab1 );
Instrument.All.Each<Instrument>(item => { if (item.MasterInstrument.Name.Equals("ES") && item.FullName.EndsWith("18")) { Output.Process(item.FullName, PrintTo.OutputTab1); } });
ES 06-18
ES 09-18
ES 12-18
MasterInstrument.GetInstrumentByDate(Instrument instrument, DateTime date, bool getActualExiry, bool suppressCalculateRollOvers, IProgress progress);
Please help.
Thanks
Comment