public void t_Is_Set_To_Default()
        {
            var testParams     = _setups.OneDayTestParams();
            var queryGenerator = new TickDataQueries();
            var response       = queryGenerator.GetTickDataQueries(testParams);
            var BBHist         = new BloombergHistTickDataHandler();

            BBHist.AddDataQueries(response);

            Assert.AreEqual(_setups.serverPort, BBHist.SessionOptions.ServerPort);
        }
        public void Default_Mode_Is_Set_To_Asynchronous()
        {
            var testParams     = _setups.OneDayTestParams();
            var queryGenerator = new TickDataQueries();
            var response       = queryGenerator.GetTickDataQueries(testParams);
            var BBHist         = new BloombergHistTickDataHandler();

            BBHist.AddDataQueries(response);

            Assert.IsTrue(BBHist.Asynchronous);
        }
        public void After_Instance_Creation_TickDataQueries_List_is_Not_Empty()
        {
            var testParams     = _setups.OneDayTestParams();
            var queryGenerator = new TickDataQueries();
            var response       = queryGenerator.GetTickDataQueries(testParams);
            var BBHist         = new BloombergHistTickDataHandler();

            BBHist.AddDataQueries(response);

            Assert.AreNotEqual(0, BBHist.TickDataQueries.Count);
        }
        public void After_Instance_Creation_TickDataQueries_is_Not_Null()
        {
            var testParams     = _setups.OneDayTestParams();
            var queryGenerator = new TickDataQueries();
            var response       = queryGenerator.GetTickDataQueries(testParams);
            var BBHist         = new BloombergHistTickDataHandler();

            BBHist.AddDataQueries(response);

            Assert.IsNotNull(BBHist.TickDataQueries);
        }
        public void DataQueries_List_isNull_Or_Empty_Throws_ArgumentNullException()
        {
            var BBHist = new BloombergHistTickDataHandler();

            BBHist.AddDataQueries(null);
        }
Beispiel #6
0
        private void setUpInsturment(DateTime start, DateTime end, string security, Security.SecurityType secType)
        {
            var sec = new DataFactory(new Security(security, 0, secType));

            _factories.Add(sec);
            _markets.AddSecurity(sec);
            sec.AddReferenceToMarkets(_markets);
            sec.AddReferenceToDatafeed((ITickDataFeed)_histFeed);

            var query = new TickDataQuery()
            {
                Security             = sec.SecurityName,
                CorrelationIdObj     = sec,
                StartDate            = start,
                EndDate              = end,
                IncludeConditionCode = true,
                IncludeExchangeCode  = true
            };

            var queryGenerator = new TickDataQueries();
            var queries        = queryGenerator.GetTickDataQueries(query);
            var queriesPM      = new List <ITickDataQuery>();

            foreach (var q in queries)
            {
                queriesPM.Add(new TickDataQuery()
                {
                    Security             = q.Security,
                    StartDate            = new DateTime(q.EndDate.Year, q.EndDate.Month, q.EndDate.Day, 7, 15, 00),
                    EndDate              = new DateTime(q.EndDate.Year, q.EndDate.Month, q.EndDate.Day, 18, 20, 00),
                    Fields               = q.Fields,
                    CorrelationIdObj     = q.CorrelationIdObj,
                    IncludeConditionCode = q.IncludeConditionCode,
                    IncludeExchangeCode  = q.IncludeExchangeCode,
                });

                //q.StartDate = q.StartDate.AddHours(-1);
                q.EndDate = new DateTime(q.EndDate.Year, q.EndDate.Month, q.EndDate.Day, 6, 20, 00);
            }


            if (useBB)
            {
                // Historical playback From Bloomberg
                var histBBTickData = new BloombergHistTickDataHandler();
                histBBTickData.BBHTDUpdate += histTickData_Update;

                histBBTickData.AddDataQueries(queries);
                histBBTickData.AddDataQueries(queriesPM);

                histBBTickData.DataHandler = _histFeed;
                _histFeed.AddHistoricalAdapter(histBBTickData);
            }
            else
            {
                // Historical playback from SQL DB
                const string dsPath = "TickData.qbd";

                var histTickData = new HistoricalData.HistoricalAdapterSqlDB(dsPath);
                histTickData.HistTDUpdate += histTickData_Update;

                histTickData.AddDataQueries(queries);
                //histTickData.AddDataQueries(queriesPM);

                histTickData.DataHandler = _histFeed;
                _histFeed.AddHistoricalAdapter(histTickData);
            }



            responded.Add(security, false);
        }