public void TestForReference() { List <BloombergDataInstrument> bbdis = new List <BloombergDataInstrument>(); BloombergDataInstrument bbdi = new BloombergDataInstrument(); bbdi.ID = 0; bbdi.Ticker = "VOD LN Equity"; //bbdi.Ticker = "BBG002626686 BUID"; //bbdi.SecurityType = "Equity"; bbdi.Type = BloombergDataInstrumentType.Security; bbdi.BBFields = new Dictionary <string, BloombergDataInstrumentField>(); bbdi.BBFields.Add("PX_LAST", new BloombergDataInstrumentField("PX_LAST")); bbdis.Add(bbdi); /* * bbdi.ID = 0; * bbdi.Ticker = "US0200021014 EQUITY"; * bbdi.SecurityType = "EQUITY"; * bbdi.Type = BloombergDataInstrumentType.Security; * bbdi.BBFields = new Dictionary<string, object>(); * bbdi.BBFields.Add("ID_ISIN", null); * bbdi.BBFields.Add("BID", null); * bbdi.BBFields.Add("ASK", null); * bbdi.BBFields.Add("PX_CLOSE_DT", null); * bbdis.Add(bbdi); * * bbdi = new BloombergDataInstrument(); * bbdi.ID = 1; * bbdi.Ticker = "RBS LN EQUITY"; * bbdi.SecurityType = "EQUITY"; * bbdi.Type = BloombergDataInstrumentType.Security; * bbdi.BBFields = new Dictionary<string, object>(); * bbdi.BBFields.Add("ID_GAVIN", null); * bbdi.BBFields.Add("PX_LAST", null); * bbdis.Add(bbdi); */ // BloombergData bbd = new BloombergData(new System.Collections.Specialized.StringCollection(), "*****@*****.**", "testing Bloomberg v3 api", ";"); // OR BloombergData bbd = new BloombergData(); bbd.InstrumentCompleteChanged += new BloombergData.InstrumentComplete(bbd_InstrumentCompleteChanged); bbd.PercentCompleteChanged += new BloombergData.PercentComplete(bbd_PercentCompleteChanged); bbd.ProcessCompleted += new BloombergData.ProcessStatus(bbd_ProcessCompleted); bbd.StatusChanged += new BloombergData.StatusUpdate(bbd_StatusChanged); bbd.GetBloombergData(bbdis); }
public void TestForHistory() { List <BloombergDataInstrument> bbdis = new List <BloombergDataInstrument>(); BloombergDataInstrument bbdi = new BloombergDataInstrument(); bbdi.ID = 0; bbdi.Ticker = "EUR001M INDEX"; bbdi.SecurityType = "INDEX"; bbdi.BBFields = new Dictionary <string, BloombergDataInstrumentField>(); bbdi.BBFields.Add("PX_LAST", new BloombergDataInstrumentField("PX_LAST")); bbdis.Add(bbdi); BloombergData bbd = new BloombergData(new System.Collections.Specialized.StringCollection(), "*****@*****.**", "testing Bloomberg v3 api", ";"); bbd.InstrumentCompleteChanged += new BloombergData.InstrumentComplete(bbd_InstrumentCompleteChanged); bbd.PercentCompleteChanged += new BloombergData.PercentComplete(bbd_PercentCompleteChanged); bbd.ProcessCompleted += new BloombergData.ProcessStatus(bbd_ProcessCompleted); bbd.StatusChanged += new BloombergData.StatusUpdate(bbd_StatusChanged); bbd.GetBloombergData(bbdis, DateTime.Today.AddDays(-1)); }