コード例 #1
0
        /// <summary>
        /// Woodies variation of the CCI.
        /// </summary>
        /// <returns></returns>
        public WoodiesCCI WoodiesCCI(Data.IDataSeries input, int chopIndicatorWidth, int neutralBars, int period, int periodEma, int periodLinReg, int periodTurbo, int sideWinderLimit0, int sideWinderLimit1, int sideWinderWidth)
        {
            checkWoodiesCCI.ChopIndicatorWidth = chopIndicatorWidth;
            chopIndicatorWidth          = checkWoodiesCCI.ChopIndicatorWidth;
            checkWoodiesCCI.NeutralBars = neutralBars;
            neutralBars            = checkWoodiesCCI.NeutralBars;
            checkWoodiesCCI.Period = period;
            period = checkWoodiesCCI.Period;
            checkWoodiesCCI.PeriodEma = periodEma;
            periodEma = checkWoodiesCCI.PeriodEma;
            checkWoodiesCCI.PeriodLinReg = periodLinReg;
            periodLinReg = checkWoodiesCCI.PeriodLinReg;
            checkWoodiesCCI.PeriodTurbo = periodTurbo;
            periodTurbo = checkWoodiesCCI.PeriodTurbo;
            checkWoodiesCCI.SideWinderLimit0 = sideWinderLimit0;
            sideWinderLimit0 = checkWoodiesCCI.SideWinderLimit0;
            checkWoodiesCCI.SideWinderLimit1 = sideWinderLimit1;
            sideWinderLimit1 = checkWoodiesCCI.SideWinderLimit1;
            checkWoodiesCCI.SideWinderWidth = sideWinderWidth;
            sideWinderWidth = checkWoodiesCCI.SideWinderWidth;

            if (cacheWoodiesCCI != null)
            {
                for (int idx = 0; idx < cacheWoodiesCCI.Length; idx++)
                {
                    if (cacheWoodiesCCI[idx].ChopIndicatorWidth == chopIndicatorWidth && cacheWoodiesCCI[idx].NeutralBars == neutralBars && cacheWoodiesCCI[idx].Period == period && cacheWoodiesCCI[idx].PeriodEma == periodEma && cacheWoodiesCCI[idx].PeriodLinReg == periodLinReg && cacheWoodiesCCI[idx].PeriodTurbo == periodTurbo && cacheWoodiesCCI[idx].SideWinderLimit0 == sideWinderLimit0 && cacheWoodiesCCI[idx].SideWinderLimit1 == sideWinderLimit1 && cacheWoodiesCCI[idx].SideWinderWidth == sideWinderWidth && cacheWoodiesCCI[idx].EqualsInput(input))
                    {
                        return(cacheWoodiesCCI[idx]);
                    }
                }
            }

            WoodiesCCI indicator = new WoodiesCCI();

            indicator.SetUp();
            indicator.CalculateOnBarClose = CalculateOnBarClose;
            indicator.Input = input;
            indicator.ChopIndicatorWidth = chopIndicatorWidth;
            indicator.NeutralBars        = neutralBars;
            indicator.Period             = period;
            indicator.PeriodEma          = periodEma;
            indicator.PeriodLinReg       = periodLinReg;
            indicator.PeriodTurbo        = periodTurbo;
            indicator.SideWinderLimit0   = sideWinderLimit0;
            indicator.SideWinderLimit1   = sideWinderLimit1;
            indicator.SideWinderWidth    = sideWinderWidth;

            WoodiesCCI[] tmp = new WoodiesCCI[cacheWoodiesCCI == null ? 1 : cacheWoodiesCCI.Length + 1];
            if (cacheWoodiesCCI != null)
            {
                cacheWoodiesCCI.CopyTo(tmp, 0);
            }
            tmp[tmp.Length - 1] = indicator;
            cacheWoodiesCCI     = tmp;
            Indicators.Add(indicator);

            return(indicator);
        }
コード例 #2
0
        /// <summary>
        /// Woodies variation of the CCI.
        /// </summary>
        /// <returns></returns>
        public WoodiesCCI WoodiesCCI(Data.IDataSeries input, int chopIndicatorWidth, int neutralBars, int period, int periodEma, int periodLinReg, int periodTurbo, int sideWinderLimit0, int sideWinderLimit1, int sideWinderWidth)
        {
            checkWoodiesCCI.ChopIndicatorWidth = chopIndicatorWidth;
            chopIndicatorWidth = checkWoodiesCCI.ChopIndicatorWidth;
            checkWoodiesCCI.NeutralBars = neutralBars;
            neutralBars = checkWoodiesCCI.NeutralBars;
            checkWoodiesCCI.Period = period;
            period = checkWoodiesCCI.Period;
            checkWoodiesCCI.PeriodEma = periodEma;
            periodEma = checkWoodiesCCI.PeriodEma;
            checkWoodiesCCI.PeriodLinReg = periodLinReg;
            periodLinReg = checkWoodiesCCI.PeriodLinReg;
            checkWoodiesCCI.PeriodTurbo = periodTurbo;
            periodTurbo = checkWoodiesCCI.PeriodTurbo;
            checkWoodiesCCI.SideWinderLimit0 = sideWinderLimit0;
            sideWinderLimit0 = checkWoodiesCCI.SideWinderLimit0;
            checkWoodiesCCI.SideWinderLimit1 = sideWinderLimit1;
            sideWinderLimit1 = checkWoodiesCCI.SideWinderLimit1;
            checkWoodiesCCI.SideWinderWidth = sideWinderWidth;
            sideWinderWidth = checkWoodiesCCI.SideWinderWidth;

            if (cacheWoodiesCCI != null)
                for (int idx = 0; idx < cacheWoodiesCCI.Length; idx++)
                    if (cacheWoodiesCCI[idx].ChopIndicatorWidth == chopIndicatorWidth && cacheWoodiesCCI[idx].NeutralBars == neutralBars && cacheWoodiesCCI[idx].Period == period && cacheWoodiesCCI[idx].PeriodEma == periodEma && cacheWoodiesCCI[idx].PeriodLinReg == periodLinReg && cacheWoodiesCCI[idx].PeriodTurbo == periodTurbo && cacheWoodiesCCI[idx].SideWinderLimit0 == sideWinderLimit0 && cacheWoodiesCCI[idx].SideWinderLimit1 == sideWinderLimit1 && cacheWoodiesCCI[idx].SideWinderWidth == sideWinderWidth && cacheWoodiesCCI[idx].EqualsInput(input))
                        return cacheWoodiesCCI[idx];

            WoodiesCCI indicator = new WoodiesCCI();
            indicator.SetUp();
            indicator.CalculateOnBarClose = CalculateOnBarClose;
            indicator.Input = input;
            indicator.ChopIndicatorWidth = chopIndicatorWidth;
            indicator.NeutralBars = neutralBars;
            indicator.Period = period;
            indicator.PeriodEma = periodEma;
            indicator.PeriodLinReg = periodLinReg;
            indicator.PeriodTurbo = periodTurbo;
            indicator.SideWinderLimit0 = sideWinderLimit0;
            indicator.SideWinderLimit1 = sideWinderLimit1;
            indicator.SideWinderWidth = sideWinderWidth;

            WoodiesCCI[] tmp = new WoodiesCCI[cacheWoodiesCCI == null ? 1 : cacheWoodiesCCI.Length + 1];
            if (cacheWoodiesCCI != null)
                cacheWoodiesCCI.CopyTo(tmp, 0);
            tmp[tmp.Length - 1] = indicator;
            cacheWoodiesCCI = tmp;
            Indicators.Add(indicator);

            return indicator;
        }