当前位置: 首页>>代码示例>>C#>>正文


C# DataReader.GetDaylineData方法代码示例

本文整理汇总了C#中DataReader.GetDaylineData方法的典型用法代码示例。如果您正苦于以下问题:C# DataReader.GetDaylineData方法的具体用法?C# DataReader.GetDaylineData怎么用?C# DataReader.GetDaylineData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataReader的用法示例。


在下文中一共展示了DataReader.GetDaylineData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetDayLineTest

 public void GetDayLineTest()
 {
     DataReader dataReader = new DataReader();
     dataReader.AnalyseDayLineFiles(new[] { TestData.ShanghaiDay, TestData.ShenzhenDay });
     IKlineData klineData = dataReader.GetDaylineData("432534", DateTime.MinValue);
     Assert.IsNull(klineData);
 }
开发者ID:philfanzhou,项目名称:PredictFuture,代码行数:7,代码来源:DayLineTest.cs

示例2: GetKlineDataTest2

        public void GetKlineDataTest2()
        {
            DataReader dataReader = new DataReader();
            dataReader.AnalyseDayLineFiles(new[] { TestData.ShanghaiDay, TestData.ShenzhenDay });
            IKlineData klineData = dataReader.GetDaylineData("1A0001", DateTime.MinValue);

            Assert.AreEqual("1A0001", klineData.Symbol);
            List<IKlineItem> kLineitems = klineData.Items.ToList();

            IKlineItem data20121225 = kLineitems[0];
            Assert.AreEqual(114873959000.0, data20121225.Amount);
            Assert.AreEqual(2213.61, data20121225.Close);
            Assert.AreEqual(new DateTime(2012, 12, 25), data20121225.Date);
            Assert.AreEqual(2220.263, data20121225.High);
            Assert.AreEqual(2146.862, data20121225.Low);
            Assert.AreEqual(2154.32, data20121225.Open);
            Assert.AreEqual(0.0, data20121225.Turnover);
            Assert.AreEqual(14332770000.0, data20121225.Volume);

            IKlineItem data20130104 = kLineitems[5];
            Assert.AreEqual(114627763000.0, data20130104.Amount);
            Assert.AreEqual(2276.992, data20130104.Close);
            Assert.AreEqual(new DateTime(2013, 1, 4), data20130104.Date);
            Assert.AreEqual(2296.112, data20130104.High);
            Assert.AreEqual(2256.56, data20130104.Low);
            Assert.AreEqual(2289.51, data20130104.Open);
            Assert.AreEqual(0.0, data20130104.Turnover);
            Assert.AreEqual(13946993000.0, data20130104.Volume);

            IKlineItem data20130117 = kLineitems[14];
            Assert.AreEqual(103214052000.0, data20130117.Amount);
            Assert.AreEqual(2284.909, data20130117.Close);
            Assert.AreEqual(new DateTime(2013, 1, 17), data20130117.Date);
            Assert.AreEqual(2305.601, data20130117.High);
            Assert.AreEqual(2275.877, data20130117.Low);
            Assert.AreEqual(2305.139, data20130117.Open);
            Assert.AreEqual(0.0, data20130117.Turnover);
            Assert.AreEqual(11910183500.0, data20130117.Volume);

            klineData = dataReader.GetDaylineData("002176", DateTime.MinValue);
            Assert.AreEqual("002176", klineData.Symbol);
            kLineitems = klineData.Items.ToList();

            IKlineItem data20130423 = kLineitems[1];
            Assert.AreEqual(58835558, data20130423.Amount);
            Assert.AreEqual(8.63, data20130423.Close);
            Assert.AreEqual(new DateTime(2013, 4, 23), data20130423.Date);
            Assert.AreEqual(9.13, data20130423.High);
            Assert.AreEqual(8.61, data20130423.Low);
            Assert.AreEqual(9.12, data20130423.Open);
            Assert.AreEqual(0.0, data20130423.Turnover);
            Assert.AreEqual(6671219.0, data20130423.Volume);
        }
开发者ID:philfanzhou,项目名称:PredictFuture,代码行数:53,代码来源:DayLineTest.cs

示例3: GetKlineDataTest1

        public void GetKlineDataTest1()
        {
            DataReader dataReader = new DataReader();
            dataReader.AnalyseDayLineFiles(new[] { TestData.ShanghaiDay, TestData.ShenzhenDay });
            IKlineData klineData = dataReader.GetDaylineData("600036", DateTime.MinValue);

            Assert.AreEqual("600036", klineData.Symbol);
            List<IKlineItem> kLineItems = klineData.Items.ToList();

            IKlineItem data20130422 = kLineItems[0];
            Assert.AreEqual(742446960.0, data20130422.Amount);
            Assert.AreEqual(12.59, data20130422.Close);
            Assert.AreEqual(new DateTime(2013, 4, 22), data20130422.Date);
            Assert.AreEqual(12.64, data20130422.High);
            Assert.AreEqual(12.52, data20130422.Low);
            Assert.AreEqual(12.53, data20130422.Open);
            Assert.AreEqual(0.0, data20130422.Turnover);
            Assert.AreEqual(59032937.0, data20130422.Volume);

            IKlineItem data20130502 = kLineItems[5];
            Assert.AreEqual(565173920.0, data20130502.Amount);
            Assert.AreEqual(12.1, data20130502.Close);
            Assert.AreEqual(new DateTime(2013, 5, 2), data20130502.Date);
            Assert.AreEqual(12.12, data20130502.High);
            Assert.AreEqual(11.95, data20130502.Low);
            Assert.AreEqual(12.1, data20130502.Open);
            Assert.AreEqual(0.0, data20130502.Turnover);
            Assert.AreEqual(46973420.0, data20130502.Volume);

            IKlineItem data20130515 = kLineItems[14];
            Assert.AreEqual(1476330800.0, data20130515.Amount);
            Assert.AreEqual(13.59, data20130515.Close);
            Assert.AreEqual(new DateTime(2013, 5, 15), data20130515.Date);
            Assert.AreEqual(13.65, data20130515.High);
            Assert.AreEqual(13.25, data20130515.Low);
            Assert.AreEqual(13.32, data20130515.Open);
            Assert.AreEqual(0.0, data20130515.Turnover);
            Assert.AreEqual(109663142.0, data20130515.Volume);
        }
开发者ID:philfanzhou,项目名称:PredictFuture,代码行数:39,代码来源:DayLineTest.cs


注:本文中的DataReader.GetDaylineData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。