示例#1
0
        private static void PrintFirstValues(IIndicator indicator, int componentIndex, int countOfValuesToPrint)
        {
            int           firstBar  = indicator.Component[componentIndex].FirstBar;
            IndicatorComp component = indicator.Component[componentIndex];
            var           sb        = new StringBuilder();

            sb.AppendLine("Indicator: " + indicator.IndicatorName);
            sb.AppendLine("Component: " + component.CompName);
            sb.AppendLine();
            sb.AppendLine("bar        value");
            sb.AppendLine("--------------------------");
            for (int bar = firstBar; bar < firstBar + countOfValuesToPrint; bar++)
            {
                sb.AppendLine(bar + "    : " + component.Value[bar]);
            }
            Console.WriteLine(sb.ToString());
        }
示例#2
0
        /// <summary>
        /// Returns a copy.
        /// </summary>
        public IndicatorComp Clone()
        {
            var indicatorComp = new IndicatorComp
            {
                CompName           = CompName,
                DataType           = DataType,
                ChartType          = ChartType,
                ChartColor         = ChartColor,
                FirstBar           = FirstBar,
                UsePreviousBar     = UsePreviousBar,
                ShowInDynInfo      = ShowInDynInfo,
                PosPriceDependence = PosPriceDependence
            };


            if (Value != null)
            {
                indicatorComp.Value = new double[Value.Length];
                Value.CopyTo(indicatorComp.Value, 0);
            }

            return(indicatorComp);
        }
        /// <summary>
        /// Returns a copy.
        /// </summary>
        public IndicatorComp Clone()
        {
            var indicatorComp = new IndicatorComp
            {
                CompName = CompName,
                DataType = DataType,
                ChartType = ChartType,
                ChartColor = ChartColor,
                FirstBar = FirstBar,
                UsePreviousBar = UsePreviousBar,
                ShowInDynInfo = ShowInDynInfo,
                PosPriceDependence = PosPriceDependence
            };

            if (Value != null)
            {
                indicatorComp.Value = new double[Value.Length];
                Value.CopyTo(indicatorComp.Value, 0);
            }

            return indicatorComp;
        }