Exemplo n.º 1
0
        /// <summary>
        /// The default constructor
        /// </summary>
        public Indicator()
        {
            indicatorName = string.Empty;
            PossibleSlots = SlotTypes.NotDefined;
            SeparatedChart = false;
            SeparatedChartMinValue = double.MaxValue;
            SeparatedChartMaxValue = double.MinValue;
            IsDiscreteValues = false;
            CustomIndicator = false;
            LoaddedFromDll = false;
            WarningMessage = string.Empty;
            AllowClosingFilters = false;

            SpecialValues = new double[] { };
            IndParam = new IndicatorParam();
            Component = new IndicatorComp[] { };

            IsBacktester = false;
            IsGeneratable = true;

            ExitFilterShortDescription = "Not defined";
            EntryFilterShortDescription = "Not defined";
            ExitFilterLongDescription = "Not defined";
            EntryFilterLongDescription = "Not defined";
            ExitPointShortDescription = "Not defined";
            ExitPointLongDescription = "Not defined";
            EntryPointShortDescription = "Not defined";
            EntryPointLongDescription = "Not defined";
        }
        /// <summary>
        ///     Returns a copy
        /// </summary>
        public IndicatorParam Clone()
        {
            var indicatorParam = new IndicatorParam
                {
                    SlotNumber = SlotNumber,
                    IsDefined = IsDefined,
                    SlotType = SlotType,
                    IndicatorName = IndicatorName,
                    IndicatorType = IndicatorType,
                    ExecutionTime = ExecutionTime,
                    ListParam = new ListParam[5],
                    NumParam = new NumericParam[6],
                    CheckParam = new CheckParam[2]
                };

            for (int i = 0; i < 5; i++)
                indicatorParam.ListParam[i] = ListParam[i].Clone();

            for (int i = 0; i < 6; i++)
                indicatorParam.NumParam[i] = NumParam[i].Clone();

            for (int i = 0; i < 2; i++)
                indicatorParam.CheckParam[i] = CheckParam[i].Clone();

            return indicatorParam;
        }