示例#1
0
        public void externalData()
        { // throws exception
            IIndicator <decimal> xlsClose = new ClosePriceIndicator(xls.getSeries());
            IIndicator <decimal> actualIndicator;

            actualIndicator = getIndicator(xlsClose, 1);
            //  Assert.AreEqual(xls.getIndicator(1), actualIndicator);
            Assert.AreEqual(329.0M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(xlsClose, 3);
            //Assert.AreEqual(xls.getIndicator(3), actualIndicator);
            Assert.AreEqual(326.63333333333333333333333333M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(xlsClose, 13);
            //Assert.AreEqual(xls.getIndicator(13), actualIndicator);
            Assert.AreEqual(327.78461538461538461538461538M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));
        }
示例#2
0
        public void testAgainstExternalData()
        { // throws exception
            IIndicator <decimal> xlsClose = new ClosePriceIndicator(xls.getSeries());
            IIndicator <decimal> actualIndicator;

            actualIndicator = getIndicator(xlsClose, 1);
            //Assert.AreEqual(xls.getIndicator(1), actualIndicator);
            Assert.AreEqual(329.0M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(xlsClose, 3);
            //Assert.AreEqual(xls.getIndicator(3), actualIndicator);
            Assert.AreEqual(327.29004419236330590585252094M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(xlsClose, 13);
            //Assert.AreEqual(xls.getIndicator(13), actualIndicator);
            Assert.AreEqual(326.96964401585614734632198306M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));
        }
示例#3
0
        public void xlsTest()
        {
            ITimeSeries          xlsSeries = xls.getSeries();
            IIndicator <decimal> indicator;

            indicator = getIndicator(xlsSeries, 1);
            // Assert.AreEqual(xls.getIndicator(1), indicator);
            Assert.AreEqual(0.0M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(xlsSeries, 3);
            // Assert.AreEqual(xls.getIndicator(3), indicator);
            Assert.AreEqual(21.071139534914776853878480510M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(xlsSeries, 13);
            // Assert.AreEqual(xls.getIndicator(13), indicator);
            Assert.AreEqual(20.902069300832188108447493710M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));
        }
示例#4
0
        public void externalData()
        {
            ITimeSeries          series = xls.getSeries();
            IIndicator <decimal> actualIndicator;

            actualIndicator = getIndicator(series, 1, 1);
            // Assert.AreEqual(xls.getIndicator(1, 1), actualIndicator);
            Assert.AreEqual(100.0M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(series, 3, 2);
            // Assert.AreEqual(xls.getIndicator(3, 2), actualIndicator);
            Assert.AreEqual(12.133072686370729785734629677M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(series, 13, 8);
            // Assert.AreEqual(xls.getIndicator(13, 8), actualIndicator);
            Assert.AreEqual(7.3884961797389535319097127910M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));
        }
示例#5
0
        public void testAgainstExternalData()
        {
            ITimeSeries          xlsSeries = xls.getSeries();
            IIndicator <decimal> actualIndicator;

            actualIndicator = getIndicator(xlsSeries, 1);
            //Assert.AreEqual(xls.getIndicator(1), actualIndicator);
            Assert.AreEqual(12.5M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(xlsSeries, 3);
            //Assert.AreEqual(xls.getIndicator(3), actualIndicator);
            Assert.AreEqual(22.840736332341023561757798130M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));

            actualIndicator = getIndicator(xlsSeries, 13);
            //Assert.AreEqual(xls.getIndicator(13), actualIndicator);
            Assert.AreEqual(22.139926766247087657408399960M, actualIndicator.GetValue(actualIndicator.TimeSeries.GetEndIndex()));
        }
示例#6
0
        public void xlsTest()
        {
            IIndicator <decimal> xlsClose = new ClosePriceIndicator(xls.getSeries());
            IIndicator <decimal> indicator;

            indicator = getIndicator(xlsClose, 1);
            //  Assert.AreEqual(xls.getIndicator(1), indicator);
            Assert.AreEqual(100.0M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(xlsClose, 3);
            //  Assert.AreEqual(xls.getIndicator(3), indicator);
            Assert.AreEqual(67.045374582390542029793809567M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(xlsClose, 13);
            //  Assert.AreEqual(xls.getIndicator(13), indicator);
            Assert.AreEqual(52.587681858903097357018319486M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));
        }
示例#7
0
        public void externalData()
        { // throws exception
            ITimeSeries          xlsSeries  = xls.getSeries();
            IIndicator <decimal> closePrice = new ClosePriceIndicator(xlsSeries);
            IIndicator <decimal> indicator;

            indicator = getIndicator(closePrice, 1);
            //  Assert.AreEqual(xls.getIndicator(1), indicator);
            Assert.AreEqual(329.0M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(closePrice, 3);
            //   Assert.AreEqual(xls.getIndicator(3), indicator);
            Assert.AreEqual(327.77484966230713293966586844M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(closePrice, 13);
            //   Assert.AreEqual(xls.getIndicator(13), indicator);
            Assert.AreEqual(327.40768441383635668538339921M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));
        }
示例#8
0
        public void testXls()
        { // throws exception
            ITimeSeries          xlsSeries = xls.getSeries();
            IIndicator <decimal> indicator;

            indicator = getIndicator(xlsSeries, 1);
            var x = xls.getIndicator(1);

            //Assert.AreEqual(xls.getIndicator(1), indicator);
            Assert.AreEqual(4.8M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(xlsSeries, 3);
            //  Assert.AreEqual(xls.getIndicator(3), indicator);
            Assert.AreEqual(7.4225453774091577325485045875M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));

            indicator = getIndicator(xlsSeries, 13);
            // Assert.AreEqual(xls.getIndicator(13), indicator);
            Assert.AreEqual(8.808250018233967850897443076M, indicator.GetValue(indicator.TimeSeries.GetEndIndex()));
        }