示例#1
0
文件: SmartStorage.cs 项目: ifzz/FDK
        public HistoryInfo GetBarsInfo(string symbol, PriceType priceType, BarPeriod period)
        {
            try
            {
                var source = this.GetRemoteOrLocalSource(symbol);
                var periodicity = StorageConvert.ToPeriodicity(period);
                var priceTypeEx = StorageConvert.ToFxPriceType(priceType);
                var info = source.GetBarsHistoryInfo(symbol, periodicity, priceTypeEx);

                var result = new HistoryInfo(info.AvailableFrom.Value, info.AvailableTo.Value);
                return result;
            }
            catch (StorageHistoryNotFoundException ex)
            {
                throw new HistoryNotFoundException("GetBarsInfo", ex);
            }
        }
示例#2
0
文件: SmartStorage.cs 项目: ifzz/FDK
 public HistoryInfo GetQuotesInfo(string symbol, int depth)
 {
     try
     {
         var source = this.GetRemoteOrLocalSource(symbol);
         var isLevel2 = depth != 1;
         var info = source.GetTicksHistoryInfo(symbol, isLevel2);
         var result = new HistoryInfo(info.AvailableFrom.Value, info.AvailableTo.Value);
         return result;
     }
     catch (StorageHistoryNotFoundException ex)
     {
         throw new HistoryNotFoundException("GetQuotesInfo", ex);
     }
 }