예제 #1
0
        public virtual CommonDataProvider UpdateEod(string Symbol, CommonDataProvider cdpDelta)
        {
            CommonDataProvider cdp = (CommonDataProvider)this[Symbol];

            cdp.Merge(cdpDelta);
            SaveData(Symbol, cdp, false);
            return(cdp);
        }
예제 #2
0
 public CommonDataProvider MergeRealtime(CommonDataProvider cdp, string Code)
 {
     if (cdp != null)
     {
         if (DownloadRealTimeQuote && CacheTimeSpan.Days >= 1)
         {
             DataPacket dp = DataPacket.DownloadFromYahoo(Code);
             cdp.Merge(dp);
             cdp.SetStringData("Name", dp.StockName);
         }
         SetStrings(cdp, Code);
     }
     return(cdp);
 }
예제 #3
0
        /// <summary>
        /// Add new streaming data packet
        /// </summary>
        /// <param name="dp">streaming data packet</param>
        public void AddNewPacket(DataPacket dp)
        {
            string Symbol = dp.Symbol;

            //if code end with =X remove it
            if (Symbol.EndsWith("=X"))
            {
                Symbol = Symbol.Substring(0, Symbol.Length - 2);
            }
            CommonDataProvider cdp = htStreaming[Symbol] as CommonDataProvider;

            if (cdp == null)
            {
                cdp = CommonDataProvider.Empty;
                htStreaming[Symbol] = cdp;
            }
            cdp.Merge(dp);
        }