Example #1
0
        ///// <summary>
        ///// 临时添加的数据处理,删除掉数据库内错误的日线数据。
        ///// 删除已经停牌,但是记录了日线的数据。
        ///// </summary>
        ///// <param name="stockCode"></param>
        //private void DeleteNotOpenedDay1(string stockCode)
        //{
        //    try
        //    {
        //        var kLines = _saveDataService.Get(KLineType.Day, stockCode, new DateTime(2016, 1, 1), DateTime.Now)
        //            .Where(p => p.Open - 0 < 0.000001);
        //        _saveDataService.Delete(KLineType.Day, stockCode, kLines);
        //    }
        //    catch(Exception ex)
        //    {
        //        LogHelper.Logger.WriteLine(string.Format("DeleteNotOpenedDay1 [{0}] data error.", stockCode), this.ServiceName);
        //        LogHelper.Logger.WriteLine(ex.ToString(), this.ServiceName);
        //    }
        //}
        private void HandleWmCloudDay1(string stockCode)
        {
            try
            {
                StockKLineApi wmcloudApi = new StockKLineApi();
                var kLines = wmcloudApi.GetKLineFromWmcloudApi(stockCode);

                if(kLines != null)
                {
                    SaveIfNotExist(KLineType.Day, stockCode, kLines);
                }
            }
            catch(Exception ex)
            {
                LogHelper.Logger.WriteLine(string.Format("HandleWmCloudDay1 [{0}] data error.", stockCode), this.ServiceName);
                LogHelper.Logger.WriteLine(ex.ToString(), this.ServiceName);
            }
        }
Example #2
0
 public void WmcloudKLineMultipleDataTest1()
 {
     StockKLineApi reader = new StockKLineApi();
     List<StockKLine> datas = reader.GetKLineFromWmcloudApi("166105");
     Assert.IsNull(datas);
 }