Beispiel #1
0
        /// <summary>
        /// Static method to create CORREL DataSeries
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="period"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static CORREL Series(DataSeries ds, DataSeries ds1, double period, string name)
        {
            //Build description
            string description = "(" + name + "," + period.ToString() + ")";
            //See if it exists in the cache
            object obj = ds.Cache.Find(description);
            if (obj != null) return (CORREL)obj;

            //application.Data stockData = new application.Data(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"), stockname);
            //DataSeries ds1 = new DataSeries(stockData.Bars, stockname);
            //Create indicator, cache it, return it
            CORREL indicator = new CORREL(ds,ds1, period, description);
            ds.Cache.Add(description, indicator);
            return indicator;
        }
Beispiel #2
0
        /// <summary>
        /// Static method to create CORREL DataSeries
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="period"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static CORREL Series(DataSeries ds, DataSeries ds1, double period, string name)
        {
            //Build description
            string description = "(" + name + "," + period.ToString() + ")";
            //See if it exists in the cache
            object obj = ds.Cache.Find(description);

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

            //application.Data stockData = new application.Data(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"), stockname);
            //DataSeries ds1 = new DataSeries(stockData.Bars, stockname);
            //Create indicator, cache it, return it
            CORREL indicator = new CORREL(ds, ds1, period, description);

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