예제 #1
0
        public StochasticsRsiOscillator(IEnumerable <TInput> inputs, Func <TInput, decimal?> inputMapper, int periodCount) : base(inputs, inputMapper)
        {
            _rsi = new RelativeStrengthIndexByTuple(inputs.Select(inputMapper).ToList(), periodCount);

            _rsiLow  = i => Enumerable.Range(i - periodCount + 1, periodCount).Min(j => _rsi[j]);
            _rsiHigh = i => Enumerable.Range(i - periodCount + 1, periodCount).Max(j => _rsi[j]);

            PeriodCount = periodCount;
        }
        public NetMomentumOscillator(IEnumerable <TInput> inputs, Func <TInput, decimal?> inputMapper, int periodCount) : base(inputs, inputMapper)
        {
            _rsi = new RelativeStrengthIndexByTuple(inputs.Select(inputMapper), periodCount);

            PeriodCount = periodCount;
        }