Example #1
0
        /// <summary>
        /// Static method to create APO DataSeries
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="period"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static APO Series(DataSeries ds, double fastperiod, double slowperiod, double matype, string name)
        {
            //Build description
            string description = "(" + name + fastperiod.ToString()+","+slowperiod.ToString()+","+matype.ToString() + ")";

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

            //Create indicator, cache it, return it
            APO indicator = new APO(ds, fastperiod,slowperiod,matype,description);
            ds.Cache.Add(description, indicator);
            return indicator;              
        }
Example #2
0
        /// <summary>
        /// Static method to create APO DataSeries
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="period"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static APO Series(DataSeries ds, double fastperiod, double slowperiod, double matype, string name)
        {
            //Build description
            string description = "(" + name + fastperiod.ToString() + "," + slowperiod.ToString() + "," + matype.ToString() + ")";

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

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

            //Create indicator, cache it, return it
            APO indicator = new APO(ds, fastperiod, slowperiod, matype, description);

            ds.Cache.Add(description, indicator);
            return(indicator);
        }