public void test_isThisMessageStartOfMinute()
        {
            IBMessage message = createStartOfMinuteMessage();

            Assert.AreEqual(true, MarketDataUtil.isThisMessageStartOfMinute(message));

            message = createEndOfMinuteMessage();
            Assert.AreEqual(false, MarketDataUtil.isThisMessageStartOfMinute(message));
        }
        public static MarketDataElement convertBarToMarketDataElement(RTDataBar bar)
        {
            double            h              = bar.high;
            double            l              = bar.low;
            double            o              = bar.open;
            double            c              = bar.close;
            double            vol            = bar.volume;
            DateTime          time           = bar.time;
            MarketDataElement currentHsiData = createHLOC(time, "HLOC", "HSI", "FUT");

            currentHsiData.volume = vol;
            currentHsiData.time   = time;
            MarketDataUtil.setHLOC(currentHsiData, h, l, o, c);
            return(currentHsiData);
        }
        public void test_convertBarToMarketDataElement()
        {
            RTDataBar RTBar = new RTDataBar();

            RTBar.high   = 20200;
            RTBar.open   = 20100;
            RTBar.low    = 20000;
            RTBar.close  = 20150;
            RTBar.volume = 99999;
            RTBar.time   = new DateTime(2015, 10, 21, 9, 49, 0);
            MarketDataElement element = MarketDataUtil.convertBarToMarketDataElement(RTBar);

            Assert.AreEqual(RTBar.high, element.high);
            Assert.AreEqual(RTBar.low, element.low);
            Assert.AreEqual(RTBar.open, element.open);
            Assert.AreEqual(RTBar.close, element.close);
            Assert.AreEqual(RTBar.volume, element.volume);
            Assert.AreEqual(RTBar.time, element.time);
        }