Exemplo n.º 1
0
        /// <summary>
        /// To handle the input value.
        /// </summary>
        /// <param name="input">The input value.</param>
        /// <returns>The resulting value.</returns>
        protected override IIndicatorValue OnProcess(IIndicatorValue input)
        {
            var ema1Value = _ema1.Process(input);

            if (!_ema1.IsFormed)
            {
                return(new DecimalIndicatorValue(this));
            }

            var ema2Value = _ema2.Process(ema1Value);

            return(new DecimalIndicatorValue(this, 2 * ema1Value.GetValue <decimal>() - ema2Value.GetValue <decimal>()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Обработать входное значение.
        /// </summary>
        /// <param name="input">Входное значение.</param>
        /// <returns>Результирующее значение.</returns>
        protected override IIndicatorValue OnProcess(IIndicatorValue input)
        {
            var ema1Value = _ema1.Process(input);

            if (!_ema1.IsFormed)
            {
                return(input);
            }

            var ema2Value = _ema2.Process(ema1Value);

            if (!_ema2.IsFormed)
            {
                return(input);
            }

            var ema3Value = _ema3.Process(ema2Value);

            return(_ema3.IsFormed ? _roc.Process(ema3Value) : input);
        }