예제 #1
0
        private void ProcessReferenceDataResponse(Bloomberglp.Blpapi.Message argvMessage)
        {
            Bloomberglp.Blpapi.Element tElementMsg  = argvMessage.AsElement;
            string[] tTargetAttributes              = mOtherRequestByCorrelationId[argvMessage.CorrelationID.Value].GetFieldList();
            System.Data.DataTable  tExtractedValues = this.ExtractValueByName(tElementMsg, tTargetAttributes);
            System.Data.DataColumn tNewColumn       = new System.Data.DataColumn("SECURITY");
            tNewColumn.DefaultValue = mOtherRequestByCorrelationId[argvMessage.CorrelationID.Value].mTicker;
            tExtractedValues.Columns.Add(tNewColumn);
            tNewColumn.SetOrdinal(0);
            InterfaceEventArgs tRetData = new InterfaceEventArgs(InterfaceEventArgs.xBbgMsgType.ReferenceDataResponse);

            tRetData.mData = tExtractedValues;
            mBbgMsgEvent(this, tRetData);
        }
예제 #2
0
        private void ProcessSubscriptionData(Bloomberglp.Blpapi.Event argEvent)
        {
            foreach (Bloomberglp.Blpapi.Message tMsg in argEvent)
            {
                Bloomberglp.Blpapi.Element tElementMsg  = tMsg.AsElement;
                string[] tTargetAttributes              = mSubscriptionByCorrelationId[tMsg.CorrelationID.Value].GetFieldList();
                System.Data.DataTable  tExtractedValues = this.ExtractValueByName(tElementMsg, tTargetAttributes);
                System.Data.DataColumn tNewColumn       = new System.Data.DataColumn("SECURITY");
                tNewColumn.DefaultValue = tMsg.TopicName;
                tExtractedValues.Columns.Add(tNewColumn);
                tNewColumn.SetOrdinal(0);
                //mOutput.PrintDataTable(tExtractedValues);

                if (tExtractedValues.Rows.Count == 1)
                {
                    mMarketData[tMsg.CorrelationID.Value].UpdateMarketData(tExtractedValues);
                    InterfaceEventArgs tArgs = new InterfaceEventArgs(InterfaceEventArgs.xBbgMsgType.SubscriptionResponse);
                    tArgs.mCorrelationId = tMsg.CorrelationID.Value;
                    tArgs.mData          = tExtractedValues;
                    mBbgMsgEvent(this, tArgs);
                }
            }
        }
예제 #3
0
        private void ProcessIntradayBarResponse(Bloomberglp.Blpapi.Message argvMessage)
        {
            if (mIntradayBarRequestByCorrelationId.ContainsKey(argvMessage.CorrelationID.Value))
            {
                string tTicker = mIntradayBarRequestByCorrelationId[argvMessage.CorrelationID.Value].mTicker;
                Bloomberglp.Blpapi.Element tElementMsg      = argvMessage.AsElement;
                System.Data.DataTable      tExtractedValues = this.ExtractValueByName(tElementMsg, mIntradayBarResponseDefaultAttributes);
                System.Data.DataColumn     tNewColumn       = new System.Data.DataColumn("SECURITY");
                tNewColumn.DefaultValue = tTicker;
                tExtractedValues.Columns.Add(tNewColumn);
                tNewColumn.SetOrdinal(0);
                mOutput.PrintDataTable(tExtractedValues);

                InterfaceEventArgs tEventArgvs = new InterfaceEventArgs(InterfaceEventArgs.xBbgMsgType.IntradayBarResponse);
                tEventArgvs.mData = tExtractedValues;
                mBbgMsgEvent(this, tEventArgvs);
            }
            else
            {
                InterfaceEventArgs tArgs = new InterfaceEventArgs(InterfaceEventArgs.xBbgMsgType.Error);
                tArgs.mMsg = "Unknown intraday bar response. Correlation ID: " + argvMessage.CorrelationID.Value + ". Won't parse the message.";
                mBbgMsgEvent(this, tArgs);
            }
        }