コード例 #1
0
        /// <summary>
        /// Static method to create ADOSC DataSeries
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="fastPeriod"></param>
        /// <param name="slowPeriod"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static ADOSC Series(DataBars ds, double fastPeriod, double slowPeriod, string name)
        {
            //Build description
            string description = "(" + name + "," + fastPeriod.ToString() + "," + slowPeriod.ToString() + ")";

            //See if it exists in the cache
            object obj = ds.Cache.Find(description);

            if (obj != null)
            {
                return((ADOSC)obj);
            }

            //Create ADOSC, cache it, return it
            ADOSC adosc = new ADOSC(ds, fastPeriod, slowPeriod, description);

            ds.Cache.Add(description, adosc);
            return(adosc);
        }
コード例 #2
0
ファイル: AD.cs プロジェクト: oghenez/trade-software
        /// <summary>
        /// Static method to create ADOSC DataSeries
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="fastPeriod"></param>
        /// <param name="slowPeriod"></param>
        /// <param name="name"></param>
        /// <returns></returns>       
        public static ADOSC Series(DataBars ds, double fastPeriod, double slowPeriod, string name)
        {
            //Build description
            string description = "(" + name + "," + fastPeriod.ToString() + "," + slowPeriod.ToString() + ")";

            //See if it exists in the cache
            object obj = ds.Cache.Find(description);
            if (obj != null) return (ADOSC)obj;

            //Create ADOSC, cache it, return it
            ADOSC adosc = new ADOSC(ds, fastPeriod, slowPeriod, description);
            ds.Cache.Add(description, adosc);
            return adosc;
        }