public ReferenceDataRequestInfo(IEnumerable<string> tickers, IEnumerable<string> fields)
 {
     Id = new CorrelationID();
     Tickers = new List<string>(tickers);
     Fields = new List<string>(fields);
     Response = new ReferenceDataResponse(this);
 }
Пример #2
0
        public void ParseValidRequestTest()
        {
            string referenceDataResponse = "ReferenceDataResponse={}";

            var handler = new BloombergReferenceDataHandlerMock(referenceDataResponse);
            handler.AddField("PX_BID");
            handler.AddSecurity("DE000CZ36U01@CBED CORP");

            var response = new ReferenceDataResponse(handler.RequestInfo);

            var message = new TweakMessage();

            response.SaveMessage(message);

            Assert.AreEqual(1, handler.Fields.Count);
            Assert.AreEqual(1, handler.Tickers.Count);
            Assert.AreEqual(1, response.Fields.Count);
            Assert.AreEqual(1, response.Securities.Count);
        }
Пример #3
0
        public SecurityData(ReferenceDataResponse context, Element securityData)
            : this(context.GetDescription())
        {
            _securityData = securityData;
            Security = _securityData.GetElementAsString("security");
            SequenceNr = _securityData.GetElementAsInt32("sequenceNumber");

            if (_securityData.HasElement("securityError"))
            {
                _securityError = new SecurityError(_securityData.GetElement("securityError"));
            }
            else
            {
                if (_securityData.HasElement("fieldData"))
                {
                    Element _fieldDataArray = _securityData.GetElement("fieldData");
                    for (int i = 0; i < context.Fields.Count; i++)
                    {
                        if (_fieldDataArray.HasElement(context.Fields[i]))
                        {
                            var field = new FieldData(_fieldDataArray.GetElement(context.Fields[i]));
                            Fields[field.Name] = field;
                        }
                    }
                }

                if (_securityData.HasElement("fieldExceptions"))
                {
                    Element _fieldExceptionsArray = _securityData.GetElement("fieldExceptions");
                    for (int i = 0; i < _fieldExceptionsArray.NumValues; i++)
                    {
                        FieldExceptions.Add(new FieldException(_fieldExceptionsArray.GetValueAsElement(i)));
                    }
                }
            }
        }
Пример #4
0
        public SecurityData(ReferenceDataResponse context, Element securityData) :
            this(context.GetDescription())
        {
            _securityData = securityData;
            Security      = _securityData.GetElementAsString("security");
            SequenceNr    = _securityData.GetElementAsInt32("sequenceNumber");

            if (_securityData.HasElement("securityError"))
            {
                _securityError = new SecurityError(_securityData.GetElement("securityError"));
            }
            else
            {
                if (_securityData.HasElement("fieldData"))
                {
                    Element _fieldDataArray = _securityData.GetElement("fieldData");
                    for (int i = 0; i < context.Fields.Count; i++)
                    {
                        if (_fieldDataArray.HasElement(context.Fields[i]))
                        {
                            var field = new FieldData(_fieldDataArray.GetElement(context.Fields[i]));
                            Fields[field.Name] = field;
                        }
                    }
                }

                if (_securityData.HasElement("fieldExceptions"))
                {
                    Element _fieldExceptionsArray = _securityData.GetElement("fieldExceptions");
                    for (int i = 0; i < _fieldExceptionsArray.NumValues; i++)
                    {
                        FieldExceptions.Add(new FieldException(_fieldExceptionsArray.GetValueAsElement(i)));
                    }
                }
            }
        }
Пример #5
0
 public BidAskResponse(ReferenceDataResponse response)
 {
     tickerPriceCollection = new Dictionary<string, PriceInfo>();
     this.response = response;
     ParseResponse();
 }
Пример #6
0
 private void HandleReferenceDataResponse(ReferenceDataResponse obj)
 {
     throw new NotImplementedException();
 }