Exemple #1
0
        private IAppRTBSynchronizer getSynchronizer_for_updatePreMergeRTBarSeries()
        {
            Series <DateTime, MarketDataElement> preMergeRTBarSeries   = null;
            Series <DateTime, MarketDataElement> preMergeHistBarSeries = null;
            Series <DateTime, MarketDataElement> TimeBarSeries         = null;

            DateTime RTBTime1 = new DateTime(2015, 10, 21, 9, 20, 0, DateTimeKind.Local);
            DateTime RTBTime2 = new DateTime(2015, 10, 21, 9, 21, 0, DateTimeKind.Local);
            DateTime RTBTime3 = new DateTime(2015, 10, 21, 9, 22, 0, DateTimeKind.Local);

            preMergeRTBarSeries = addMarketDataElementWithTimeOnlyToSeries(RTBTime1, preMergeRTBarSeries);
            preMergeRTBarSeries = addMarketDataElementWithTimeOnlyToSeries(RTBTime2, preMergeRTBarSeries);
            preMergeRTBarSeries = addMarketDataElementWithTimeOnlyToSeries(RTBTime3, preMergeRTBarSeries);

            AppMDManager appMDManager = new AppMDManager(null);

            appMDManager.setTimeBarSeries(TimeBarSeries);
            appMDManager.setRtbDataStartTime(RTBTime1);

            IAppRTBSynchronizer synchronizer = appMDManager.getAppRTBSynchronizer();

            synchronizer.preMergeHistBarSeries = preMergeHistBarSeries;
            synchronizer.preMergeRTBarSeries   = preMergeRTBarSeries;
            synchronizer.setNeedMergeFlag(true);
            synchronizer.setIsDataMerged(false);
            return(synchronizer);
        }
Exemple #2
0
        AppMDManager createManager_updateRTBarSeriesActions_cont_negative(DateTime dt1, DateTime dt2)
        {
            RTDataBar currentCompleteBar = null;
            Series <DateTime, MarketDataElement> series = null;

            series = addMarketDataElementWithTimeOnlyToSeries(dt1, series);
            AppMDManager appMDManager = new AppMDManager(null);

            appMDManager.currentCompleteRTBar = currentCompleteBar;
            appMDManager.currentTempRTBar     = null;
            appMDManager.setTimeBarSeries(series);
            return(appMDManager);
        }
Exemple #3
0
        public void test_isDataReady_positive2()
        {
            DateTime time1 = new DateTime(2015, 10, 21, 10, 0, 5, DateTimeKind.Local);
            //[Test: non-syn action and data ready case, synchronizer.getIsDataMerged is false, synchronizer.getNeedMergeFlag is false, Timeseries is not null.]
            Series <DateTime, MarketDataElement> TimeSeries = null;

            TimeSeries = addMarketDataElementWithTimeOnlyToSeries(time1, TimeSeries);

            IAppRTBSynchronizer synchronizer = getAppRTBSynchronizer_for_isDataReady_positive2();
            AppMDManager        appMDManager = new AppMDManager(null);

            appMDManager.injectAppRTBSynchronizer(synchronizer);
            appMDManager.setTimeBarSeries(TimeSeries);
            Assert.IsTrue(appMDManager.isDataReady());
        }
Exemple #4
0
        private IAppRTBSynchronizer getSynchronizer_for_mergeRTBHistDataIfValid_positive3()
        {
            Series <DateTime, MarketDataElement> preMergeRTBarSeries   = null;
            Series <DateTime, MarketDataElement> preMergeHistBarSeries = null;
            Series <DateTime, MarketDataElement> TimeBarSeries         = null;

            DateTime histTime1 = new DateTime(2015, 10, 21, 9, 15, 0, DateTimeKind.Local);
            DateTime histTime2 = new DateTime(2015, 10, 21, 9, 16, 0, DateTimeKind.Local);
            DateTime histTime3 = new DateTime(2015, 10, 21, 9, 17, 0, DateTimeKind.Local);
            DateTime histTime4 = new DateTime(2015, 10, 21, 9, 18, 0, DateTimeKind.Local);
            DateTime histTime5 = new DateTime(2015, 10, 21, 9, 21, 0, DateTimeKind.Local);
            DateTime histTime6 = new DateTime(2015, 10, 21, 9, 22, 0, DateTimeKind.Local);
            DateTime histTime7 = new DateTime(2015, 10, 21, 9, 23, 0, DateTimeKind.Local);
            DateTime histTime8 = new DateTime(2015, 10, 21, 9, 24, 0, DateTimeKind.Local);

            DateTime RTBTime1 = new DateTime(2015, 10, 21, 9, 24, 0, DateTimeKind.Local);
            DateTime RTBTime2 = new DateTime(2015, 10, 21, 9, 25, 0, DateTimeKind.Local);
            DateTime RTBTime3 = new DateTime(2015, 10, 21, 9, 26, 0, DateTimeKind.Local);


            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime1, preMergeHistBarSeries);
            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime2, preMergeHistBarSeries);
            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime3, preMergeHistBarSeries);
            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime4, preMergeHistBarSeries);
            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime5, preMergeHistBarSeries);
            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime6, preMergeHistBarSeries);
            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime7, preMergeHistBarSeries);
            preMergeHistBarSeries = addMarketDataElementWithTimeOnlyToSeries(histTime8, preMergeHistBarSeries);

            preMergeRTBarSeries = addMarketDataElementWithTimeOnlyToSeries(RTBTime1, preMergeRTBarSeries);
            preMergeRTBarSeries = addMarketDataElementWithTimeOnlyToSeries(RTBTime2, preMergeRTBarSeries);
            preMergeRTBarSeries = addMarketDataElementWithTimeOnlyToSeries(RTBTime3, preMergeRTBarSeries);

            AppMDManager appMDManager = new AppMDManager(null);

            appMDManager.setTimeBarSeries(TimeBarSeries);
            appMDManager.setRtbDataStartTime(RTBTime1);
            appMDManager.setHistDataEndTime(histTime7);
            IAppRTBSynchronizer synchronizer = appMDManager.getAppRTBSynchronizer();

            synchronizer.preMergeHistBarSeries = preMergeHistBarSeries;
            synchronizer.preMergeRTBarSeries   = preMergeRTBarSeries;
            synchronizer.setNeedMergeFlag(true);
            synchronizer.setIsDataMerged(false);
            return(synchronizer);
        }
Exemple #5
0
        AppMDManager createManager_updateRTBarSeriesActions_cont(DateTime dt1, DateTime dt2)
        {
            RTDataBar currentCompleteBar = new RTDataBar();

            currentCompleteBar.time   = dt2;
            currentCompleteBar.open   = 20100;
            currentCompleteBar.close  = 20100;
            currentCompleteBar.high   = 20200;
            currentCompleteBar.low    = 20000;
            currentCompleteBar.volume = 500;

            Series <DateTime, MarketDataElement> series = null;

            series = addMarketDataElementWithTimeOnlyToSeries(dt1, series);
            AppMDManager appMDManager = new AppMDManager(null);

            appMDManager.currentCompleteRTBar = currentCompleteBar;
            appMDManager.currentTempRTBar     = null;
            appMDManager.setTimeBarSeries(series);
            return(appMDManager);
        }