Пример #1
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;
            }

            timestampNow = _timestamp;
            valueNow     = _value;

            double tmpDiff = maSub.getIndicator().value - signalMa.getIndicator().value;

            if (tmpDiff != 0d)
            {
                lastDifference = tmpDiff;
            }

            maSub.setNextData(_timestamp, _value);
            signalMa.setNextData(_timestamp, maSub.getIndicator().value);
        }
Пример #2
0
        public override TimeValueData getIndicator()
        {
            double upperBond = (ma.getIndicator().value *valueNow) + (std.getIndicator().value *stdMultiplicator);
            double lowerBond = (ma.getIndicator().value *valueNow) - (std.getIndicator().value *stdMultiplicator);

            double value = (valueNow - lowerBond) / (upperBond - lowerBond);

            if (value > 1)
            {
                value = 1;
            }

            if (value < 0)
            {
                value = 0;
            }

            return(new TimeValueData(timestampNow, value));
        }
        public override double getIndicator()
        {
            double upperBond = (ma.getIndicator() * valueNow) + (std.getIndicator() * stdMultiplicator);
            double lowerBond = (ma.getIndicator() * valueNow) - (std.getIndicator() * stdMultiplicator);

            double value = (valueNow - lowerBond) / (upperBond - lowerBond);

            if (value > 1)
            {
                value = 1;
            }

            if (value < 0)
            {
                value = 0;
            }

            return(value);
        }
 public override double getIndicator()
 {
     return(ma.getIndicator() - valueNow);
 }
 public override double getIndicator()
 {
     return(maOne.getIndicator() - maTwo.getIndicator());
 }
 public override TimeValueData getIndicator()
 {
     return(new TimeValueData(timestampNow, rsi.getIndicator().value - signalMa.getIndicator().value));
 }
 public override double getIndicator()
 {
     return(maSub.getIndicator() - signalMa.getIndicator());
 }
Пример #8
0
 public override TimeValueData getIndicator()
 {
     return new TimeValueData(timestampNow, maOne.getIndicator().value - maTwo.getIndicator().value);
 }
Пример #9
0
 public override TimeValueData getIndicator()
 {
     return(new TimeValueData(timestampNow, ma.getIndicator().value - valueNow));
 }