コード例 #1
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="indicator"> the indicator (usually close price) </param>
        /// <param name="longRoCTimeFrame"> the time frame for long term RoC </param>
        /// <param name="shortRoCTimeFrame"> the time frame for short term RoC </param>
        /// <param name="wmaTimeFrame"> the time frame (for WMA) </param>
        public CoppockCurveIndicator(IIndicator <Decimal> indicator, int longRoCTimeFrame, int shortRoCTimeFrame, int wmaTimeFrame) : base(indicator)
        {
            var sum = new SumIndicator(new RocIndicator(indicator, longRoCTimeFrame), new RocIndicator(indicator, shortRoCTimeFrame)
                                       );

            _wma = new WmaIndicator(sum, wmaTimeFrame);
        }
コード例 #2
0
        public HmaIndicator(IIndicator <Decimal> indicator, int timeFrame) : base(indicator)
        {
            _timeFrame = timeFrame;

            var halfWma = new WmaIndicator(indicator, timeFrame / 2);
            var origWma = new WmaIndicator(indicator, timeFrame);

            IIndicator <Decimal> indicatorForSqrtWma = new DifferenceIndicator(new MultiplierIndicator(halfWma, Decimal.Two), origWma);

            _sqrtWma = new WmaIndicator(indicatorForSqrtWma, (int)Math.Sqrt(timeFrame));
        }