public override double getIndicator()
        {
            double output;

            if (stoch.getIndicator() < border)
            {
                output = 0;
            }
            else if (stoch.getIndicator() > 1 - border)
            {
                output = 1;
            }
            else
            {
                output = 0.5;
            }

            return(output);
        }
        public override TimeValueData getIndicator()
        {
            double output;

            if (stoch.getIndicator().value < border)
            {
                output = 0;
            }
            else if (stoch.getIndicator().value > 1 - border)
            {
                output = 1;
            }
            else
            {
                output = 0.5;
            }

            return(new TimeValueData(timestampNow, output));
        }
예제 #3
0
        public override void setNextData(long _timestamp, double _value)
        {
            if (_timestamp < timestampNow)
            {
                throw new Exception("Cant add older data here!");
            }

            if (_timestamp == timestampNow && _value != valueNow)
            {
                throw new Exception("Same timestamp different value!");
            }

            if (_timestamp == timestampNow && _value == valueNow)
            {
                return;
            }

            lastSeenStochValue = stoch.getIndicator().value;
            stoch.setNextData(_timestamp, _value);

            timestampNow = _timestamp;
            valueNow     = _value;
        }