示例#1
0
 protected static baseSMA CreateSeries(DataSeries ds, Types type, int period, string name)
 {
     //Build description
     string description = "(" + name + "," + period + ")";
     //See if it exists in the cache
     if (ds.Cache.ContainsKey(description))
         return (baseSMA)ds.Cache[description];
     //Create SMA, cache it, return it
     baseSMA sma = new baseSMA(ds, type, period, description);
     ds.Cache[description] = sma;
     return sma;
 }
示例#2
0
        protected static baseSMA CreateSeries(DataSeries ds, Types type, int period, string name)
        {
            //Build description
            string description = "(" + name + "," + period + ")";

            //See if it exists in the cache
            if (ds.Cache.ContainsKey(description))
            {
                return((baseSMA)ds.Cache[description]);
            }
            //Create SMA, cache it, return it
            baseSMA sma = new baseSMA(ds, type, period, description);

            ds.Cache[description] = sma;
            return(sma);
        }